Skip to main content
emobility.academy
B.Tech / BEControl designIntermediate About 5 weeksMATLAB & Simulink

State-Space Modelling and Pole Placement for an EV Drivetrain

Build a state-space model of an EV drivetrain with motor inertia, a compliant half-shaft and the vehicle mass, then design a full-state feedback controller by pole placement and an observer to estimate unmeasured states. The design damps driveline shuffle during torque steps.

Tools: MATLAB · Control System Toolbox

State-Space Modelling and Pole Placement for an EV Drivetrain: Students working on simulation software in the DIYguru computer lab
Representative photo from DIYguru's EV lab, not of this specific project.

The problem

An EV motor can change torque in milliseconds, and the compliant half-shafts between motor and wheels turn that into a low-frequency oscillation called shuffle, felt as a jerk by passengers. A simple speed controller cannot damp it well because the shaft twist is not measured. State-space design with an observer handles this directly and introduces students to modern control.

Objectives

  • Derive a three-state drivetrain model: motor speed, shaft twist and vehicle speed.
  • Check controllability and observability.
  • Design a full-state feedback controller by pole placement to damp shuffle.
  • Design a Luenberger observer that estimates shaft twist from motor speed.
  • Verify on the non-linear model with road load and torque limits.

What you need

Tools and toolboxes

  • MATLAB — Model derivation, matrices and scripted design.
  • Control System Toolbox — ss, ctrb, obsv, place, step, initial, bode and eig.
  • Simulink — Non-linear verification model with the State-Space block, controller and observer.

Software

  • MATLAB R2023b or later
  • Simulink
  • Example drivetrain parameters

Extra parts and data

None beyond the software above.

Key concepts

State-space model
dx/dt = A·x + B·u, y = C·x + D·u. The state vector x holds every quantity needed to predict the future, here speeds and shaft twist.
Controllability and observability
Controllability means the input can move every state; observability means every state can be inferred from the outputs. Both are checked by the rank of matrices built from A, B and C.
Pole placement
Choosing a feedback gain K so the closed-loop matrix A − B·K has eigenvalues at chosen locations, which set the speed and damping of each mode.
Luenberger observer
A model running in parallel with the plant, corrected by the output error through a gain L. It estimates states that are not measured, such as shaft twist.

Step-by-step guide

  1. 1

    Choose parameters

    Use example values: motor rotor inertia 0.05 kg·m², gear ratio 9, half-shaft stiffness 5000 N·m/rad and damping 20 N·m·s/rad at the wheel side, vehicle mass 1500 kg and tyre radius 0.3 m (equivalent wheel inertia m·r²). Write the parameters in a script, referring motor quantities to the wheel side through the gear ratio. Compute the equivalent vehicle inertia at the wheel and the motor inertia referred to the wheel by multiplying by the square of the gear ratio, and check that the totals are sensible.

    Checkpoint: A parameter script with all values referred to one side of the gearbox.

  2. 2

    Derive the model

    Define states x1 = motor speed (wheel side), x2 = shaft twist angle, x3 = vehicle wheel speed. Write Jm·dx1/dt = T − k·x2 − c·(x1 − x3), dx2/dt = x1 − x3 and Jv·dx3/dt = k·x2 + c·(x1 − x3) − Tload. Arrange into A and B, with output y = x1 (motor speed, which is measured). Build with ss.

    Checkpoint: Eigenvalues of A include a lightly damped complex pair whose frequency matches √(k·(1/Jm + 1/Jv))/(2π), typically a few hertz.

  3. 3

    Open-loop analysis

    Apply a torque step with step and plot motor speed, twist and vehicle speed. Observe the shuffle oscillation in vehicle acceleration. Compute the natural frequency and damping ratio with damp. Plot the Bode magnitude from torque to vehicle speed and identify the resonance peak. Plot vehicle acceleration rather than speed, since shuffle is felt as oscillating acceleration. Measure the decay of the oscillation and compare it with the damping ratio from damp. Note the peak-to-peak acceleration as a baseline for later comparison.

    Checkpoint: A step response with visible oscillation at the shuffle frequency and a matching Bode peak.

  4. 4

    Check controllability and observability

    Compute rank(ctrb(A,B)) and rank(obsv(A,C)) with C selecting motor speed only. Both should equal three. Explain physically why motor speed alone is enough to observe the twist: the shaft torque acts back on the motor, so twist appears in motor acceleration. Also check the condition number of each matrix; a full-rank but badly conditioned matrix means some states are only weakly observable or controllable, which makes the observer sensitive to noise. Scale the states to similar units before computing it.

    Checkpoint: Both ranks equal three, confirming the design is feasible with a single measured output.

  5. 5

    Design state feedback

    Choose closed-loop poles that keep the rigid-body mode close to its natural speed but raise the damping of the shuffle pair to about 0.7, keeping the frequency similar. Compute K with place(A,B,p). Add integral action on vehicle speed error, or a reference feedforward gain, so the vehicle tracks a speed demand. Check closed-loop eigenvalues with eig(A − B·K). Check the peak torque demanded by the controller during a step and compare it with the motor torque limit. If it is too high, move the poles closer to their open-loop positions.

    Checkpoint: Closed-loop eigenvalues match the chosen poles and the step response shows no visible shuffle.

  6. 6

    Design the observer

    Place observer poles three to five times faster than the controller poles and compute L with place(A',C',po)'. Build the observer dynamics dx̂/dt = A·x̂ + B·u + L·(y − C·x̂). Simulate with a wrong initial estimate and check convergence. Check the effect of measurement noise on the estimated twist. Add measurement noise to the motor speed signal at a level similar to an encoder or resolver and check how noisy the twist estimate becomes. Move the observer poles if the estimate is too noisy.

    Checkpoint: Estimated twist converges to the true twist within a fraction of the shuffle period from a wrong initial value.

  7. 7

    Combine and check the separation principle

    Combine controller and observer into one closed-loop system and compute its eigenvalues; they should be the union of the controller and observer poles. Simulate a torque-demand step and compare acceleration with the open-loop case. Compute the RMS jerk in both cases. Plot the true and estimated states together during the step to confirm the observer tracks well in closed loop. Report RMS jerk and peak acceleration overshoot for open loop, full-state feedback and observer-based feedback.

    Checkpoint: Combined eigenvalues equal the two designed sets, and RMS jerk is clearly lower than open loop.

  8. 8

    Non-linear verification

    In Simulink, build the drivetrain from Integrator and Gain blocks so non-linear road load (drag in v², rolling resistance) and a motor torque limit can be added. Implement the controller and observer in discrete time with c2d at 1 ms. Run a tip-in (sudden torque request) and a tip-out with gear backlash ignored. Use a fixed-step solver with a step smaller than the controller sample time. Compare acceleration traces with and without the controller in the same plot.

    Checkpoint: Shuffle remains well damped in the non-linear model, with torque within limits.

  9. 9

    Robustness and report

    Vary shaft stiffness by ±30 per cent and vehicle mass by ±20 per cent and recheck damping and RMS jerk. Report the design, the open- and closed-loop comparison, observer performance and robustness. State the simplifications: no backlash, no tyre slip, linear shaft. Use a loop over parameter values and record closed-loop damping of the shuffle mode for each. In the report, include the derivation of A and B, all design choices and plots. Explain how the controller would be implemented in a motor control unit.

    Checkpoint: A robustness table and a report with all plots reproduced by script.

Testing & validation

  • Open-loop shuffle frequency matches the analytical value.
  • Controllability and observability ranks equal the state count.
  • Closed-loop and observer eigenvalues as designed.
  • Reduced RMS jerk in the non-linear model across parameter variations.

Expected results

A three-state drivetrain model with pole-placement control and a Luenberger observer that damps shuffle, verified in a non-linear discrete-time Simulink model and across parameter changes.

Take it further

  • Add gear backlash as a dead zone and study its effect.
  • Replace pole placement with LQR and compare.
  • Replace the observer with a Kalman filter for noisy measurements.
  • Add tyre slip and a traction control interaction.

Viva and review questions

Why can motor speed alone reveal the shaft twist?

The shaft torque, proportional to twist, acts back on the motor and changes its acceleration. The observability matrix has full rank, which confirms this.

Why make observer poles faster than controller poles?

So the estimates converge before the controller relies on them. If they are too fast, though, the observer amplifies measurement noise.

What is the separation principle?

For a linear system the controller and observer can be designed independently, and the combined system's poles are the union of both sets.

Learn it at DIYguru

These DIYguru courses and programmes teach what this project needs.

Related EV projects

All 100 MATLAB & Simulink EV projects