# Transfer Function to go from a Step Input to a Linear Ramp between the two step values

I want a very basic simulation of a linear axis that can be given a position demand, and it will move to that position at a constant speed. At this point, I do not care about acceleration, but if I can modify the TF to incorporate it that will be a bonus.

• I will program this simulation using scipy
• This is a discrete-time system
• The position the axis moves to is exactly the demand (no steady-state error, gain 1)
• The speed is constant. Ideally, I would like this to be configurable. But for the sake of this example, lets say it is 0.2m/s.
• There is no overshoot
• It is the same for both positive and negative steps, i.e increasing or decreasing the position demand
• I do not care about the delay between the demand change and when it starts to respond. Ideally, it would be 0 or 1 time steps, but this is a really simple simulation so I do not care that much.
• If it is given an impulse input then it will either move slightly or not at all, but I am not that interested in simulating this
• If it is given a ramp input, then it will behave similarly to the step input if the slope of the ramp is steeper than the velocity of the axis, and will still move at the constant velocity even if the demand ramp is less steep (hence it will stop and start to track the demand). But again, I do not really care about simulating this, and would rather have a simplified solution.
• A very rough approximation is fine, I do not need to identify the system to a realistic level.

So basically, the transfer function that represents the system is one that turns a step input into a ramp that goes between the start and end values of the step. If we also include acceleration, then it will turn a step input into a sigmoid looking signal.

What is this transfer function?

I could also represent this as ZerosPolesGain, or StateSpace within scipy, so either of those will also suffice as an answer.

Thanks

• It's hard to understand what you exactly want to do, but to turn a step function into a ramp, you simply need an integrator: $y[n]] = x[n]+y[n-1]$, which would make sense since position is the integral of the velocity. Dec 17, 2020 at 13:57
• @himar The problem is that an integrator would increase beyond the max value of the step. So I guess I need a saturated integrator? If that's a thing. After doing some reading I have come to the conclusion that a transfer function may not be the best way to do this, and instead, I have programmed up a slew rate limiter which does the job for me. Dec 18, 2020 at 10:48