I'm using CVD223-K 2 phase stepper motor driver with a 2 phase Oriental stepper motor. I tried to interface the driver's Direction pins i.e. CW and CCW with a PSOC MCU's GPIO. The driver's DIP switch settings were as follows,
- 2 pulse mode enabled
- Smooth Drive ON
- Rest of the switches are towards OFF position
The MCU does a homing sequence wherein the motor rotates clockwise until the limit switch is closed and rotates in a counter-clockwise direction until the limit switch is opened. During the course of the evaluation of the driver, I ran into some issues, like I can't do homing twice, it would perform one homing position and stall. Upon further debugging, I found out when the Command filter DIP switch is turned ON this issue was resolved. When I put homing in a while loop so it executes indefinitely I noticed something, the first homing has proper movement but the subsequent homing is totally different. The video in the link shows what I have described, first homing movement is the desired one but the rest of homing movements are small movements, I had reset the MCU a couple of times to make this observation evident.
The PWM frequency used is 1KHz (300RPM) and the duty cycle is 50%.
In code first I disable Microstepping, feed pulses to appropriate pin and stop PWM then feed different pin with the PWM pulses for opposite direction rotation.
My question is what are the sequences that I must follow when driving these pins with regards to pin drive mode, whether when driving CW pin should the CCW put to high impedance and why the above "homing repeatedly" command renders incorrect homing movement except for the first iteration which is the desired one.
Since this drive mechanism is going to be used in a Medical device these kinds of behaviors cannot be present, if anyone could shed some light on this issue it would be great.
Thanks in Advance