Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Victor + CIM Motor = Jumpy when Negative (Reversed) (http://www.chiefdelphi.com/forums/showthread.php?t=92492)

dwmcc 20-02-2011 19:36

Victor + CIM Motor = Jumpy when Negative (Reversed)
 
Hello All,

Thanks in advance for any and all help on this issue.

We're using Labview with all updates installed, and our robot drives perfectly.
We have a Victor hooked up to PWM 3, and then to a CIM motor. In Labview, we have two True/False bracket that are separately hooked up to two different buttons from the Joystick. If Button 4 is true, it sets the Victor speed to 60. If it is false, it sets the speed to 0. In the other T/F bracket, it sees if Button 5 is true, and sets the Victor speed to -60. If it is false, it sets the speed to 0. The thinking is that if you press one button, the motor goes forward, and if you press the other, the motor goes backward. If no buttons are pressed, the motor is idle/stopped/set to 0.

Here's where it gets weird: If you press button 4, the CIM motor spins forward perfectly. If you press button 5, the CIM motor does not spin backward, and sometimes jumps backward (in reverse) in small increments. What the heck? The code should tell it to go in reverse just the same as it should have gone forward.

Now, we only have one T/F bracket, and we put, say button 4 (if true) to -60, and if false to 0, the motor spins in reverse perfectly.

The two T/F brackets are not connected, and shouldn't be influencing each other, right?

Any suggestions? We're stumped and haven't found any other problems like this on cheif delphi.

Thanks,
dwmcc
Team 2192 Programmer/Web Design/Electrician

Vikesrock 20-02-2011 19:40

Re: Victor + CIM Motor = Jumpy when Negative (Reversed)
 
You cannot set the motor output in multiple places in your code. This leads to what is called a "race condition". In this case whichever code loses the race determines the output for one cycle. 20ms later during the next cycle the other set of code could "win" the race.

You need to use nested Case structures or a combination of select nodes to get down to a single Set Output VI for each motor.

Joe Ross 21-02-2011 11:21

Re: Victor + CIM Motor = Jumpy when Negative (Reversed)
 
Kevin's described your main problem. Something else that might cause you problems in the future is that the jaguar and victor ranges are +/- 1. Your 60 is getting coerced to one. So, in the future, if you wanted to go half the speed you are going now, and try to enter 30, it won't change. To go half speed, you'd enter 0.5.


All times are GMT -5. The time now is 09:18.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi