The problem
Independent motors on the left and right wheels let an EV generate a yaw moment by sending different torques to each side. This can reduce understeer, sharpen response and improve stability without using the brakes, but the controller must respect motor limits, tyre grip and driver intent. This project builds and tests such a controller on a vehicle model more detailed than the one used to design it.
Objectives
- Build a vehicle plant with independent left and right rear motors in the Vehicle Dynamics Blockset.
- Generate a yaw-rate reference from a bicycle model with a friction-based saturation.
- Design a direct yaw-moment controller and allocate the moment to left and right motor torques.
- Compare handling with equal torque split in standard manoeuvres.
- Check robustness to friction, mass and motor-limit variations.
What you need
Tools and toolboxes
- Vehicle Dynamics Blockset — Vehicle Body 3DOF dual-track model and wheel and tyre blocks with Magic Formula tyre options as the plant.
- Simulink — Controller, reference model, torque allocation, driver steering inputs and logging.
- Control System Toolbox — Linearisation, LQR or PI gain design and frequency-domain checks of the yaw loop.
- MATLAB — Parameters, manoeuvre scripts and metric calculation.
- Powertrain Blockset — Optional: Mapped Motor blocks for realistic motor torque and power limits.
Software
- MATLAB R2023b or later
- Simulink
- Vehicle Dynamics Blockset
- Control System Toolbox
Extra parts and data
None beyond the software above.
Key concepts
- Direct yaw-moment control
- The controller computes a corrective yaw moment Mz from yaw-rate error, and the allocator converts it to a torque difference ΔT = Mz·R/(t/2) between the wheels, where t is track width.
- Yaw-rate reference
- Desired yaw rate from a bicycle model with a chosen understeer gradient, limited to what tyre friction can support, r_max ≈ μ·g/v.
- Torque allocation
- Splits total driver torque and the yaw-moment difference between left and right motors while respecting each motor's torque limit and avoiding excessive wheel slip.
- Sideslip angle
- Angle between the vehicle's heading and its velocity. Keeping it small is a key stability goal, especially on low-friction surfaces.
Step-by-step guide
- 1
Define vehicle and requirements
Use an example rear-wheel-drive EV with two motors, each with a stated peak torque and power, and set mass, inertia, track width, wheelbase and tyre parameters. Define manoeuvres: step steer at 80 km/h, constant-radius cornering with increasing speed and a double lane change. Define metrics such as yaw-rate tracking error, peak sideslip, understeer gradient and lateral acceleration limit. Fix the manoeuvre speeds and inputs at this stage.
Checkpoint: A parameter script and a manoeuvre and metric table agreed before design.
- 2
Build the plant
Assemble the plant from the Vehicle Dynamics Blockset with a Vehicle Body 3DOF dual-track block, four wheel and tyre blocks using Magic Formula coefficients, and two rear torque inputs. Add a simple steering input and a speed controller that commands total drive torque. Use a fixed-step solver with a step of 1 ms. Check tyre forces against the Magic Formula curves at a few slip values.
Checkpoint: With equal torque split, steady-state cornering produces lateral acceleration and yaw rate consistent with a bicycle model at low lateral acceleration.
- 3
Characterise the baseline
Run all manoeuvres with equal left–right torque. Record yaw-rate response, sideslip, steering angle against lateral acceleration and the maximum lateral acceleration before the vehicle departs from the path. This establishes the baseline understeer behaviour that torque vectoring should improve. Use the same steering inputs and speeds that will be used with torque vectoring so results can be compared directly. Plot steering angle against lateral acceleration to obtain the understeer gradient, and note where the response becomes non-linear.
Checkpoint: Baseline metrics recorded for every manoeuvre, with the understeer gradient computed from the cornering test.
- 4
Build the reference model
Compute the desired yaw rate from steering and speed with a bicycle model using a target understeer gradient smaller than the baseline, and saturate it at a friction limit of roughly μ·g/v. Add a first-order filter so the reference has a realistic response time. Check it against the plant's yaw rate in gentle manoeuvres. Keep the target understeer gradient positive so the reference stays stable.
Checkpoint: Reference yaw rate equals plant yaw rate at low lateral acceleration and is limited correctly at high lateral acceleration.
- 5
Design the yaw-moment controller
Linearise the plant around a steady-cornering point, or use the bicycle model with an added yaw-moment input. Design a PI or LQR controller on yaw-rate error, and optionally sideslip, that outputs a yaw moment. Check stability margins at several speeds with Control System Toolbox and add gain scheduling with speed if needed. Add a feed-forward yaw moment from the steady-state relation if feedback alone responds too slowly.
Checkpoint: Phase and gain margins above chosen limits at each design speed.
- 6
Allocate torque
Convert the yaw moment to a torque difference and add it to half the driver torque on each side. Enforce motor torque and power limits and, when a limit is reached, reduce the difference or the total torque according to a stated priority. Add a slip limiter that reduces torque on a wheel whose slip exceeds a threshold. Log every instant when a limit is active.
Checkpoint: Allocator unit tests: requested moment and total torque are delivered when feasible, and limits are never exceeded.
- 7
Closed-loop evaluation
Run all manoeuvres with torque vectoring and compare with the baseline. Plot yaw-rate tracking, sideslip and left–right torques. Compute the new understeer gradient and maximum lateral acceleration. Explain where improvements come from and any cost, such as extra energy from torque difference. Plot the steering-against-lateral-acceleration diagram for both cases on one graph. Compute the energy used by each motor so the cost of torque difference is quantified, and check that driver speed tracking is not degraded.
Checkpoint: Reduced yaw-rate error and understeer gradient versus baseline with sideslip within the chosen limit.
- 8
Robustness tests
Repeat key manoeuvres on wet and low-friction surfaces, with mass increased by a load case and with reduced motor torque limits. Script the cases with sim(). Check that the reference saturation and slip limiter prevent instability on low friction. Include a case where one motor is derated to half torque and check how the allocator handles it. Report peak sideslip and yaw-rate error for each case alongside the baseline, and explain any case where torque vectoring gives little benefit.
Checkpoint: A robustness table showing no loss of stability and bounded sideslip in all cases.
- 9
Report
Present the plant, baseline, reference model, controller design, allocation, results and robustness. State the limitations: simulation only, idealised motor response and no driver-in-the-loop. Note that real vehicle tuning would need test-track validation. Include the design model, controller gains, stability margins and allocation rules. Present results in tables alongside baseline values, with plots for key manoeuvres. Discuss which parts of the design would need adjustment for a front-wheel-drive or four-motor vehicle, and keep scripts for reproducibility.
Checkpoint: A report comparing torque vectoring with the baseline on every defined metric.
Testing & validation
- Plant agrees with a bicycle model at low lateral acceleration.
- Reference model saturates correctly.
- Controller stability margins at several speeds.
- Allocator respects motor limits in unit tests.
- Improvement in yaw tracking, understeer and sideslip across manoeuvres and surfaces.
Expected results
A torque-vectoring controller for a dual-motor EV that reduces understeer and yaw-rate error in standard manoeuvres while respecting motor limits and staying stable on low-friction surfaces.
Research angle for your M.Tech thesis
Research questions: how much can direct yaw-moment control reduce understeer and improve transient response for a rear dual-motor EV, and how do different allocation and reference-shaping choices trade handling against energy and robustness on low friction? Metrics: yaw-rate RMS error, peak sideslip, understeer gradient, maximum lateral acceleration and energy per manoeuvre. Baselines: equal split and a simple feed-forward yaw moment. Validation on a plant with non-linear tyres distinct from the design model, across surfaces and loads, makes the comparison credible for a conference paper.
Take it further
- Replace the controller with MPC that handles motor limits directly.
- Add energy-efficient allocation that minimises motor losses.
- Extend to four in-wheel motors.
- Add a sideslip estimator rather than using the simulated value.
Viva and review questions
How does a torque difference create a yaw moment?
Different longitudinal forces on left and right wheels act at half the track width from the centreline, giving Mz = (Fx,right − Fx,left)·t/2.
Why saturate the yaw-rate reference?
Tyres can only provide lateral acceleration up to about μ·g, so demanding a higher yaw rate than friction allows would cause sliding and instability.
Why test on the Vehicle Dynamics Blockset plant rather than the bicycle model?
The plant includes load transfer and non-linear tyres, so it shows whether a controller designed on the simple model still works with realistic dynamics.
Learn it at DIYguru
These DIYguru courses and programmes teach what this project needs.
