|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#16
|
|||
|
|||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
Quote:
|
|
#17
|
||||
|
||||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
Quote:
A note on the download page that it is simply a self-extracting ZIP might spare future downloaders a moment or two of apprehension Last edited by Ether : 18-01-2012 at 19:11. Reason: spell check |
|
#18
|
||||
|
||||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
Quote:
Output = Kff * setpoint + Kp * error + Ki * integral + Kd * derivative All this would require is the ability to pass another constant (Kff) along to the Jag. Even if the linear response isn't perfect, the PID loop will likely be responsive enough to make up the difference. |
|
#19
|
||||
|
||||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
Quote:
|
|
#20
|
||||
|
||||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
I just used "unzip" but it depends on the distro.
|
|
#21
|
|||
|
|||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
Quote:
I was going to do another tutorial for users with older versions of simulink/matlab but I thought it would be fruitless because First teams can get free licenses for new mathwork software by contacting mathworks from this link: http://www.mathworks.com/academia/st...irst-robotics/ I'd really recommend getting a new license so you can use the method I demonstrate but If youd like to use 2008, there is another tool you can use, but it is not as simple and not as easy to understand. In matlab 2008 type sisotool in the command line. A gui will show up if you have the control system tool box installed... you can use this gui to tune your controller, provided that you set it up correctly. Check the Mathwork help files on this tool.. it will be a great start. -Kevin |
|
#22
|
|||
|
|||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
Quote:
Hopefully, I can get everything up on our website within the next couple of days so that teams can make the max use of them. -Kevin |
|
#23
|
|||||
|
|||||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
This is a repost from a different thread (http://www.chiefdelphi.com/forums/sh....php?p=1111803) but I thought the info might be useful here
Reading through the data sheet I got this; Quote:
I hope this helps! |
|
#24
|
|||
|
|||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
So I finally had a chance to play with PID control on the Jag over can... below is my initial assessment... note these are just my opinions so don't let it sway you in making your decision when choosing the Jags over the CRIO.
First off, I was controlling a CIM motor, directly coupled to a shaft... spinning a 6in wheel. I was using BDC-com directly connect to the Jag (so it was a black jag) over a USB to serial interface, and there was only one Jag on the network. My encoder was a 256 pulse per rotation grayhill encounter (or as TI likes to call it a 256 line encoder) tied directly to the shaft using shrink tubing. Summary: I was able to effectively get pretty accurate speed control using a PI controller, and good postiton control just using a P controller. However, the problems that I noticed are with paramters that I can not control due to the nature of the Jag being a black box PID controller to me. I talk about these nuances below, and because of them I don't think I am comfortable enough to use the jags for my PID loops this year, even though I will still be running CAN-Bus for all of my motors. First impressions: Encoder sampling time - The sampling time of the encoder seemed to be very slow. It was "good enough" for most of what I wanted to do but slow for really high speed rotations. To stablaize around 2500 RPM, I was noticing +/- 200 rpm jumps from the speed readout.The feedback from the sensor is an integral part of how reliable the controller will be... and there was no way to average the output of the encoder to smooth it out on the Jags (as I would do on the C-RIO using an N-point average). But the biggest problem was, I don't know what the sampling time of the encoders are - looking at the data sheet, section 8 does not mention sampling rate as it does for other inputs, The rate that it does talk about seems to be encoder velocity specified in Mach (unit M). So not knowing how fast the encoder is sampling is a pretty big deal to me. I would expect the sampling time to be in the kHz range, in which case it is fast enough I wouldn't care. Now the fluctuations I was getting from speed could have easily been due to a torsional spring effect due to the loose coupling of the encoder to the shaft, but I can't be certain without further testing. No Integral wind-up prevention - (Or at least im not sure if the controller contains this feature) - When I look at the code posted... PID.c seems to have integral level min and max values to prevent integral windup. However, we can't be sure that the code were looking at is the code that is runing on the FIRST version of the JAG can we? I don't see why there would be two different versions of the firmware on TI's end, but using BDC com I did not see a way to provide limits on the integral. So windup is an issue, and although I didn't notice any wind-up in my tests, I didn't run the test long enough to make sure there was no windup. Windup can take seconds or even minutes to see the effect. One encoder/One Motor - This is an obvious one, but because the encoder is tied to only one motor, it is difficult to control two motors using one encoder. I am sure there are solutions available, but at a risk I am not willing to take unless my back is against the wall and the loops are maxing out the cRIO (which I don't think will be the case). However, if you can over look these problems, I was able to get a decent controller in about 10 mins on the Jag and would recommend the Jag for certain non-critical tasks. My gains were P=0.08, I=0.004 for speed control and P=0.3 for position control. I used Matlab/Simulink to determine the gains of the controller. Thanks, Kevin |
|
#25
|
|||
|
|||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
My plan this year is to use the Jaguars in current control mode. I will run a speed regulator on the cRio which is commanding the set points for the jaguar current controller. So to say it another way a speed regulator running on the cRIO wrapped around a current controller running on the jaguar. I have had success running the jaguar in current control mode (It basically worked no matter what I set the gains too!). I haven't tried wrapping the speed controller around them yet but i can post back here if others are interested in the results once I do so. I figured I would just post this configuration here as a possible alternative to full speed control on the jag.
|
|
#26
|
||||
|
||||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
Some questions:
What wheel were you using? What speed(s) were you controlling at? What was the approximate voltage at each speed? Can you estimate the approximate transfer function from speed command to measured speed? Did you collect any data, such as time traces of speed command and speed output (for step commands or sinusoids). |
|
#27
|
||||
|
||||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
Quote:
|
|
#28
|
|||
|
|||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
Quote:
|
|
#29
|
||||
|
||||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
Quote:
|
|
#30
|
|||
|
|||
|
Re: 2012: Tuning the Jaguar's Speed Control PID Loop
Quote:
Quote:
Quote:
I tuned the gains of the controller to have a rise time of about 0.3 seconds and settle just under 1 second. Just visually, I would say settling time was closer too 2 seconds. When I run the setup on the CRIO, where I can log output data from the Jag I will be able to graph it and view true rise time and settling time for the response. I am confident that the Jag will perform well under certain applications. It is my personal stance as a Control Engineer to have filtered feedback signals, and account for external disturbances if I need too with additional control, which the Jaguar can't do. I am confident the Jaguar can perform good speed and position control, but a smooth response where the controller is not being overworked may be hard obtain because the Jaguar does not allow the user to account for the variable non-linear effects. For FIRST purposes, I think the Jags can accommodate. Hope this helps, Kevin Last edited by NotInControl : 24-01-2012 at 07:34. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|