Hi,
so I have the step response of a system. I measured the output when on the input there was a step.
Plotting the curve I found it might be approximated by a transfer function like this:
P(s) = kh * 1 / (1 + s*tau)
In other words, the plant is a first-order system, the time constant is about 0.5 s.
The first question is: how to find kh?
The signal I acquired is the output of the 12 bit ADC (sampling time of
5 ms) and of course it is amplified by the front-end op-amps. If I draw both the signal acquired and the calculated step response of the above t.f. I get kh = 600 to make equal the two curves. But the calculated step response use a unit step: in my system the 'unit' I used is the maximum power delivered by the motors... I'm wondering how to determine the value of this constant.Once determined I want to design my controller. I don't ask for the right one, rather if in this case I can follow what Tim Wescott wrote in his great book ("Applied Control Theory for Embedded Systems").
Given the continuous step response in 's' domain -> transform it in the time domain -> sample (@ 5 ms, the ADC sampling time) and convert to 'z' domain -> P(z) is found dividing by z/(z-1). Can I?
Now I should be able to design the controller in the 'z' domain because I provide it the plant "as seen" from the digital circuits.
The last question is scilab related. Written the plant transfer function in 'z' domain (P) and the controller one (C), the system is composed of the controller cascaded by the plant and a unit feedback line. How to implement this in scilab without found by hand the closed-loop transfer function? I ask this because I'd like to change the controller t.f. on-the-fly to see the overall step response.
Thanks in advance, Marco / iw2nzm