This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bode plot -- digital control system -- motor control

Hi Ti Team,

As i know that when using digital control system we use to work in Z plane. And using tustin transform an can convert the s plane transfer function to z-plane transfer function.

As we know using bode plot we can find the frequency response of an LTI system. And frequency responce is found for s with σ = 0 :--

s = σ + j ω

= 0 + j ω

= j ω

In bode plot to be stable system we have to remain away from 1 & -180 degree (I will not discuss about sensivity at present).

I have pasted a image below where i am subjecting LTI to an A*sin(wt) & o/p signal is B*sin(wt +/- Q). And I am testing this for large range of frequency & obtained the bode plot of my LTI system. Form Bode plot we can get the Gain & phase margin of the system.

But now what exactly this phase & gain margin means when we use software & MCU.

1> Does gain margin means how much delay is acceptable in my software or parasitic delay of MOTOR, after sensing the rotor position & running control algorithm &Then applying waveform to actual motor ?

Means to say by phase delay does it means software delay(of control algorithm) acceptable after sensing rotor position & final PWM applied to inverter MOSFET of motor ?

But unit for delay in software is msec or usec but unit of phase margin & gain margin is in  degree & DB. How to interrelate unit degree with second ?

2> Also what exactly we mean by Gain margin & phase margin when we develop digital control system with software & MCU ?

Please suggest

Regards,

Dinesh

  • Dinesh,


    "1> Does gain margin means how much delay is acceptable in my software or parasitic delay of MOTOR, after sensing the rotor position & running control algorithm &Then applying waveform to actual motor ?"

    No. Gain margin is the amount of additional loop gain which can be introduced without the system becoming unstable, assuming the phase does not change. Time delay does not affect gain - in the frequency domain it introduces a pure phase lag which is proportional both to the delay and to frequency (see below).

    "Means to say by phase delay does it means software delay(of control algorithm) acceptable after sensing rotor position & final PWM applied to inverter MOSFET of motor ?"

    Any digital control system will introduce time delay into the loop, and will therefore have correspondingly more phase lag than a continuous time control loop. In a motor system, phase lag will erode phase margin. It's the task of the designer to understand and to manage that.

    "But unit for delay in software is msec or usec but unit of phase margin & gain margin is in degree & DB. How to interrelate unit degree with second ?"

    The time shift property of the Laplace transform tells us that a time delay of T seconds generates a phase shift of -wT radians (w is frequency in rad/sec., T is in sec.).

    "2> Also what exactly we mean by Gain margin & phase margin when we develop digital control system with software & MCU ?"

    Exactly the same as if we had applied a continuous controller. We just have to understand and account for the additional phase lag from time delay and re-construction.


    There is a lot more to this subject. You may find it helpful to review the videos on this page:
    https://training.ti.com/control-theory-seminar-4-part-series

    I hope this helps.

    Regards,

    Richard

  • Hello Richard,

    Thanks for your reply. This link also explain best the math behind phase lag &  time delay in LTI systems.

    http://lpsa.swarthmore.edu/BackGround/TimeDelay/TimeDelay.html

    Regards,

    Dinesh

  • Hello Richard,

    As per above link it use to state that :--
    The the phase drops linearly with a slope of -ω·T where T=time delay in second

    If suppose time bode plot of my LTI system is as per below image.

    Then if suppose my software introduces lets say processing delay of 2 sec (or say 2 msec or some other time unit).
    As what i know is adding a phase delay means more negative phase or we can say phase curve moves more down to reduce phase margin amplitude.




    Than what exactly will happen to phase plot will it move further down to reduce pase margin amplitude, to make system move towards unstability ?

    Please suggest.

    Regards,
    Dinesh

  • Dinesh,

    What are we looking at in the Bode plot?  Is this the plant you're trying to control, or the open loop?  If the latter, the system will be unstable when you close the loop even without time delay.

    Time delay will contribute a phase lag which is proportional to frequency: at 0 rad/s there will be no phase change, but there will be progressively more phase lag as frequency increases.  Your plot looks like it was generated in Matlab so I've taken the liberty of writing and attaching a short script to demonstrate the additional phase lag with a 2 second delay.   I've taken a guess at your transfer function, but it looks close to what you attached to your post.  Your system is pretty slow, so even this delay does not change the phase much.

    BTW, you mention "phase margin amplitude" twice in your post.  I assume you just mean "phase margin"?

    Regards,

    Richard

    phase_delay_demo.m

  • Hello Richards,

    Thanks for your reply.

    >> Is this the plant you're trying to control, or the open loop?
    Its just an open loop transfer function.

    >> BTW, you mention "phase margin amplitude" twice in your post. I assume you just mean "phase margin"?
    Yes you got it right.

    >> Your plot looks like it was generated in Matlab so I've taken the liberty of writing and attaching a short script to demonstrate the additional phase lag with a 2 second delay.
    Thanks for this matlab script.

    Control system concept are great but moving from s-domain to Z-plane world & using MCU & software to implement this is bit hectic task.
    Once you move step forward one use to forget what they have learned in last step.

    Hopefully i will get those skills sooner or later . But i will like to say Ti has excellent blogs & docs to help starters to link Digital control to MCU & software .

    Regards,
    Dineshg