Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Help with buttons and periodic tasks (http://www.chiefdelphi.com/forums/showthread.php?t=126537)

Crisann25 15-02-2014 20:15

Help with buttons and periodic tasks
 
1 Attachment(s)
I'm a first year coach, and had to step in and learn labview along with my freshmen. We are trying to run the shoot arm in periodic tasks and it is acting buggy. The up button (3) in teleop works fine, the down (2) button is jerky and works spontaneously. The arm also twitches if everything is idle. The triggers seem to work fine except that the output is erratic especially for joystick 2. Any help or guidance would be appreciated.

Greg McKaskle 16-02-2014 09:02

Re: Help with buttons and periodic tasks
 
1 Attachment(s)
I don't know that I can explain all of the symptoms, but your screenshot shows that it is possible for the code to send different commands to the motor in parallel or one after the other. Just as you have used the ?: select statement to choose between 0 and 0.2 for one button, you can cascade them for additional buttons. The attachment shows some edits. Hopefully this makes sense.

My suspicion is that other areas in the code are also setting ShootArm. If you ctl-F and search for that string, it will help you find them. Consider how you would combine them so that your motors aren't responding to conflicting directions shouted from different areas of the code. Of course I'm just guessing that this may be going on.

Anyway, please make the edits and look for similar issues in teleop and other areas of the code. Post if you have questions.

Greg McKaskle

chris.boyle 16-02-2014 09:02

Re: Help with buttons and periodic tasks
 
1 Attachment(s)
The motor is jerky because you are trying to write a zero and a non zero value at the same time. Below is another method to try.

Mark McLeod 16-02-2014 09:14

Re: Help with buttons and periodic tasks
 
Here is how the style you are using should be connected.



Some other LabVIEW examples

Ether 16-02-2014 09:31

Re: Help with buttons and periodic tasks
 
1 Attachment(s)
. .

[edit] Mark beat me to it

Crisann25 16-02-2014 14:48

Re: Help with buttons and periodic tasks
 
1 Attachment(s)
Thanks I'll give those a shot! Do you think you can double check my periodic tasks too?

Greg McKaskle 16-02-2014 15:49

Re: Help with buttons and periodic tasks
 
There are wires that leave the screen and come back, but it sure looks like you have two different loops that look at a joystick button and control the shooter arm. True, they are buttons on two different joysticks, but if both are pressed, the outcome would be pretty much impossible to predict.

Also, you are explicitly enabling motor safety. When you do this, the motors will update to zero if they don't receive a value every 100ms by default. But you are waiting for hundreds of ms at points. You probably don't need motor safety on for your shooter.

Greg McKaskle

Alan Anderson 16-02-2014 19:30

Re: Help with buttons and periodic tasks
 
The Motor Set Output function accepts values from -1 to +1. If I'm reading your code correctly, you're trying to set the motor to a power 90 times as large as is possible.

Crisann25 17-02-2014 00:19

Re: Help with buttons and periodic tasks
 
Thanks I'll make those changes. Should I not put different timed shots on different buttons?

Greg McKaskle 17-02-2014 07:06

Re: Help with buttons and periodic tasks
 
Controlling a device with different buttons makes perfect sense, but you should probably make sure that the code will only respond in one way.

Depending on how comfortable you are with LabVIEW, I'd probably take each sequence, of timed code and use SubVI from Selection to make it into a subVI.
Next, I'd combine the loops, meaning that one loop would read both joysticks combine the results and select one action for the shooter. Then I'd select one subVI to run. This will also make it easier to create new shooter routines.

Greg McKaskle


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

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