|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Button not working, axis are.
We are trying to control our functional mechanisms using buttons on our controller. The problem that we have though, is that when we try to control it using buttons, the motor keeps rapidly turning on and off (basically twitching). When I map the control to an axis though. It works flawlessly. Using Labview.
|
|
#2
|
|||
|
|||
|
Re: Button not working, axis are.
When we use one case structure saying if button is true then turn on motor, if false then set output to zero. the moment we add another case structure to control the motor in the other direction, it starts twitching.
|
|
#3
|
|||||
|
|||||
|
Re: Button not working, axis are.
Sounds like you're setting the output to the motor twice. You need to make sure you only set the output of the motor once in your loop.
If you can post a picture or snapshot of your code, we can tell you more exactly how you're going wrong. |
|
#4
|
|||
|
|||
|
Re: Button not working, axis are.
Here ya go
|
|
#5
|
|||||
|
|||||
|
Re: Button not working, axis are.
Okay, I was hoping someone else would show up to draw up the correct solution, since I don't have Labview installed at the moment.
Anyways, you're definitely setting the output for the motor twice, because you have a set output VI in each of those case structures. To fix that, you need to do two things: 1. Only use one set output VI per motor. Delete all the Set output VIs in those case structures. Put one Set Output VI outside the case structure. 2. Use values inside the case structures to feed the Set Output VI. You want one big case structure with +1 inside the TRUE case, and ANOTHER small case structure inside big one's FALSE case. Then, put a -1 in the TRUE case of the smaller structure, and a 0 inside the FALSE case of the smaller structure. I'll try to hack up a drawing in Paint or something since I don't have Labview. Or maybe we'll get lucky and someone with Labview will wire up what I just described. Feel free to post a screenshot of your attempt at what I just described there. |
|
#6
|
|||||
|
|||||
|
Re: Button not working, axis are.
Here's an example using buttons to drive a motor.
http://www.chiefdelphi.com/forums/at...6&d=1454729278 |
|
#7
|
|||
|
|||
|
Re: Button not working, axis are.
Great! Thank you very much! I'll give this a try.
|
|
#8
|
|||
|
|||
|
Re: Button not working, axis are.
It's not working for me, tell me if this looks right.
|
|
#9
|
|||
|
|||
|
Re: Button not working, axis are.
Did you register the mew motor controllers in the begin.vi?
This should work as long as each motor was set up in the begin file and has a unique PWM was selected for each motor. If it still is not working make sure that you have the correct button on the joystick selected. If you put one motor control in the loop does it run? |
|
#10
|
|||
|
|||
|
Re: Button not working, axis are.
I have them all initizlized in the begin.vi
The 3 controllers being used are a talon srx, talon, and victor. My problem is that only one motor turns with one button. |
|
#11
|
|||
|
|||
|
Re: Button not working, axis are.
Can you show the begin file where these VI's are registered?
|
|
#12
|
|||||
|
|||||
|
Re: Button not working, axis are.
Sorry,
That will work as long as you continue to hold a button down. As soon as the button is released the motor will stop. Do you want something different to happen or is the motor still pulsing? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|