← Projects · Industry

3-DOF helicopter rig: from circuit board to closed-loop control

A twin-rotor helicopter lab rig with three rotating axes and only two motors. I built its electronics (sensor conditioning, motor drivers, a custom PCB), identified its model on a thrust test bench, and designed and tested linear, gain-scheduled and sliding-mode controllers on the real hardware.

Control · Embedded electronics · System identification · MATLAB

Stack: MATLAB / Simulink real-time · Microcontroller · Analog electronics · PCB design · Autodesk Inventor

3 axes, 2 motorsunderactuated: two inputs control three angles
≈ 1 spitch settling time on the real rig
2 ways to run itstand-alone microcontroller or a PC running MATLAB in real time

The problem

A 3-DOF helicopter is a classic control benchmark, used in universities around the world (Quanser sells a commercial version). An arm on a vertical post carries two propellers at one end and a counterweight at the other. The rig can pitch, rise (elevation) and turn around the post (travel), but has only two motors, so the axes are strongly coupled and nonlinear.

The department had a two-axis mechanical base from an earlier project. For my engineering graduation project at HIAST (2017), I turned it into a working, controllable helicopter rig: hardware, model and controllers.

How it works

  1. MechanicsAdded the helicopter head on a rotary joint, two DC motors with 12-inch carbon propellers in protective cages, and a counterweight.
  2. ElectronicsOne board filters and scales the three angle sensors and drives both motors, with a switch that hands control to a microcontroller or to the PC.
  3. ModelEquations of motion from first principles; thrust curves measured on a test bench; masses and inertias from measurement and a CAD model.
  4. ControlControllers designed from the model and tuned on the physical rig, axis by axis.

Electronics

  • Sensor chain: a 100 Hz low-pass filter on each potentiometer angle sensor removes vibration noise but keeps the fast motion, then op-amp stages shift and scale the signal into the range of the microcontroller’s ADC and of the PC’s data-acquisition card (Sensoray 626, 14-bit).
  • Motor drive: the acquisition card has no PWM output, so a TL494 chip turns its analog command into a 1 kHz PWM signal. An optocoupler isolates the logic from the 30 V motor supply, and a MOSFET with a flyback diode switches each motor.
  • Stand-alone mode: the microcontroller reads the angles, takes the target elevation and travel angles from the user, and shows the live angles on an LCD.
  • Custom PCB holding all of the above, with connectors for both controllers.

The control board: sensor conditioning, PWM generation and motor drivers

Motor driver: PWM through an optocoupler to a MOSFET, with a flyback diode

Left: the control board. Right: one motor-driver channel.

System identification

  • Built a thrust test bench with a load cell and an instrumentation amplifier, calibrated it with known weights, and measured thrust against motor voltage for each motor (both close to linear above a 3 V dead zone).
  • Measured lengths and masses directly; took the centre of mass and the inertias from an Autodesk Inventor model of the rig.
  • Combined these into a state-space model with two inputs: the sum of the two thrusts (lifts the arm) and their difference (tilts the head, which then turns the arm).

The thrust test bench: one motor and propeller on a load cell

Control and results

  • Pitch: state feedback by pole placement on the linearized model; settles in about one second.
  • Elevation: state feedback with integral action, then a fuzzy gain scheduler that adapts the gains to the error. This worked but still overshot.
  • Travel: a cascade loop. Travel asks for a pitch angle, and the pitch loop delivers it.
  • The key finding: motor lag. The motors respond to a command noticeably late, which caused most of the overshoot. Adding a first-order model of that lag to the design removed the overshoot on both elevation and travel.

Elevation with gain scheduling: overshoot and slow settling

Elevation after adding the motor-lag model: no overshoot

Elevation step on the real rig (angle in rad, time in s). Left: gain-scheduled controller. Right: the same axis once the motor lag is in the model.

Travel with state feedback and integral action

Travel after adding the motor-lag model: smooth, no overshoot

Travel step on the real rig. Left: state feedback with integral action. Right: with the motor-lag model.

I also tried nonlinear sliding-mode control (first order and super-twisting). It stabilized the rig but could not remove the steady-state error, because of the gap between the model and the real hardware and the motor lag. This was my first hands-on lesson in how much a controller depends on how good its model is: the question behind my later research on models learned from data, with guarantees.

What I’d do next

Brushless motors would cut the actuator lag the most. The rig is also sensitive to how level its base is, so a levelling mount or an estimate of the tilt would help.

My role

Individual graduation project (Diplôme d’Ingénieur, Electronic Systems, HIAST, 2017): mechanical extension, circuit and PCB design, system identification, modelling, controller design and experiments.

For researchers

With pitch θ, elevation φ and travel ψ, sum and difference thrusts F₊ and F₋, arm length La and rotor offset Lh:

  • Jθ θ̈ = Lh F₋ (the head’s centre of mass sits only 8 mm from the pitch axis, so its gravity torque is dropped)
  • Jφ φ̈ = La F₊ cos θ − M g Lg sin(φ − φg)
  • Jψ ψ̈ = Lh F₋ cos φ − La F₊ sin θ sin φ

The travel inertia Jψ itself changes with elevation. Linear designs were made around the equilibrium θ = 0 with the hover thrust that balances gravity at the target elevation.

Geometry and forces used in the model