Go to Post ...if most of the money comes from sponsors, I have a bit of a problem letting them [the students] charge off a cliff with it. - TimCraig [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

 
Reply
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 18-01-2017, 15:37
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,727
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: How is velocity control supposed to work on the Talon SRX?

I'd just like to add that if you have a fixed target speed, or at least a known maximum speed, that's what you should tune your FF at. There's inevitably going to be some non-linearities in the system, so if you know what your target or range will be, it makes more sense to minimize your FF error there.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Reply With Quote
  #17   Spotlight this post!  
Unread 18-01-2017, 16:36
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
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: How is velocity control supposed to work on the Talon SRX?

Quote:
Originally Posted by Kevin Sevcik View Post
I'd just like to add that if you have a fixed target speed, or at least a known maximum speed, that's what you should tune your FF at. There's inevitably going to be some non-linearities in the system, so if you know what your target or range will be, it makes more sense to minimize your FF error there.
Excellent point. I was assuming that would be inferred. Never assume.


Reply With Quote
  #18   Spotlight this post!  
Unread 19-01-2017, 10:12
ajlapp ajlapp is offline
Registered User
AKA: Anthony Lapp
None #0118 (Team RUSH and Robonauts)
 
Join Date: Sep 2001
Rookie Year: 1996
Location: Ortonville, MI
Posts: 648
ajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond repute
Re: How is velocity control supposed to work on the Talon SRX?

Does using this strategy prevent the controller from requesting max duty cycle when starting from zero?

What I'm currently seeing is my FF go to the requested value and stay there until near the target speed....the P term does not seem to boost the duty cycle request to max at startup as I initially expected.
__________________
Anthony Lapp
FIRST Engineering Mentor
Owner/Operator 221 Robotic Systems
221 Robotics Systems - Quality Hardware, Made in the USA
RobotOpen
anthony@221robotics.com
Twitter us: @221RobotSystems
Team 1 --> 94 --> 68 --> 221 --> 857 --> 27 --> 118
Design Engineer/Fabricator and 17 year vet
Team Rush (FRC27) and Robonauts (FRC118)
Reply With Quote
  #19   Spotlight this post!  
Unread 19-01-2017, 10:49
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,727
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: How is velocity control supposed to work on the Talon SRX?

Quote:
Originally Posted by ajlapp View Post
Does using this strategy prevent the controller from requesting max duty cycle when starting from zero?

What I'm currently seeing is my FF go to the requested value and stay there until near the target speed....the P term does not seem to boost the duty cycle request to max at startup as I initially expected.
It depends on your P and D terms and ramp rates. P works off the error in velocity, so is P is small, P*error might not be large enough to get 100% throttle. D works from change in error per cycle. It typically works against P. If your error is decreasing rapidly, D*err/time is negative, which reduces your throttle command from what P + FF would set. Too big a D term could limit how fast you come up to speed because of this. Finally, voltage ramp rate and closed loop ramp rate limit how fast the output can change. Your ramp rate has to be faster than the physical acceleration of the system, or by the time 100% output is allowed by the ramping, the error is too low for 100% output to be required.

What are your FF P and D terms, and target speed in encoder counts per second? (srx mag encoder is 4096 counts per rev, other encoders are 4 x CPR counts per rev)
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter

Last edited by Kevin Sevcik : 19-01-2017 at 10:51.
Reply With Quote
  #20   Spotlight this post!  
Unread 19-01-2017, 10:50
efoote868 efoote868 is offline
foote stepped in
AKA: E. Foote
FRC #0868
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Noblesville, IN
Posts: 1,420
efoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond repute
Re: How is velocity control supposed to work on the Talon SRX?

Quote:
Originally Posted by ajlapp View Post
Does using this strategy prevent the controller from requesting max duty cycle when starting from zero?

What I'm currently seeing is my FF go to the requested value and stay there until near the target speed....the P term does not seem to boost the duty cycle request to max at startup as I initially expected.
Not necessarily, it depends what your P term and your set point are.
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
Reply With Quote
  #21   Spotlight this post!  
Unread 19-01-2017, 11:01
ajlapp ajlapp is offline
Registered User
AKA: Anthony Lapp
None #0118 (Team RUSH and Robonauts)
 
Join Date: Sep 2001
Rookie Year: 1996
Location: Ortonville, MI
Posts: 648
ajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond repute
Re: How is velocity control supposed to work on the Talon SRX?

I'll double check everything in a bit....but I'm not using any ramp rate or any D...

I tried large P gains, so I thought, but saw almost no effect.

Perhaps they weren't large enough.
__________________
Anthony Lapp
FIRST Engineering Mentor
Owner/Operator 221 Robotic Systems
221 Robotics Systems - Quality Hardware, Made in the USA
RobotOpen
anthony@221robotics.com
Twitter us: @221RobotSystems
Team 1 --> 94 --> 68 --> 221 --> 857 --> 27 --> 118
Design Engineer/Fabricator and 17 year vet
Team Rush (FRC27) and Robonauts (FRC118)
Reply With Quote
  #22   Spotlight this post!  
Unread 19-01-2017, 11:49
Paul Copioli's Avatar Unsung FIRST Hero Woodie Flowers Award
Paul Copioli Paul Copioli is offline
President, VEX Robotics, Inc.
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Rockwall, TX
Posts: 1,392
Paul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond repute
Re: How is velocity control supposed to work on the Talon SRX?

Quote:
Originally Posted by ajlapp View Post
Does using this strategy prevent the controller from requesting max duty cycle when starting from zero?

What I'm currently seeing is my FF go to the requested value and stay there until near the target speed....the P term does not seem to boost the duty cycle request to max at startup as I initially expected.
Anthony,

I use I for that. I know 254 and even the SRX manual says go FF - P - D, but I am a purist. Note that if you use motion profile (externally) it will also get you what you desire.

For everyone else, real robot companies basically do this:

1. Tune FF (which is usually variable depending on desired speed) More on this later.

2. Tune I (this helps acceleration to desired speed)

3. Tune P (oscillations, blah, blah)

4. Tune D, if necessary

Note that if you are using an external motion profile generator (see 3310's code for the 2015 robot on Github) then you don't really need to tune I and tuning P/D is fine as the motion generator sets command velocity at each time step and the change in command is very low.


OK, let's demystify Feed Forward. It is really quite simple. FF is the command voltage (PWM duty cycle, whatever your team calls it when you give different voltages to the motor from the speed controller) it would take if everything is perfect with no friction, etc.

Some of us calculate that using the motor equations that relate voltage, current, rotational velocity, etc. but this is really not necessary.

Experimentally, you give the speed controller different open loop PWM commands until it goes to the speed you need with no other devices running (Jared spoke of this earlier). Record that voltage, do the unit conversions required for the Talon and now you get your multiplier (aka, FF gain).

From a pure control theory point of view, I gain for speed control is the same as P gain for position control. If you ONLY use P gain, then you will get to only about 50 - 60% of your desired speed. When you use FF gain, then this does not apply and eliminating I gain is fine for most.

However, I gain will help accelerate a little faster than just FF gain alone if your FF gain isn't already at max voltage (Which I do not recommend. Pick a desired wheel speed that is significantly slower than motor free speed so you have headroom for disturbances)

Paul
__________________
In full disclosure I am the President of VEX Robotics, a division of Innovation First International.

Last edited by Paul Copioli : 19-01-2017 at 12:14. Reason: fixing a very misleading typo. Thanks Ether.
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 23:54.

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