![]() |
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.
|
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 |
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.
|
Re: Help with buttons and periodic tasks
|
Re: Help with buttons and periodic tasks
1 Attachment(s)
. .
[edit] Mark beat me to it |
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?
|
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 |
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.
|
Re: Help with buttons and periodic tasks
Thanks I'll make those changes. Should I not put different timed shots on different buttons?
|
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