Go to Post The GDC made something easier??? Link or it didn't happen! - JesseK [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 15-02-2012, 20:01
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Damping the joystick at 1

Sorry for the undescriptive name, but there's no real way to describe this with my high-school math knowledge.

We've noticed that when our robot goes at a speed, and then moves in the opposite direction at the same speed, it starts tipping over. As such, we'd like the joystick, when it is set to a certain value (let's say 1), to slowly ramp up toward that value, instead of immediately going to it.

Any ideas?
Reply With Quote
  #2   Spotlight this post!  
Unread 15-02-2012, 20:14
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: Damping the joystick at 1

Quote:
Originally Posted by Pirate programe View Post
Sorry for the undescriptive name, but there's no real way to describe this with my high-school math knowledge.

We've noticed that when our robot goes at a speed, and then moves in the opposite direction at the same speed, it starts tipping over. As such, we'd like the joystick, when it is set to a certain value (let's say 1), to slowly ramp up toward that value, instead of immediately going to it.

Any ideas?
Run your joystick commands through a rate-limit filter.

Do the LabVIEW equivalent of this:

Code:
change = joystick - limitedJoystick;
if (change>limit) change = limit;
else (if change<-limit) change = -limit;
limitedJoystick += change;
limit is the amount of change you will allow every iteration

limitedJoystick is the rate-limited joystick value you use to control your motors.


Last edited by Ether : 15-02-2012 at 20:42.
Reply With Quote
  #3   Spotlight this post!  
Unread 15-02-2012, 22:23
Cecil's Avatar
Cecil Cecil is offline
Registered User
AKA: Alex Hummel
FRC #2010 (Lightning Bots)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Champion
Posts: 343
Cecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to behold
Re: Damping the joystick at 1

Also, with the Jaguar v.101 firmware, you can set the speed controllers to automatically ramp up the values by simply turning the limit switch jumpers sideways. You don't need to be using CAN to do this, either, only the firmware is needed.

More information on this can be found here.

Seems a lot easier to me to just do this, if the ramp rate is good enough (I haven't tried this method yet)
__________________
I'm right 90% of the time, so why worry about the other 3%?
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2012, 11:43
juchong's Avatar
juchong juchong is offline
Electrical Engineer
AKA: Juan Chong
FRC #2655 (Flying Platypi)
Team Role: Engineer
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Greensboro, NC
Posts: 105
juchong is a jewel in the roughjuchong is a jewel in the roughjuchong is a jewel in the rough
Re: Damping the joystick at 1

Just add this VI to your Teleop loop. All you have to do is wire your joystick input (which must be between -1 and 1) to the "joystick input" side, wire the output to your motor control VI, and pick a constant for scaling. Start with 0.1 and tune it in to what you think is best.

Once you have that, repeat for the other axis and you're done!
Attached Files
File Type: vi Joystick Scaling.vi (17.1 KB, 39 views)
__________________
Teams I've worked with:My Website: http://www.juanjchong.com/
What I do: Analog Devices iSensor Product Engineer
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2012, 12:05
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,355
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Damping the joystick at 1

Quote:
Originally Posted by Ether View Post
Run your joystick commands through a rate-limit filter.

Do the LabVIEW equivalent of this:

Code:
change = joystick - limitedJoystick;
if (change>limit) change = limit;
else (if change<-limit) change = -limit;
limitedJoystick += change;
limit is the amount of change you will allow every iteration

limitedJoystick is the rate-limited joystick value you use to control your motors.

There is a pre-built "PID" function in LabView that does exactly this. Search for "rate limit".
We are using this to keep us from stripping gears on our ball pickup if we reverse directions quickly on it.
Find a control value that works well by experimentation. For our ball pickup, a value of 45 is good. For drive control, you may want a higher number.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist

Last edited by billbo911 : 16-02-2012 at 12:47.
Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2012, 12:30
juchong's Avatar
juchong juchong is offline
Electrical Engineer
AKA: Juan Chong
FRC #2655 (Flying Platypi)
Team Role: Engineer
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Greensboro, NC
Posts: 105
juchong is a jewel in the roughjuchong is a jewel in the roughjuchong is a jewel in the rough
Re: Damping the joystick at 1

Quote:
Originally Posted by billbo911 View Post
There is a "PID" function in LabView that does exactly this. Search for "rate limit".
We are using this to keep us from stripping gears on our ball pickup if we reverse directions quickly on it.
Find a control value that works well by experimentation. For our ball pickup, a value of 45 is good. For drive control, you may want a higher number.
I agree, a PID block would also work well in this case. The VI that I created is essentially the Proportional (P) section of a PID block.
__________________
Teams I've worked with:My Website: http://www.juanjchong.com/
What I do: Analog Devices iSensor Product Engineer
Reply With Quote
  #7   Spotlight this post!  
Unread 16-02-2012, 12:55
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: Damping the joystick at 1

Quote:
Originally Posted by juchong View Post
The VI that I created is essentially the Proportional (P) section of a PID block.
Could you please post a PNG? I don't have LabVIEW installed here.

I'm wondering how you get a maximum rate limiter using only a P controller, without affecting the dynamics of commands which do not exceed the desired limit.


Reply With Quote
  #8   Spotlight this post!  
Unread 16-02-2012, 13:12
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,563
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Damping the joystick at 1

There are several methods in this whitepaper: http://thinktank.wpi.edu/article/140, including Ether's method, a reference to the PID Output Rate Limiter, and some introduction to low pass filters.
Reply With Quote
  #9   Spotlight this post!  
Unread 16-02-2012, 15:41
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Re: Damping the joystick at 1

Quote:
Originally Posted by Ether View Post
Could you please post a PNG? I don't have LabVIEW installed here.

I'm wondering how you get a maximum rate limiter using only a P controller, without affecting the dynamics of commands which do not exceed the desired limit.
Here's that PNG.

The use of a feedback node is throwing me off a bit, but it seems pretty straightfoward...
Attached Thumbnails
Click image for larger version

Name:	scrncap1.png
Views:	51
Size:	4.5 KB
ID:	11928  
Reply With Quote
  #10   Spotlight this post!  
Unread 16-02-2012, 16:10
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: Damping the joystick at 1

Quote:
Originally Posted by Pirate programe View Post
Here's that PNG.

The use of a feedback node is throwing me off a bit, but it seems pretty straightfoward...

Thanks, but you misread my post. My post was addressed to juchong. I was asking for a PNG of the P-controller vi he attached to post#4.

What you posted is not a P controller. It's slew rate limiter; the LabVIEW equivalent of the C pseudo-code in post#2.


Reply With Quote
  #11   Spotlight this post!  
Unread 16-02-2012, 17:12
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Re: Damping the joystick at 1

Quote:
Originally Posted by Ether View Post
Thanks, but you misread my post. My post was addressed to juchong. I was asking for a PNG of the P-controller vi he attached to post#4.
That's exactly what it was.
Reply With Quote
  #12   Spotlight this post!  
Unread 16-02-2012, 19:06
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: Damping the joystick at 1

Quote:
Originally Posted by Pirate programe View Post
That's exactly what it was.
OK then. For the benefit of students reading this thread, it's not the Proportional (P) section of a PID block. It's a slew rate limiter, and it's identical to the one in the WPI paper Joe linked to.

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 11:13.

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