Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   How to program two buttons to control the same motor. (http://www.chiefdelphi.com/forums/showthread.php?t=107604)

gabrielc97 01-08-2012 22:31

How to program two buttons to control the same motor.
 
Hello! we were trying to program two buttons to control a CIM motor. one button gives the motor a value of 1, and the other gives the motor a value of 0.6. every time that we push the first button, it moves perfectly. however, when we push the second button, it stutters, and spins ridiculously slow. we know that it is not the number because on another test with the same values, the button that gives the motor a value of 0.6 works and the motor spins at 60% of the original speed. the other button is now the one that stutters or sometimes doesnt run at all. if anyone can help, we would really appreciate it.

Thanks!

plnyyanks 01-08-2012 22:43

Re: How to program two buttons to control the same motor.
 
It sounds like your implementation is causing multiple (different) values to be set to the motor during one iteration of your code.

You'll also want to determine which button you want to have priority (if both are pressed, what speed do you want the motor to spin at?). Then, you can either use a case structure or two select nodes to choose the motor speed, which you would then wire into a motor set VI. Try and write the code so that there's only one instance of the Motor Set VI controlling the motor.

Ether 01-08-2012 22:45

Re: How to program two buttons to control the same motor.
 

http://www.chiefdelphi.com/forums/at...7&d=1329451162

Brandon_L 05-08-2012 21:57

Re: How to program two buttons to control the same motor.
 
To add some background to what the above posters said, it sounds like you used two different motor set output VIs for the same motor. The code resulted in one being supplied with a 0 value, and the other with a 1 or 0.6. This will cause it to rapidly stop and start (in a matter of milliseconds) giving it the "sputtering" effect you described.

When controlling a motor, its always best to have a single "Motor Set Output" VI per motor, and manipulating the number being input into the VI through code such as Ether provided. If you stick to this simple rule of thumb of only one VI per motor, you'll never have two values "fighting" each other and giving this effect.

You can use the "Highlight Execution" button in Labview (the icon with the lightbulb) and run your code to literally watch what happens in slow motion. This is a pretty handy debugging tool.


All times are GMT -5. The time now is 10:52.

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