Quantcast
Viewing all articles
Browse latest Browse all 69137

Stepper motor oscilates in reverse using Arduino

I have a VI which I’m using to drive 3 stepper motors. A signal is read from a potentiometer using an Arduino, processed and then used for the speed input to a stepper motor which is driven by the same arduino. The input signal to the stepper motor is an integer number in the range of -250 to +250. If the input value is 0 the motors are stationary, if the input is positive the motors are driven forwards, if the input signal is negative the motors should be driven in reverse.

 

My problem is that if the input signal is negative the motors oscillate and do not reverse. The motors work correctly going forward and stop correctly. The inputs to the case structure are correct and when using a negative input in an attempt to reverse the motors the signal is always negative, I cannot see the signal becoming positive at any point using the probe feature. The same behaviour occurs on all three motors. the oscillation is approximately equal to the number of steps, but i can't be sure on this and it might just be a coincidence, also the input signal has a small amount of noise in it, i.e if the potentiometer is left stationary the input value will range from say 100 to 103, values changing 2-3 times per second (seen using a indicator).

 

If i remove the signal input and replace it with a control value the motor turns correctly in reverse, i.e remove the line connecting Base Input to the stepper driver icon and replace it with a control inside the case structure. This suggests to me that it is not a hardware problem. The true/false values used to drive the case structure are working correctly.

 

I have attached a copy of the code and images of the motor driver feature.

 

Has anyone had similar problems or does anyone have any suggestions.

 

 

Labview version: 2012

Arduino type: Mega

 


Viewing all articles
Browse latest Browse all 69137

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>