|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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! ![]() |
|
#2
|
||||
|
||||
|
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? |
|
#3
|
|||
|
|||
|
Re: Motor/Speed control
I'll be sure to check that out in a sec.
No, I meant a button on the joystick. Thanks! |
|
#4
|
||||
|
||||
|
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!
|
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
Re: Motor/Speed control
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. |
|
#7
|
|||
|
|||
|
Re: Motor/Speed control
Thanks!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|