OCCRA
Go to Post I didn't get inspired watching my peers and I, I was inspired watching professionals. - AdamHeard [more]
Home
Go Back   Chief Delphi > Technical > Electrical > CAN
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #46   Spotlight this post!  
Unread 03-08-2012, 01:28 AM
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 896
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: 2012: Tuning the Jaguar's Speed Control PID Loop

Quote:
Originally Posted by mjcoss View Post
It's a bit erratic and it may well be just noise. I played a little more with it tonight, and feel like it is stable enough. One thing that I meant to mention, and was a bit surprised by was that the Get[() function on the Jaguars just return the set point, not the current speed. We have the encoder signal split, going to the digital side card, and I've been using the digital side card encoder to track the performance of the speed control.

I expected that the Jaguar would have reported the current speed, not the set point. I played some with the D term but got nothing useful.

---Michael J Coss
You need to use GetStatus to find the measured speed. The headers / context help contains information. You should read it.

-Joe
Reply With Quote
  #47   Spotlight this post!  
Unread 03-08-2012, 03:12 PM
mjcoss mjcoss is offline
Registered User
FRC #0303
 
Join Date: Jan 2009
Location: Bridgewater,NJ
Posts: 69
mjcoss is a jewel in the roughmjcoss is a jewel in the roughmjcoss is a jewel in the roughmjcoss is a jewel in the rough
Re: 2012: Tuning the Jaguar's Speed Control PID Loop

Quote:
Originally Posted by jhersh View Post
You need to use GetStatus to find the measured speed. The headers / context help contains information. You should read it.

-Joe
My CANJaguar.h does not have a GetStatus method, nor does the WindRiver IDE show any method by that name for my CANJaguar object. And I do look at the headers.

---Michael J Coss
Reply With Quote
  #48   Spotlight this post!  
Unread 03-08-2012, 04:48 PM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 596
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: 2012: Tuning the Jaguar's Speed Control PID Loop

My impression is that GetStatus is a LabView thing not for WindRiver C++.
__________________
Reply With Quote
  #49   Spotlight this post!  
Unread 03-08-2012, 06:07 PM
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 896
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: 2012: Tuning the Jaguar's Speed Control PID Loop

Quote:
Originally Posted by mjcoss View Post
My CANJaguar.h does not have a GetStatus method, nor does the WindRiver IDE show any method by that name for my CANJaguar object. And I do look at the headers.
Sorry... I had the wrong name... GetSpeed()

Quote:
Originally Posted by mikets View Post
My impression is that GetStatus is a LabView thing not for WindRiver C++.
You are correct... I forgot that the C++ implementation calls out the status each separately.
Reply With Quote
  #50   Spotlight this post!  
Unread 03-08-2012, 06:10 PM
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 896
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: 2012: Tuning the Jaguar's Speed Control PID Loop

Quote:
Originally Posted by mjcoss View Post
My CANJaguar.h does not have a GetStatus method, nor does the WindRiver IDE show any method by that name for my CANJaguar object. And I do look at the headers.
Code:
/**
 * Get the recently set outputValue setpoint.
 * 
 * The scale and the units depend on the mode the Jaguar is in.
 * In PercentVbus Mode, the outputValue is from -1.0 to 1.0 (same as PWM Jaguar).
 * In Voltage Mode, the outputValue is in Volts.
 * In Current Mode, the outputValue is in Amps.
 * In Speed Mode, the outputValue is in Rotations/Minute.
 * In Position Mode, the outputValue is in Rotations.
 * 
 * @return The most recently set outputValue setpoint.
 */
float CANJaguar::Get()
Code:
/**
 * Get the speed of the encoder.
 * 
 * @return The speed of the motor in RPM based on the configured feedback.
 */
double CANJaguar::GetSpeed()
Reply With Quote
  #51   Spotlight this post!  
Unread 03-12-2012, 06:24 PM
mjcoss mjcoss is offline
Registered User
FRC #0303
 
Join Date: Jan 2009
Location: Bridgewater,NJ
Posts: 69
mjcoss is a jewel in the roughmjcoss is a jewel in the roughmjcoss is a jewel in the roughmjcoss is a jewel in the rough
Re: 2012: Tuning the Jaguar's Speed Control PID Loop

Yes. Mea culpa

While I was looking for the GetStatus(), I found GetSpeed(). Meant to mention that in the post.

---Michael J Coss
Reply With Quote
  #52   Spotlight this post!  
Unread 03-13-2012, 01:56 PM
6xpoppy 6xpoppy is offline
Registered User
FRC #0353
 
Join Date: Mar 2012
Location: Plainview, NY 11803
Posts: 1
6xpoppy is an unknown quantity at this point
Re: 2012: Tuning the Jaguar's Speed Control PID Loop

