Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Motor/Speed control (http://www.chiefdelphi.com/forums/showthread.php?t=110957)

Dillonboy8 10-01-2013 21:18

Motor/Speed control
 
Hello!

I can't seem to figure out how to make my motor speed up and/or slow down when I press a button. Could you guys maybe help me out? Thanks!:)

propionate 10-01-2013 21:35

Re: Motor/Speed control
 
I'm not on a computer that has labVIEW at the moment, but hopefully I can help you out. If you properly installed LabVIEW, there should be a number of example VIs that you can access. One of these VIs is a motor control example, which will allow you to change the speed of a motor using a slider on the front panel. I suggest integrating this example into your code first, and then moving into using a button.

Speaking of which, you may have some problems controlling speed with just a single button. Do you want it to simply be on or off? Do you want variable speed?

Dillonboy8 10-01-2013 21:38

Re: Motor/Speed control
 
I'll be sure to check that out in a sec.

No, I meant a button on the joystick.

Thanks!

propionate 11-01-2013 00:41

Re: Motor/Speed control
 
Let me know if you need any more help... hopefully I will have LabVIEW installed soon so that I can give you example code if you need it. Best of luck!

Greg McKaskle 11-01-2013 07:43

Re: Motor/Speed control
 
There are other threads on this, but let me give an overview.

One common approach is to have little Motor Sets all over the code inside various switch blocks testing buttons. If you are careful this will work, but often, the logic isn't quite right and the code doesn't do what you want. Basically, last update wins, and sometimes it isn't clear how the motor got to the speed it is running at.

Another approach is to do the logic and whatnot, but all the code does is to output numbers. LV will help remind you to produce numbers in all cases. Then, in only one location on your teleop diagram, you update that motor. This makes it much easier to trace the logic and debug.

Greg McKaskle

Timekeeper00 11-01-2013 10:09

Re: Motor/Speed control
 
1 Attachment(s)
Here is a way to do it. I'm happy to answer any questions you have about it.

-Ti00

p.s. As a word of warning, I wrote this when I was really tired, so I think the logic is right, but I make no guarantees.

Dillonboy8 12-01-2013 11:26

Re: Motor/Speed control
 
Thanks!


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

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