Go to Post and isn't this fun? :) CD is great :D - rick.oliver [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rating: Thread Rating: 28 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 28-10-2014, 08:14
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,367
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Jaguars and FAST PID Looptimes

What is the rational for very fast steering response and why is there a need to expend allot of power to accomplish this?
This is a link to a page showing what we have done with swerve.

http://wiki.team1640.com/index.php?title=Swerve_Central

We use a RS540 and banes bot 1 : 133 trans. Plenty for power and speed. Other designs and drive wheels may need more power but this solution has worked well for us.
I would caution on the use of Jags for positional control. We burned up several on the steering motors. We have used Victors and Talons for the steering motors with out failures.
For auto navigation, Tight PID tuning, well calibrated and accurate steering angle sensor and a good stable gyro - IMU are needed. Swerve does not like to go straight.
For teleop, a looser PID can actually be better. This is especially true if the driver is the button smasher gamer type. Next year we are planning on a very tight PID values for Auto and looser PID values for teleop. This year we tuned it to a value between the 2 ideal settings.
For 2015 we are looking forward to the power distribution boards ability to log current draw of all motors. The excel spread sheet and code TOM LINE posted looks very promising for swerve power analysis under battle field conditions. We don't know what our swerve consumes on the field and we should know this.
So again I ask why is there a need to bash the steering for very fast and precise angle?
  #2   Spotlight this post!  
Unread 28-10-2014, 09:20
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Jaguars and FAST PID Looptimes

Quote:
Originally Posted by Gdeaver View Post
So again I ask why is there a need to bash the steering for very fast and precise angle?
I think the question here is how fast is "fast enough" to accomplish the desired tasks.

The answer depends on what you want to accomplish with the swerve. Rapid evasive maneuvers require faster response than a gently sweeping curve.

The steering doesn't have to be perfect or instantaneous. But if the steering is way too slow or inaccurate, the vehicle will not behave as desired.

Your team seems to have found an acceptable compromise. Can you link to some videos showing rapid evasive maneuvers?



Last edited by Ether : 28-10-2014 at 10:03.
  #3   Spotlight this post!  
Unread 28-10-2014, 16:18
RyanShoff RyanShoff is offline
Registered User
FRC #4143 (Mars Wars)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2012
Location: Metamora, IL
Posts: 147
RyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to behold
Re: Jaguars and FAST PID Looptimes

Quote:
Originally Posted by Ether View Post
Calling all teams who have deployed successful "Unicorn" swerves with 3DoF driver interface: please share your experience/data concerning steering dynamic response.


Bag motor 90:1 to wheel through versaplanetary.

This loop was minimally tuned to stop any shaking. We didn't spend a lot of time optimizing it. Response of wheels turning 90 degrees wasn't timed. I would guess around 250ms. As tuned, it visibly overshoots a little and comes back on a full speed 90 degree move.

This was all copied from Bombsquad. Looking back on their original code (2013), it looks like we took D from 0 to .2 and increased the STEERPOW from .75 to 1. I don't know what motor or reduction they used.

Next year we'll be looking to decrease the loop period and the tolerance if we do a swerve again. The speed and response was just fine but it could have driven straighter.

PID loops setup like this:

Code:
#define CONTINUOUS true
#define P 1.0
#define I 0.0
#define D 0.2
#define F 0.0
#define POTMIN 0.2
#define POTMAX 4.8
#define STEERPOW  1.0
#define TOLERANCE 0.2
#define PERIOD .02
#define RATIO 1

driveTrainFrontLeftDrive = new Talon(1, FLD);
driveTrainFrontLeftPos = new AnalogChannelVolt(1, FLP, true, RATIO);
driveTrainFrontLeftSteer = new Talon(1, FLS);
driveTrainFrontLeft = new PIDController(P, I, D, F,  driveTrainFrontLeftPos,
driveTrainFrontLeftSteer, PERIOD);
driveTrainFrontLeft->SetContinuous(CONTINUOUS); 
driveTrainFrontLeft->SetAbsoluteTolerance(TOLERANCE); 
driveTrainFrontLeft->SetInputRange(POTMIN, POTMAX);
driveTrainFrontLeft->SetOutputRange(-STEERPOW, STEERPOW);
__________________
Ryan Shoff
4143 Mars/Wars
CheapGears.com
  #4   Spotlight this post!  
Unread 28-10-2014, 16:40
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Jaguars and FAST PID Looptimes

Quote:
Originally Posted by RyanShoff View Post
The speed and response was just fine but it could have driven straighter.
Thanks Ryan.

When you commanded rapid evasive maneuvers, did it consistently behave as expected1? Do you have some videos?


1 i.e. "as expected" according to kinematic calculations.

Last edited by Ether : 28-10-2014 at 20:21.
  #5   Spotlight this post!  
Unread 29-10-2014, 10:04
RyanShoff RyanShoff is offline
Registered User
FRC #4143 (Mars Wars)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2012
Location: Metamora, IL
Posts: 147
RyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to behold
Re: Jaguars and FAST PID Looptimes

http://www.thebluealliance.com/match/2014wimi_qf3m1
This is high def match video from Wisconsin. It ended up 3 vs 1 so we have lots of room to drive around at the end.
__________________
Ryan Shoff
4143 Mars/Wars
CheapGears.com
  #6   Spotlight this post!  
Unread 27-10-2014, 22:02
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: Jaguars and FAST PID Looptimes

