Go to Post GP isn't just a good idea, it's mathematically optimal. - Jared Russell [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 15-02-2014, 20:15
Crisann25 Crisann25 is offline
Registered User
FRC #0499
 
Join Date: Feb 2014
Location: San Antonio,TX
Posts: 3
Crisann25 is an unknown quantity at this point
Help with buttons and periodic tasks

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.
Attached Thumbnails
Click image for larger version

Name:	image.jpg
Views:	59
Size:	913.0 KB
ID:	16243  
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2014, 09:02
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Help with buttons and periodic tasks

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
Attached Thumbnails
Click image for larger version

Name:	From Clipboard.jpg
Views:	42
Size:	426.5 KB
ID:	16250  

Last edited by Greg McKaskle : 16-02-2014 at 09:26. Reason: Trying to attach the image
Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2014, 09:02
chris.boyle's Avatar
chris.boyle chris.boyle is offline
Programming Mentor
FRC #0068 (Truck Town Thunder)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Truck Town Thunder (Brandon)
Posts: 36
chris.boyle is on a distinguished road
Re: Help with buttons and periodic tasks

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.
Attached Thumbnails
Click image for larger version

Name:	MultilpleButtonsForSingleMotor.png
Views:	56
Size:	12.9 KB
ID:	16246  
__________________
2014 Chairman's Award--Michigan State Championship
2014 Chairman's Award--Waterford District
2014 Winner--Great Lakes Bay District
2013 Chairman's Award--Kettering District
2012 Championship Division Finalists--Thanks 330 and 639
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2014, 09:14
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,731
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Help with buttons and periodic tasks

Here is how the style you are using should be connected.



Some other LabVIEW examples
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 16-02-2014 at 09:28.
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2014, 09:31
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Help with buttons and periodic tasks

. .

[edit] Mark beat me to it
Attached Thumbnails
Click image for larger version

Name:	buttons.jpg
Views:	44
Size:	25.1 KB
ID:	16251  
Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2014, 14:48
Crisann25 Crisann25 is offline
Registered User
FRC #0499
 
Join Date: Feb 2014
Location: San Antonio,TX
Posts: 3
Crisann25 is an unknown quantity at this point
Re: Help with buttons and periodic tasks

Thanks I'll give those a shot! Do you think you can double check my periodic tasks too?
Attached Thumbnails
Click image for larger version

Name:	image.jpg
Views:	39
Size:	685.6 KB
ID:	16260  
Reply With Quote
  #7   Spotlight this post!  
Unread 16-02-2014, 15:49
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
  #8   Spotlight this post!  
Unread 16-02-2014, 19:30
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2014, 00:19
Crisann25 Crisann25 is offline
Registered User
FRC #0499
 
Join Date: Feb 2014
Location: San Antonio,TX
Posts: 3
Crisann25 is an unknown quantity at this point
Re: Help with buttons and periodic tasks

Thanks I'll make those changes. Should I not put different timed shots on different buttons?
Reply With Quote
  #10   Spotlight this post!  
Unread 17-02-2014, 07:06
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:26.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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