My name is Martin Kanner (an old time controls engineer) and I have been mentoring for team 353 for 6 years. I marveled at the technology of the PID but I coudln't see how it could be applied in an engineering fashion with the information available. My basic point is that a closed loop is designed for performance and stability. This is not to be accomplished by trial and erorr. My experience has been with the application of Bode analysis and Bode plots. I have completed 3 files so far entitled "The PID Revisited". I expect to complete two more files to be complete. I believe they contain the basics for designing closed loops. If anyone is interested, I'll e-mail PID11, PID22 and
PID33. They are pretty short but I believe contain some simple but important fundamentals. My e-mail is, msixxpoppy@hotmail.com
Reply With Quote
  #53   Spotlight this post!  
Unread 03-13-2012, 02:24 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,030
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: 2012: Tuning the Jaguar's Speed Control PID Loop

Quote:
Originally Posted by 6xpoppy View Post
If anyone is interested, I'll e-mail PID11, PID22 and PID33. They are pretty short but I believe contain some simple but important fundamentals.
Would you mind just posting them here as a ZIP attachment?


Reply With Quote
  #54   Spotlight this post!  
Unread 04-04-2012, 11:48 PM
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: 185
NotInControl has a brilliant futureNotInControl has a brilliant futureNotInControl has a brilliant futureNotInControl has a brilliant futureNotInControl has a brilliant futureNotInControl has a brilliant futureNotInControl has a brilliant futureNotInControl has a brilliant futureNotInControl has a brilliant futureNotInControl has a brilliant futureNotInControl has a brilliant future
Re: 2012: Tuning the Jaguar's Speed Control PID Loop

Quote:
Originally Posted by vamfun View Post
Funny, I always though it was the other way around. The Z-N methods were ment for guys that didn't understand control theory. The cookbook method was a way a plant manager could get his plant under control if he was unable to model the dynamics and apply control theory. The PID is a similar device.

Anyway, I took a look at your video and code. You did a great job and I wish our team had the capability. We are using C++ and I have longed for that data/plotting capability to tune the PID loops. I know teams like 254 have used a similar data loging scheme that reads the data bus and plots it using a custom LV GUI. Have you done any of this with C++ or can you offer some suggestions on the best way to set PID constants on the DS , send them to the robot and retrieve the sensor data and display it.

This year for our team we used Java... and with the help of the SmartDashbaord I have created a GUI for PID tuning that I used on our 2012 bot. Since We were running our own custom PID controllers on the CRIO this was very helpful.

So while I haven't done it with C++ per se, the code in java and the smartdashboard can help you get similar functionality.

I also worked on a new tutorial for tuning gains, using Matlab and Simulink, in order to get a more accurate controller. The method of tuning is the same as in my original video, but the method for modeling is different.

In the previous videos modeling of the plant was done using parameters provided by the datasheets of the motor and physical modeling techniques. However, there is always error between the model and the apparatus because of parameter mismatch.

The new method is based on taking measured data by running the actual system and logging to the file its performance to a step response, and using that data in matlab to perform parameter estimation. The estimated system is a far better realization of the plant model and allows for a more accurate controller design the first time around.

I am trying to find the time to post all this stuff, its just been hard. - My apologies
Reply With Quote
  #55   Spotlight this post!  
Unread 10-29-2013, 04:02 PM
gpetilli gpetilli is offline
Registered User
FRC #1559
 
Join Date: Jan 2009
Location: Victor, NY
Posts: 176
gpetilli is just really nicegpetilli is just really nicegpetilli is just really nicegpetilli is just really nicegpetilli is just really nice
Re: 2012: Tuning the Jaguar's Speed Control PID Loop

I had the same idea of predicting the step response. Attached is my cut at estimating PID values of the drive train UNDER LOAD (without risk of crashing into walls). I have not tried this on the actual robot yet, but it will hopefully be a good starting point.

I have updated the post with a new excel to correct some typos
Attached Files
File Type: xlsx Drivetrain_Model_KOP2013.xlsx (208.8 KB, 15 views)
Reply With Quote
  #56   Spotlight this post!  
Unread 10-31-2013, 02:24 PM
gpetilli gpetilli is offline
Registered User
FRC #1559
 
Join Date: Jan 2009
Location: Victor, NY
Posts: 176
gpetilli is just really nicegpetilli is just really nicegpetilli is just really nicegpetilli is just really nicegpetilli is just really nice
Re: 2012: Tuning the Jaguar's Speed Control PID Loop

1) Updated with PID in either robot FPS or motor RPS.
2) Improved wheel slip to use either static or kinetic friction based on previous state.
Attached Files
File Type: xlsx Drivetrain_Model_KOP2013.xlsx (212.2 KB, 20 views)
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 04:12 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi