Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
926 views
in Technique[技术] by (71.8m points)

matlab - 3rd-order rate limiter in Simulink? How to generate smooth triggered signals?

First for those, who are not familiar with Simulink, there is a imaginable outside-Simulink partial solution:

I need to create a vector satisfying the following conditions:

  • known initial value a1
  • known final value a2
  • it has a pre-defined step size, but the length is not pre-determined
  • the first derivative over the whole range is limited to v_max resp. -v_max
  • the second derivative over the whole range is limited to a_max resp. -a_max
  • the third derivative over the whole range is limited to j_max resp. -j_max
  • at the first and the final point all derivatives are zero.

Before you ask "what have you tried so far", I just had the idea to solve it outside Simulink and I tried the whole stuff below ;) But maybe you guys have a good idea, while I keep working on my own solution.


I'd like to generate smooth ramp signals (3rd derivative limited) based on a trigger signal in Simulink.

To get a triggered step I created a triggered subsystem propagating the trigger output. It looks like that:

enter image description here

But I actually don't want a step, I need a very smooth ramp with limited derivatives up to the 3rd order. The math behind is:

displacement: x
speed: v = x'
acceleration: a = v' = x''
jerk: j = a' = v'' = x'''

(If this looks familiar to you, I once had a very similar question. I thought about a bounty on it, but after the necessary edit of the question both answers would have been invalid)

As there are just rate limiters of 1st order, I used two derivates and a double integration to resolve my problem. But there is a mayor drawback, I can not ignore anymore. For the sake of illustration I chose a relatively big step size of 0.1.

The complete minimal example (Fixed Step, stepsize: 0.1, ode4): Download here

enter image description here

It can be seen, that the signal not even reaches the intended step height of 10 and furthermore is not constant at the end.

Over the development process of my whole model, this approach was satisfactory enough for small step sizes. But I reached the point where I really need the smooth ramp as intended. That means I need a finally constant signal at exactly the value, specified by the step height gain.

I already spent days to resolve the problem, and hope to fine some help here now.

Some of my ideas:

  • dynamically increase the step height over the actual desired value and saturate the final output. If the rate limits,step height and the simulation step size wouldn't be flexible one could probably find a satisfying solution. But as everything has to be flexible, there are too much cases where the acceleration and jerk limit is violated.
  • I tried to use the Matlab function block and write my own 3rd order rate limiter. Though it seems possible for me for the trigger moment, I have no solution how to smooth the "deceleration" at the end of the ramp. Also I'd need C-compilers, which would make it hard to use my model on other systems without problems. (At least I think so.)

The solver can not be changed siginificantly (either ode3 or ode4) and a fixed step size is mandatory (0.00001 to 0.01).


Currently used, not really useful approach:

enter image description here

For a dynamic amplification of 1.07 I get the following output (all values normalised on their limits): enter image description here Though the displacement looks nice, the violation of the acceleration limit is very harmful.

For a dynamic amplification of 1.05 I get the following output (all values normalised on their limits): enter image description here The acceleration stays in its boundaries, but the displacement does not reach the intended value. (not really clear in the picture) The jerk is still to big. (I could live with that, but it's not nice)


So it appears to me that a inside-Simulink solutions is far from reality. Any ideas how to create a well-behaving custom function block?


Simulation step size, step height, and the rate limits are known before the simulation starts. (But I have a lot of these triggered smooth ramps in a row, it should feed a event-discrete control). So I could imagine to create the whole smooth ramp outside simulink and save it as a timeseries object and append it on the current signal when the trigger is activated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The problems you see are because the difference is not conditioned very well. Taking the difference amplifies the numerical that exists in your simulation.

Also the jerk will always be large if you try to apply an actual step. I guess for your approach it would be better to work the other way around: i.e. make a jerk, acceleration and velocity with which your step is achieved.

I think your looking for something like the ref3 block: http://www.dct.tue.nl/home_of_ref3.htm Note the disclaimer on the site and that it is a little cumbersome to use.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...