Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hello everybody,
I would try to implement a PID control over a simple crank connecting rod.
The system starts from standstill and has to reach a normal velocity of 3 rev/sec. The motor has a normal torque of 8,5 Nm and there is a force of 50 N along the "piston" axis.
I set the analysis as described in the attached PDF; the only difference is that in the example the motor has to fix the bar, so the final position is a fixed value and its velocity is zero. In my case the maotor continues to rotate; the desired velocity is the nominal one of 1080 deg/s and the desired position is (nominal_velocity * T).
I have two problems:
Any suggestions are welcome!
PS: I used Creo 5 for making the example.
Thanks
Bye
Solved! Go to Solution.
Attached is a working speed control.
I added a quadratic drag damping to be more realistic, otherwise the energy to maintain speed is exactly zero.
Note the parameter MAX_TORQUE cannot control the "Specify Domain" of the motor so the domain must be updated manually (you can enter MAX_TORQUE and it will copy the value,but not link it)
If your intention was to control the second order effects, the motor is way under-specified and the analysis name CONSTANT will generate the torques required to keep the speed absolutely constant. (Larger than 100Nm)
Therefore the RMS speed was what is being controlled by the PID in my example.
I suggest a flywheel to limit the second order variation, but then it will take much longer to ramp up to speed as it is already maxing out the motor. That is what saturated means, something is maxed out, like the motor or the amplifiers.
I had lots of trouble using gain on the D part, crashing CREO, etc. maybe someone else can give insight on that, but based on the error I think it was just maxing out the size of matrix allowed in the solver. Or maybe I was not doing this quite right.
Hello,
For position control PID would mean P = position, I = integral(position), D = speed.
For speed control PID would mean P = speed, I = position, D = acceleration.
It should be straight forward to change the variables/measures to match speed control based on the position control example.
also see this for some ideas on how one might go about tuning the gains.
I think you could use a function to limit the torque by the motor capability before tuning the PID.
psuedocode torqueToMotor= minimum(PID torque, max motor torque)
Or while tuning the PID gains you could watch the max torque and stop increasing gains when this is approached or at some % of the max that you want to target.
Attached is a working speed control.
I added a quadratic drag damping to be more realistic, otherwise the energy to maintain speed is exactly zero.
Note the parameter MAX_TORQUE cannot control the "Specify Domain" of the motor so the domain must be updated manually (you can enter MAX_TORQUE and it will copy the value,but not link it)
If your intention was to control the second order effects, the motor is way under-specified and the analysis name CONSTANT will generate the torques required to keep the speed absolutely constant. (Larger than 100Nm)
Therefore the RMS speed was what is being controlled by the PID in my example.
I suggest a flywheel to limit the second order variation, but then it will take much longer to ramp up to speed as it is already maxing out the motor. That is what saturated means, something is maxed out, like the motor or the amplifiers.
I had lots of trouble using gain on the D part, crashing CREO, etc. maybe someone else can give insight on that, but based on the error I think it was just maxing out the size of matrix allowed in the solver. Or maybe I was not doing this quite right.
I'm studying your great work (!) for which I thank you.
I also don't understand why simulation fails with whatever Kd value...reducing timestep or Kd very very small don't work.
In addiction I don't understand why you said "I added a quadratic drag damping to be more realistic, otherwise the energy to maintain speed is exactly zero" when we have the 50N force which pushes on the slider.
Now I want to do some tries...I don't know if it's better controlling the system in Velocity or Position.
The 50N force opposes motion only half the time, the other half it is assisting motion. The total work done per cycle is zero. If like friction, you want the 50N always opposing motion then do 50N*sign(velocity) or 50N*velocity_slider/abs(velocity_slider) so it changes direction when the slider changes direction.
If the goal is constant motor speed during one cycle by opposing the accelerations caused by oscillations of the slider, then using RMS will not work and also the motor is about 10X too weak to smooth the speed to constant.
Due to this you will not really notice its affect on the single cycle variations in speed. It only has enough torque to affect the average - RMS speed, so that is why I assumed RMS speed was what you were trying to control with PID.
Can you share the goal or purpose of the mechanism?
I'm trying to do some example to learn something more about system controls with Creo. This is an aspect of designing that I've never explored.
Maybe a connecting rod-crank mechanism, without flywhell, isn't the best one to making experience...because it's difficult controlling it in velociti (non RMS one).
Normally in the our applications we want constant velocity or a specific motion law by means of brushless motors. Few hours ago my electric colleague told me that our drivers use three PID+an optional feedforward controls: PID over current/torque, position and velocity.
I've made new assembly where tried to insert controls on position, velocity and torque.
Does someone have any suggestions? Some document to share?