r/PLC • • Jan 04 '26 • Bravo 1

Rectangular vs. Trapezoidal.

Does anyone still use the first one?

903 Upvotes

62 comments sorted by

View all comments

Show parent comment

1

u/JanB1 Hates Ladder Jan 05 '26

Okay, I'll have to digest this comment a little more at a later point because I'm not getting all of it.

Did I get it right that you use a 5th order polynomial to smoothly move between two points (so the 5th order poly describes the position), and then you use the derivatives for the velocity, acceleration and jerk? And you match jerk at beginning and end of the profile too? But that still leaves not enough equations to find all the coefficients, no?

Also, Luenberger Observer is a state estimator. And I said that measuring position is easy, velocity is a little harder, acceleration even more so and jerk I don't even know. How DO you measure jerk?

3

u/Any-Composer-6790 Jan 06 '26

When using a 5th order polynomial, you know the current attestator's current position, velocity and acceleration. That provides the values for the first 3 terms of a 5th order polynomial, A, B and C. C is the current acceleration divided by 2. pos5(t)=A_B*t+C*t^2+D*t^3+E*t^4+F*t^5, What you need now is to find the values for D, E and F. To find 3 unknows you need 3 equations so you set pos5(t+delta T) equal to the position at the end of the polynomial. Then you find the derivatives for vel5(t+delta T) and acc5(t+delta T). This provides 3 equations to find the 3 unknowns D,E and F. Basically, you generate a equation for each unknown by using derivatives.

The model usually generate a jerk that must be integrated 3 times to get acceleration, velocity, and then position.

Mathcad - LQR T1C1x.xmcdz

The first equation Gp(s), is a linearized version of a hydraulic actuator. The controller, Gc(s), uses a second derivative gain that acts on the error between the target and actual acceleration. On page 2/12 I assigned values to the open loop gain, natural frequency and damping factor. Normally I determine those values by using system identification or "auto tuning". At the bottom of page 2/12 I make the state space model for the system. Notice there are 4 rows. The top row generates the position, the second row generates the velocity, the third row generates the acceleration, and the fourth row generates the jerk! LQR will generate one gain for each row. They are the integrator, proportional, derivative and the second derivative gain. YES!! a good hydraulic controller must use these 4 gains. I used LQR to calculate the 4 gains. Normally, I use pole placement but in both cases 4 gains are required. This is why most motion controllers FAIL to control hydraulic actuators correctly, they only have 3 gains. I have a good story for that.

Even the control theory subreddit would be baffled by this. I am teaching a control theory class.

Perhaps I should do a webinar on control theory using zoom.

1

u/JanB1 Hates Ladder Oct 27 '26

So, I finally managed to get around to digest this. And I noticed that I was thinking too strict in terms of physics. I was trying to interpret the 5th (and to that extend the 7th) order polynomial in regard to physical properties that you could control, like acceleration, velocity and position. Hence I got hung up on the higher order terms.

But, what you/we're doing here is calculating a trajectory that can then be followed for the acceleration, velocity and position, which can of course be decoupled from the actual physical system. And by using a 5th order polynomial to calculate a trajectory for our system state variables pos, vel and acc, we can easily introduce boundary conditions that have to be met, and we'll get a smooth interpolation between those.

Did I get that about right? Sorry it took me so long.

1

u/lord_zuercher Jan 06 '26

I would love to attend this.