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.

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.

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.

Here ya go

Untitleddocument.pdf (38.9 KB)


Untitleddocument.pdf (38.9 KB)

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.

Here’s an example using buttons to drive a motor.
http://www.chiefdelphi.com/forums/attachment.php?attachmentid=19986&d=1454729278

Great! Thank you very much! I’ll give this a try.

It’s not working for me, tell me if this looks right.





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?

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?

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.

Can you show the begin file where these VI’s are registered?

OK As I started looking at your code I notice a few things:

You have two inputs going to each motor controller. For the first one called “ArmPivot” You have button 3 on the joystick controlling the first t/f vi. and you have you have button 1 controlling the second t/f vi. Are you sure that you are getting the expected result for both of these values?

Do you know how to use a probe int he software? That would tell you a lot about what is going on. If you probe them and pull the trigger then you should see the probe value to change and you will start to be able to troubleshoot what is going on.

Look at this as well.





Also I notice you don’t have a button labeled zero (0). Just to be sure, the button marked one (1) on your gamepad is actually button zero (0) in the code. Arrays are weird that way and could affect the way the buttons operate versus what you want them to do.

The talon, and the victor are working now. The only other problem I have is with the CAN Talon srx. Do I need to specify a port that it is plugged into in my begin.vi? I didn’t think that I have to due to the fact the it is run through the CAN network…

The talon, and victor are working. The CAN Talon srx is not. in the begin.vi, is there a place where I need to specify where the talon is going? I’m assuming no due to the fact that it is going through CAN.

You have to give it the CAN ID of the Talon in Begin.vi.