06-24-2013 11:24 AM
HI,
I'm posting here on the advice of the Labview technical support, I previously posted this question in the link below, but have thus far been unable to resolve the issue.
http://forums.ni.com/t5/LabVIEW/Stepper-motor-oscilates-in-reverse-using-Arduino/td-p/2467428
All the details are in the above link, but in brief:
I have a VI which I’m using to drive a stepper motor. A signal is read from a potentiometer using an Arduino MEGA, processed and then used for the speed input to a stepper motor which is driven by the same arduino. Using the attached simple case the stepper motor speed should be driven by the signal read by the arduino from the potentiometer. If it is positive the motor should rotate forward, if it is negative the motor should rotate backwards, if it is 0 the False case is activated and the motor stops. The Input signal reads integer values of -250 to 250. The case structure has been tested and it working correctly.
If I run the VI as shown in Simple-True.jpg the motor is driven by the potentiometer signal and rotates in the forward direction correctly, the speed varying with input value. However, if supplied with a negative value to motor oscilates.
If the motor is driven by the controller "Stepper Speed Input" then the motor moves correctly in both forward and reverse, with the speed coresponding to the controler value. The values used were in the same range as those previously supplied by the "Input Signal".
I beleive that my hardware is correct as the motor works correctly when driven by the controller. What i can't understand is what is the difference between driving it by the controler and driving it by the input signal, further more why will it work in positive direction, but not the negative when driven by the input signal? Could this be a software bug? it seems to be behaving illogicaly. I have attached a chart to the signal input and it shows that at no point does the signal become positive when in reverse.
I'm using Labview 2012, i have attached the code for this case.
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?