Ground Embedded KO Subscribe

Notes / Control Engineering

A taste of state space: several states at once

Modern control handles several states (position and speed, angle and angular rate) with one matrix. The starting point that leads to balancing robots and the Kalman filter.

GROUND EMBEDDED · NOTEControl Engineering 10A taste of state spaceTargetKpKiKd

State equations

ẋ = A·x + B·u, y = C·x + D·u

  • x: state vector (for example [angle, angular rate, wheel position, wheel speed])
  • u: input (motor torque)
  • y: the outputs you can measure

Transfer functions are good for one input and one output; state space is good for handling several inputs and outputs and the internal states together.

State feedback

TargetInput u = −K · xSystemState xposition, speed, current
State feedback. Each of several states is multiplied by its own gain and fed back together.

If every state can be measured (or estimated), control with u = -K·x. Ways to choose K:

  • Pole placement: place the closed-loop poles directly for the response speed you want
  • LQR: set a cost on state error and input magnitude and calculate the optimal K

A balancing robot can stand with an angle PID alone, but LQR takes the angle and the wheel position into account together and holds its place better.

RoadmapSee where this note sits in Control Engineering→

Observers

States that cannot be measured (when speed cannot be measured directly) are estimated from the model and the measurements. The Kalman filter estimates optimally with noise taken into account, and rotor-position estimation in sensorless motor control is an observer too.

Next steps

You need linear algebra (matrices, eigenvalues) and MATLAB/Python tools. There is no need to use it on problems PID handles well, but it is a powerful tool for systems whose states are tangled together.

FREE PDFGet the 3 free ebooksIf you want to keep reading this topic as one book: BLDC motor control, serial communication and sensors at book length. PDFs are in Korean.Get them free →