Course materials · Control Engineering I

Week 5 · Choose states and build a matrix model

English translation

Before practice

01 Information needed for prediction

Example scenario To predict the subsequent motion of two objects at the same position, what must you know besides their current position?

Description
  • You also need the current velocity. If one object is stationary and the other moving, their subsequent positions differ.
  • The constant-acceleration equations also used both starting position and velocity. Now extend them to a model where acceleration depends on position, velocity, and force.

Review related concepts ↗

02 Acceleration and state

With position and velocity as states, must acceleration also be stored separately?

Description
  • In this model, acceleration can be calculated from the current position, velocity, and applied force, so it is not included as a separate state.
  • Velocity is the rate of change of position, and acceleration is the rate of change of velocity. Combining these relationships expresses the 2nd-order differential equation for position as two 1st-order differential equations.

03 States and outputs

Must the information needed to calculate motion always match the quantity being observed?

Description
  • Even when position and velocity are both needed for calculation, the observed output may be position alone.
  • In this exercise, choose position or velocity as the output of the same state model. Distinguish the information retained from the value displayed.

Practice

1. Derive the state equations

  • R, L, and C are connected in parallel between the same two nodes. Take the lower node as the reference potential. Define the upper-node voltage as vv, the inductor current flowing downward as iLi_L, and the supply current as uu.
  • In R=1,L=1,C=1R=1,\ L=1,\ C=1, use KCL and v=LdiLdtv=L\frac{di_L}{dt} to write the two differential equations for 𝐱=[v,iL]T\mathbf x=[v,i_L]^T and the output y=vy=v yourself, and find A,B,C,DA,B,C,D.
  • Set the initial conditions to 0 and apply the Laplace transform to both equations. In the inductor relation, express IL(s)I_L(s) in terms of V(s)V(s), then substitute into the KCL equation. Collect terms containing V(s)V(s) to find V(s)U(s)\frac{V(s)}{U(s)}.
  • First state the values that vv and iLi_L approach when a constant current of 1 A is supplied for sufficient time.
  • Create an ss model using the matrices you derived and verify using tf·dcgain.
  • This parallel circuit differs in configuration from the circuit with a series RL branch below.
  • This time, replace one of the three repeated RR values for the RL circuit with this comparison.

2. Mechanical State Space

  1. Keep the mechanical model's M=1M=1 and k=5k=5, and rebuild A and sys for b∈{0.5,2,10}b\in\{0.5,2,10\}. Plot the three position step responses on the same time axis and label bb in the legend.
  2. Compare the presence of oscillations and convergence of each curve. State which bb curve supports your judgment.
  3. Using the same state order, select only linear velocity as the output. Record the Cout and dcgain(sys) used beside their values for position output.

3. Electrical State Space

The states of this circuit are x=[vCiL]𝖳x=\begin{bmatrix}v_C&i_L\end{bmatrix}^{\mathsf T}. vCv_C is the capacitor voltage [V], and iLi_L is the current in the series RL branch [A].

  1. Keep the other baseline circuit coefficients unchanged and rebuild A, Cout, and sys for R∈{1,3,10}R\in\{1,3,10\}.
  2. Calculate the final output voltage for a 1 A input using dcgain(sys), and record RR and voltage in two columns.
  3. State that Ccap is capacitance and Cout is the output matrix. Use the state order and Cout to write the output equation y=Coutxy=C_{\mathrm{out}}x, and judge whether it represents the intended resistor voltage.

4. State coordinates and initial values

  1. On the same time axis as the baseline model, plot initial(sys,[0;1],0:0.01:10) and initial(sys,[1;0],0:0.01:10). Label the initial states in the legend.
  2. State which state starts at a value other than 0 and whether an external input is present. Distinguish the step response with initial state 0 from the output caused by the initial state.

Submission and saving

Include code, actual outputs and plots, and your own interpretation. Submit through KLAS; check the semester schedule and latest announcements for the deadline.

Filename: Name_StudentID_Week5.mlx.

Restart the runtime, run all code from the top, then save.

Optional practice

Example: Selecting the wrong state as the output

  1. Keep A,B,D of the mechanical model unchanged. When position is required, record the transfer functions obtained using Cout=[0 1] and Cout=[1 0].
  2. State the order of the states and the units of each output. Change only the Cout line to output position, and rebuild the model.