Simulink: How to fix given error for a closed loop model w/ PID controller?

  • Topic: Engineering 
  • Thread starter simphys
  • Start date
  • Tags Tags
    Simulink
1 reply · 2K views · last reply
simphys
Messages
327
Reaction score
46
Homework Statement
The question that is asked is basically to create a closed loop model with a PID controller. (if necessary more information on the picture)
The problem that I am encountering is an error which I don't understand and know how to fix?
Relevant Equations
not relevant
Could I get some input on how to fix this problem please? Thanks in advance!

The exercise for which I need the model.
Page from a control systems exercise showing a block diagram of a closed-loop proportional controller: reference r and feedback y form an error e, feeding Tc(s) = K, then u, then Tp,u(s), output z. Below is the PID transfer function Tc(s) = Kc(1 + 1/(Ti s) + Td s).
Block diagram of a parallel PID controller: Kc gain feeds P-action gain 1, I-action 1/(Ti·s) and D-action Td·s/1 blocks, summed at a junction, with the figure caption Exercise 11.1 PID Controller Model in Simulink.


The simulink model together + the error that needs to be fixed + Matlab code used:


Note: Gain 1 = 1/Ti
 
Attachments
  • Simulink block diagram of a closed-loop PID control system: From Workspace feeds a summing junction, then gain K, integrator 1/s, gain K/Ti, derivative block, gains Td and Gain3, into a Transfer Fcn 1/(s+1), output to To Workspace. Diagnostic Viewer and MATLAB editor are open.
    Screenshot from 2023-06-07 17-33-21.png
    26.5 KB · Views: 188
  • Screenshot of Simulink Simulation error panel showing two messages: a block diagram warning about solver step size in PID_controller, and a block error that the derivative of state '1' in PID_controller/Transfer Fcn is not finite, so the simulation was stopped.
    error.png
    22.5 KB · Views: 203
  • Screenshot of a MATLAB editor showing script code: num = [10], den = conv([1, 20], [1, 20]), sys = tf(num, den), a commented rlocus(sys) line, then a cell defining t = [0: 0.01: 10]', x = heaviside(t), Kc = 10, Ti = 5 and Td = 3.
    matlab_code.png
    5.3 KB · Views: 183
  • Simulink block diagram of a closed-loop PID controller: From Workspace [t x], error Sum, Gain Kc, parallel Integrator 1/s with Gain1 -K-, Derivative with Gain2 Td, Gain3 1 feeding Sum1, then Transfer Fcn 1/(s+1) and To Workspace out.output, with feedback to the error sum.
    simulink_model.png
    7.4 KB · Views: 216
I'm not an expert on this, but it looks like some of the equations it is solving are changing in value so fast that further calculations make no sense.

Please check the values of all the components/variables you have supplied. For instance maybe one is missing a minus sign or a decimal point. Another common problem is that an 'm' was entered instead of 'M' (or the other way around -- one means milli-, the other Mega-).

Then try changing the time step or error band, as the Error Msg. suggested.

Good Luck,
Tom

p.s. please keep us posted on what you find that works.