Team innovation competition project

Dual-motor distributed drive and electronic differential

Shanghai University · Sino-European School of Technology "Yunchuang Sino-European" innovation competition (2021–2022)

Replacing the mechanical differential with two independently driven rear wheels: an Arduino Uno + L298N + two TT motors model car, a pygame animation of the inner/outer wheel speed difference, and the competition paper, technical route and a Keras regression example.

Background

A mechanical differential solves a very concrete problem: in a turn, the outer wheel travels a longer arc than the inner wheel. If both wheels are locked to one rigid axle and must turn at the same speed, the tyres scrub against the road — at best extra wear, at worst a loss of control.

Distributed drive offers another answer: give each rear wheel its own motor and adjust their speeds so that each follows its own turning radius. That is an electronic differential.

This was a 2021–2022 “Yunchuang Sino-European” innovation competition project at the Sino-European School of Technology, Shanghai University. Starting from a comparison of drive layouts, the project produced three things: a pygame visualisation of the differential, an Arduino rear-drive model car, and a Keras regression example validating a neural-network workflow.

Design

Three layouts were compared:

  • Centralised drive: one motor plus a mechanical differential — mature, but the speed relationship is fixed by hardware.
  • In-wheel distributed drive: fully independent wheels, the most control freedom, but also the highest cost and unsprung mass.
  • Dual-motor distributed drive: one motor per rear wheel, front-wheel steering retained, differential implemented in software — the practical compromise for a model car.

The final design is dual-motor rear drive with front servo steering: the two rear wheels are driven by the two H-bridges of an L298N, an MG995 servo sets the front steering angle, and an IR remote issues forward, backward, left and right commands.

Principle

At low speed and neglecting tyre slip, the turn can be described with a simplified Ackermann model:

R = L / tan(δ)
v_inner = v · (R - B/2) / R
v_outer = v · (R + B/2) / R

where L is the wheelbase, B the track width, δ the front steering angle, and R the turning radius at the rear axle. The speed ratio depends only on geometry:

v_outer / v_inner = (R + B/2) / (R - B/2)

The model car has a wheelbase of about 0.16 m and a track of about 0.12 m. At a 30° steering angle, R ≈ 0.277 m and the ratio is about 1.55: at 1 m/s the inner wheel runs at about 0.78 m/s and the outer at about 1.22 m/s. The code has no encoders and no closed loop; it translates this relationship into fixed duty cycles — 180 on both sides going straight, 120 inside and 180 outside when turning left, and the reverse when turning right.

Implementation

  • Controller: Arduino Uno, analogWrite PWM into the L298N IN1–IN4 inputs; the Servo library drives the MG995 at 45° / 90° / 135°.
  • Remote: HX1838 IR receiver on D3, using the legacy IRremote 2.x IRrecv / decode_results API; key codes are printed over serial at 9600 baud.
  • Power: two 18650 cells into the L298N 12V / GND terminals, with Arduino and L298N sharing ground; the servo should have its own 5 V supply to avoid brown-outs when the motors start.
  • Visualisation: the pygame animation maps wheel speed to colour depth and shows a direction arrow and steering angle; it evolved from v1.0’s colour mapping to v2.0’s road background and wheels rotating with the steering angle.
  • Documentation: the competition paper, project plan and technical route, electronic-differential research, IR and servo debugging notes, and the build summary are all in docs/.

Results and limitations

The car drives forward, backward, turns left and right, and stops; the animation makes the inner/outer speed difference visible. It is a good teaching and concept-validation platform, but not a complete electronic-differential controller:

  • there are no wheel-speed sensors: PWM is open loop, so battery voltage and ground friction change the actual speeds;
  • front steering is open loop, with no angle feedback;
  • there is no current, speed or yaw-rate loop, so slip and load transfer are not handled;
  • the Keras example uses the Boston Housing dataset; it validates the regression workflow only and is not trained on vehicle data.

The smallest useful closed-loop upgrade would be: encoders on the rear wheels with a left/right speed PID, a potentiometer or angle sensor on the steering servo, and a target speed ratio computed from the measured steering angle instead of a fixed 120/180 table.

Source, animation, Arduino sketch, paper and notes: https://github.com/yicongl1/EV-Electronic-Differential

Technical notes

01 How much faster is the outer wheel? Geometry, formulas and PWM mapping for an electronic differential From Ackermann steering to R = L / tan(δ), deriving the inner/outer wheel ratio, then reading the model car's 120/180 PWM duty cycle as an open-loop differential. 02 Two TT motors and one L298N: putting an electronic differential into an Arduino car H-bridge, IR remote, MG995 servo and 18650 power; the legacy IRremote 2.x API, common-ground issues, and four iterations of the pygame wheel animation.

Related skills

  • Arduino
  • C++
  • Project management