Quote:
Originally Posted by Ether
FWIW, I recently wrote an integer-math implementation of swerve reverse kinematics for Anthony Lapp for a project he was working on to run swerve on ATmega2560. He has a video posted here
Ether,

Nice try making the font small so we'd not follow the link. But I'm on to your tricks ;-)

Very cool chassis. Can you provide details on the ratios and motors involved on that swerve or do I have to go pester Anthony? It seems like there is a point in the video where one of the steering angles is close to 90 degrees in 100ms. I could be wrong because I am just eyeballing it but even so, that's some pretty zippy steering.

My kind of swerve if you know what I mean...

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
  #7   Spotlight this post!  
Unread 27-10-2014, 22:37
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Jaguars and FAST PID Looptimes

Quote:
Originally Posted by Joe Johnson View Post
Can you provide details on the ratios and motors involved on that swerve or do I have to go pester Anthony?
Hi Joe,

I'd like to help but you'll have to ask Anthony for those details. He contacted me because he needed help implementing integer math. He had coded the swerve inverse kinematics in floating point, and the floating-point emulation library was chewing up all the processing power on the ATmega2560. I sent him an integer-math implementation scaled for his inputs and outputs.


  #8   Spotlight this post!  
Unread 27-10-2014, 16:14
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Jaguars and FAST PID Looptimes

We used the on-board Jaguar PID for position control for our shooter turret in 2012.

Don't know if that qualifies as "similar" to your swerve application, but I do have a working knowledge of the pitfalls of the Jag's PID (both position and velocity).

The bottom line is that we did get it working, although it wasn't pretty, and there was still a lot left to be desired. While we were able to get the turret to go to a commanded position effectively, I wouldn't say we had it "perfectly tuned," nor did our system have a lot of dynamic forces on it. The turret was pretty free-spinning, and remained that way throughout.

It was powered by a single RS550 through a planetary. I don't think we were close to hitting your 90 degrees in 60ms spec though. There is a 10-turn pot that you can see in the picture as well.

Here's a pic of the setup:


Here is our competition code for the turret on Google Code:
https://code.google.com/p/robotics61...ms/Turret.java

You can navigate through the source path section to find the PID constants we used as well.

Good luck!

If you have any other questions, post here, and I'll try and find time to share what I can.
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
  #9   Spotlight this post!  
Unread 27-10-2014, 16:41
NotInControl NotInControl is offline
Controls Engineer
AKA: Kevin
FRC #2168 (Aluminum Falcons)
Team Role: Engineer
 
Join Date: Oct 2011
Rookie Year: 2004
Location: Groton, CT
Posts: 261
NotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond repute
Re: Jaguars and FAST PID Looptimes

I believe the microcontroller on the jag runs at a rate of 50MHz and the encoder is read at 1/4 of that rate. Not clear on how fast the control loop on the jag is running, but I think it is safe to say it is orders of magnitude higher than the software loop.

However you can only command it and read from it as fast as CAN packets are being sent/received.

In your requirement for 90 degrees in 60ms. How much of that is actuation time, and how much of that is settling time?

If you want to be at 90 degrees confirmed in 60ms, then you need the mechanical system (wheel/gear) and anything else that is tied to the motor load including friction between wheel and floor to accelerate and decelerate in that amount of time.

If your target is 60ms, then you should target an actuation time of 40ms, and a settling time of 20ms. Can your mechanical system move that quickly? That is pretty fast by any FRC standard.

If you also plan to run 4 independent loops, they each will settle differently because each motor will react differently. As your speed requirement increases, your engineering tolerances reduce, naturally. You will need very tight tolerances on the manufacture of the assembly, sensor mount, and backlash in order to have reasonable reaction time across all pods. Also take the time to test the motors you are using to ensure their drive characteristics are very similar to each other.

We typically run our control loops at 100ms and give our actuators a settling time of around 100-150ms on top of that because that is a very safe margin, and very achievable with the manufacturing tolerances on our team.

Although we have not done motion planning on FRC(yet) and all of our control loops run in software.

For the motion planning model on my work outside of FRC, a 100ms control loop was more than efficient to follow a waypoint path on a skid steer chassis. Not sure how that equates to the dynamics of a swerve, but I would hope they are somewhat comparable.

Plus, the baggage of CAN error implementation, preventing CANTimeOutErrors and all that other good stuff will need to be user implemented as part of the CAN baggage.

Regards,
Kevin
__________________
Controls Engineer, Team 2168 - The Aluminum Falcons
[2016 Season] - World Championship Controls Award, District Controls Award, 3rd BlueBanner
-World Championship- #45 seed in Quals, World Championship Innovation in Controls Award - Curie
-NE Championship- #26 seed in Quals, winner(195,125,2168)
[2015 Season] - NE Championship Controls Award, 2nd Blue Banner
-NE Championship- #26 seed in Quals, NE Championship Innovation in Controls Award
-MA District Event- #17 seed in Quals, Winner(2168,3718,3146)
[2014 Season] - NE Championship Controls Award & Semi-finalists, District Controls Award, Creativity Award, & Finalists
-NE Championship- #36 seed in Quals, SemiFinalist(228,2168,3525), NE Championship Innovation in Controls Award
-RI District Event- #7 seed in Quals, Finalist(1519,2168,5163), Innovation in Controls Award
-Groton District Event- #9 seed in Quals, QuarterFinalist(2168, 125, 5112), Creativity Award
[2013 Season] - WPI Regional Winner - 1st Blue Banner

Last edited by NotInControl : 27-10-2014 at 16:44.
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 01:44.

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