|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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 |
|
#2
|
|||||
|
|||||
|
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
|
||||
|
||||
|
Re: controlling the speed that a PID on the talon moves an arm
Quote:
Quote:
Or, you could put a simple ramp or low-pass filter on your setpoint command. |
|
#4
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: controlling the speed that a PID on the talon moves an arm
He doesn't necessarily want to limit the range of the output.
He wants to limit the rate of change of the output. |
|
#6
|
||||
|
||||
|
Re: controlling the speed that a PID on the talon moves an arm
Quote:
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
|
|||||
|
|||||
|
Re: controlling the speed that a PID on the talon moves an arm
Quote:
|
|
#8
|
||||
|
||||
|
Re: controlling the speed that a PID on the talon moves an arm
Quote:
|
|
#9
|
|||||
|
|||||
|
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.
|
|
#10
|
||||
|
||||
|
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
|
|||||
|
|||||
|
Re: controlling the speed that a PID on the talon moves an arm
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
|
||||
|
||||
|
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
|
|||||
|
|||||
|
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.
|
|
#14
|
|||
|
|||
|
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|