Go to Post It's up to veteran teams and mentors to help keep the original spirit of FIRST alive. - It's up to us to make these boards exemplify the FIRST principals in every post. - Ben Mitchell [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-04-2009, 00:14
pyr0b0y pyr0b0y is offline
Programmer/Electrical
AKA: Josh
FRC #0253 (Mills Robotics Team)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2004
Location: Millbrae
Posts: 78
pyr0b0y is an unknown quantity at this point
Send a message via AIM to pyr0b0y
Joystick Button Issues

We used the joystick buttons, NOT the triggers, to control motors on our robot. for some reason, when we try and start the motor, it seems to get stuck when we press the button. If i reprogram the button the be a trigger, then there seems to be no problem at all and the motor runs fine in forward and reverse.

are there known issues with these buttons on the joystick???
Reply With Quote
  #2   Spotlight this post!  
Unread 19-04-2009, 19:09
JasonF JasonF is offline
Registered User
FRC #2848 (The All Sparks)
Team Role: Programmer
 
Join Date: Apr 2009
Rookie Year: 2009
Location: Irving Texas
Posts: 24
JasonF is an unknown quantity at this point
Re: Joystick Button Issues

We have used buttons to control motors with no problems at all...

If you want to reduce the possibility of a hardware issue, simple probe the correct output in LabView for the Boolean value.

I doubt it is any type of hardware issue. I am not sure what you mean by the motor gets 'stuck'

But I would say: Make sure while your true statement of the IF structure has whatever speed going to the set speed, be sure to Copy the Set Speed and make it a constant of 0 so that they motor does turn off when you disengage the button.

If that doesn't solve it i guess post up your code or try explaining some more symptoms. I can post some simple code but it should be pretty easy to set up.

Hope that helps,

Jason
Reply With Quote
  #3   Spotlight this post!  
Unread 20-04-2009, 13:01
pyr0b0y pyr0b0y is offline
Programmer/Electrical
AKA: Josh
FRC #0253 (Mills Robotics Team)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2004
Location: Millbrae
Posts: 78
pyr0b0y is an unknown quantity at this point
Send a message via AIM to pyr0b0y
Re: Joystick Button Issues

For the motors I have them programmed to Button 3 and Button 4. I have double checked my code numerous times and the code is correct because I try the same motor with the trigger button. I have also replaced the motor to see if the motor was faulty, but that was not it either. Whenever I press the button to make the motor go forward, it starts for a spilt second, then gets stuck and stutters its way around; the same happens when I try to go backwards.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-04-2009, 13:24
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,113
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: Joystick Button Issues

Quote:
Originally Posted by pyr0b0y View Post
For the motors I have them programmed to Button 3 and Button 4. I have double checked my code numerous times and the code is correct because I try the same motor with the trigger button. I have also replaced the motor to see if the motor was faulty, but that was not it either. Whenever I press the button to make the motor go forward, it starts for a spilt second, then gets stuck and stutters its way around; the same happens when I try to go backwards.
This behavior is consistent with a specific programming error. Check your software to make sure that only buttons 3 and 4 are controlling the motor. What happens if you try pressing the trigger at the same time as one of the other buttons? You might have another spot somewhere in the code where the unpressed trigger is turning the motor off.
Reply With Quote
  #5   Spotlight this post!  
Unread 20-04-2009, 20:58
pyr0b0y pyr0b0y is offline
Programmer/Electrical
AKA: Josh
FRC #0253 (Mills Robotics Team)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2004
Location: Millbrae
Posts: 78
pyr0b0y is an unknown quantity at this point
Send a message via AIM to pyr0b0y
Re: Joystick Button Issues

Right now, the programming for the motors is:

Press Button 1, goes forward
Press Button 2, goes backward

This is on both of the left and right joysticks, how can I avoid this problem?
Reply With Quote
  #6   Spotlight this post!  
Unread 20-04-2009, 21:06
Cuse's Avatar
Cuse Cuse is offline
Registered User
AKA: Matt Mancuso
FRC #0175 (Buzz Robotics)
Team Role: Alumni
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Enfield, CT
Posts: 22
Cuse is an unknown quantity at this point
Re: Joystick Button Issues

You could have the nested case structures for the motor, where it ignores input from the other joystick if one is in use.

Eg, if buttons 1 & 2 on Joystick 1 are both false then check for input on 2.
__________________

Reply With Quote
  #7   Spotlight this post!  
Unread 21-04-2009, 09:29
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,752
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: Joystick Button Issues

Quote:
Originally Posted by pyr0b0y View Post
... , how can I avoid this problem?
The easiest way is to limit the number of places in your code where you set the speed on a given motor. Use logic to determine the parameters that then flow into a single block to update the motor speed.

The typical, but incorrect approach, is to have conditional code scattered about the teleop loop that computes the value of speed and immediately updates the motor. It seems fine except for the fact that other logic which may not be exclusive is doing similar things elsewhere. When there is nothing to arbitrate the outcome, we call this a race condition .

If you were one of the twelve who attended my advanced LV presentation this will be review, otherwise, my analogy is to give two people in the same room identical remote controls to a common TV. Instruct one of them to turn the tele to channel 12, and the other to channel 34. What outcomes can you forsee? The correct answers include 12, 34, 1234, 3412, 2, 4, 1342, 3124, and there could be others depending on the protocol -- unpredictable. How do you fix it? Have only one remote control or develop an access control mechanism so that only one person can use their remote at a time.

Returning to the motor update issue, delete all but one of the motor updates for a particular motor channel, move this subVI to the right of the teleop loop, and wire the computed values from various logic to that subVI. If you had potentially parallel updates, you will have multiple inputs that will break the wire. Fix the logic so that a given set of inputs produces only one outcome -- you needed to do this anyway as the motor can only have one speed.

If you want more background on this topic, search for race conditions in programming, and especially on LV forums you will get more insight, thought, and religion on this than you probably care for. I suspect other parallel languages will have similar discussions. Or ask more detailed questions here.

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Joystick Button Press dboisvert C/C++ 6 07-03-2009 11:09
joystick button furiousgeorge Programming 5 07-02-2009 15:57
Programming a joystick button... programmr Programming 2 05-01-2009 16:13
Joystick Button programming Bharat Nain Programming 5 18-02-2005 11:48
Joystick Button Deference cibressus53 Electrical 3 01-11-2004 09:38


All times are GMT -5. The time now is 21:35.

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