Go to Post Yes, in human nature we like to get rewarded/recognized for things we do; however, you should not have to rely on this to be "successful". Remember the purpose of FIRST - To change our culture. - tim-tim [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-03-2016, 11:46
Bruceb's Avatar
Bruceb Bruceb is offline
Registered User
FRC #0706 (Cyberhawks)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Merton, wi
Posts: 613
Bruceb is a splendid one to beholdBruceb is a splendid one to beholdBruceb is a splendid one to beholdBruceb is a splendid one to beholdBruceb is a splendid one to beholdBruceb is a splendid one to beholdBruceb is a splendid one to behold
controlling the speed that a PID on the talon moves an arm

My programmers are trying to get the PID on a talon SRX to move an arm to a set of set points and hold it there. They have it working but when the set point button is pushed the arm appears to get maximum voltage at start and rapidly decreases to the set point. From start to stop it is less than a second and it holds position with no apparent oscilation so that is good but that high velocity start I am afraid is going to be hard on the VP planetary gears.
Is there a way to have the motors start at a lower voltage so the acceleration is not so violent?
Thanks
__________________
Mentor Team 706 The CyberHawks
2010 Wisconsin Regional Rockwell Automation Innovation in Control Award
2010 Wisconsin Regional Finalist
2013 Buckeye Regional Finalist
2014 Superior Regional Industrial Design Award
2014 Superior Regional Finalist
2014 Wisconsin Regional Finalist
2014 Wisconsin Motorola Quality Award
2015 Wisconsin Regional Motorola Quality Award
2015 Queen City Creativity Award
2016 Buckeye Regional Finalist
2016 Wisconsin Regional Finalist
2016 Wisconsin Regional Industrial Safety Award
2016 Wisconsin Regional Excellence in Engineering Award

https://www.youtube.com/user/Cyberhawks706
  #2   Spotlight this post!  
Unread 04-03-2016, 11:51
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: controlling the speed that a PID on the talon moves an arm

Look in the Talon SRX software manual for "closed loop ramp rate"
  #3   Spotlight this post!  
Unread 04-03-2016, 11:58
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,088
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: controlling the speed that a PID on the talon moves an arm

Quote:
Originally Posted by Bruceb View Post
Is there a way to have the motors start at a lower voltage so the acceleration is not so violent?
Thanks
Quote:
Originally Posted by Jared Russell View Post
Look in the Talon SRX software manual for "closed loop ramp rate"
What Jared said.

Or, you could put a simple ramp or low-pass filter on your setpoint command.


  #4   Spotlight this post!  
Unread 04-03-2016, 12:18
fireXtract fireXtract is offline
MegaHertz_Lux
FRC #2847 (Mega Hertz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: fmt
Posts: 42
fireXtract is an unknown quantity at this point
Re: controlling the speed that a PID on the talon moves an arm

In my java program I can use the
setOutputRange(min, max); // value from -1 to 1
function to limit the range the PIDSubsystem will use.
  #5   Spotlight this post!  
Unread 04-03-2016, 13:38
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,088
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: controlling the speed that a PID on the talon moves an arm

Quote:
Originally Posted by fireXtract View Post
limit the range the PIDSubsystem will use.
He doesn't necessarily want to limit the range of the output.

He wants to limit the rate of change of the output.


  #6   Spotlight this post!  
Unread 04-03-2016, 14:41
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 523
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: controlling the speed that a PID on the talon moves an arm

Quote:
Originally Posted by Ether View Post
He doesn't necessarily want to limit the range of the output.

He wants to limit the rate of change of the output.


That's a good point. The OP asked for rate-limiting, and the Talon's Ramp rate or Closed-Loop ramp rate could be used to accomplish this.

Unrelated but... capping the throttle limits can be done using the peak and nominal output settings.

As always, see Talon software reference manual and git hub examples for more info.
  #7   Spotlight this post!  
Unread 04-03-2016, 15:17
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,685
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: controlling the speed that a PID on the talon moves an arm

Quote:
Originally Posted by ozrien View Post
That's a good point. The OP asked for rate-limiting, and the Talon's Ramp rate or Closed-Loop ramp rate could be used to accomplish this.

Unrelated but... capping the throttle limits can be done using the peak and nominal output settings.

As always, see Talon software reference manual and git hub examples for more info.
That's output ramping, though. Restricting the output ramp rate can lead to instabilities and overshoot. What I'd really like in the next firmware for FRC is a setpoint ramp rate. You can do it using the motion profiling, but that's moderately complicated for most teams. A setpoint ramp would get 90% of users what they want here.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #8   Spotlight this post!  
Unread 04-03-2016, 15:22
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,088
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: controlling the speed that a PID on the talon moves an arm

Quote:
Originally Posted by Kevin Sevcik View Post
That's output ramping, though. Restricting the output ramp rate can lead to instabilities and overshoot. What I'd really like in the next firmware for FRC is a setpoint ramp rate.
I hear an echo...
Quote:
Originally Posted by Ether View Post
Or, you could put a simple ramp or low-pass filter on your setpoint command.
  #9   Spotlight this post!  
Unread 04-03-2016, 15:35
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,685
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: controlling the speed that a PID on the talon moves an arm

Ether, I could and have done that, but it's tricky to get smooth motion out of it. If you do it at the default program loop rate, you end up with audibly chunky motion, especially at higher speeds. So you have to do it in a timed task with a higher update rate, which is a decent bit to ask of a team that's just starting out with PID and just wants to slow things down a bit.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #10   Spotlight this post!  
Unread 04-03-2016, 15:38
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,088
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: controlling the speed that a PID on the talon moves an arm


No argument. Putting the input ramp in the SRX where it could update at 1KHz would be better.


  #11   Spotlight this post!  
Unread 04-03-2016, 16:06
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: controlling the speed that a PID on the talon moves an arm

Quote:
Originally Posted by Kevin Sevcik View Post
Restricting the output ramp rate can lead to instabilities and overshoot.
Restricting the rate after tuning the PID gains can do that, certainly. But having the rate limit in place first is a close simulation of adding inertia to the system. Oscillations and overshoot can be tuned out as usual.
  #12   Spotlight this post!  
Unread 04-03-2016, 21:16
Tuxedolarry's Avatar
Tuxedolarry Tuxedolarry is offline
Lead of Design/Electrical
AKA: Noah J.
FRC #0706 (CyberHawks)
Team Role: Electrical
 
Join Date: Feb 2015
Rookie Year: 2013
Location: Hartland, WI
Posts: 10
Tuxedolarry is an unknown quantity at this point
Re: controlling the speed that a PID on the talon moves an arm

Programmer from Op's team here.

We tried using this method as well as the setVoltageRampRate() method but they are not working. We have tried calling it in robot init as well as directly before and after we set the target position.
  #13   Spotlight this post!  
Unread 04-03-2016, 22:33
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,685
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: controlling the speed that a PID on the talon moves an arm

You should be able to see the ramp rate that's been set in the roboRIO web config for that Talon. Pull that up and confirm you're setting the ramp rate. If you are, you probably just aren't setting it low enough. In C++/Java, it's set in Volts per second. Something like 2V per second would be pretty slow and atleast noticeable. You could work up from there at that point.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #14   Spotlight this post!  
Unread 10-03-2016, 00:37
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 255
cpapplefamily has a spectacular aura aboutcpapplefamily has a spectacular aura about
Re: controlling the speed that a PID on the talon moves an arm

I been trying to do this as well. I set the mymotor.setVoltageRampRate(2). This also seems to allow w the deceleration too. I now get over shoot with a kp of .001.
Closed Thread


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 06:45.

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