A complete MBD project, end to end

This six-part tutorial walks through a real Model-Based Design project from zero to deployment using a cheap toy helicopter rotor (the Picooz) as the plant.

You will acquire motor data on a running dsPIC33A target using External Mode, identify a physics-based model from the measurements (using five different methods β€” four of which need no MATLAB add-on toolbox), design a controller in Simulink, simulate the closed loop, generate embedded C code in one click, and validate on hardware β€” all with the same model.

This is the 30-minute demo that opens the “Model-Based Design: From Laboratory to Embedded Deployment” session at Γ‰cole Centrale Nantes (December 2025), expanded into a self-paced, reproducible tutorial with downloadable models, scripts, and data.

Picooz toy helicopter β€” closed
Picooz opened β€” rotor and DC motor visible


The six phases β€” choose your entry point

#PageWhat you learnDuration
1HardwareWhat the Picooz is, its electronics, why it makes a great MBD teaching example~10 min
2Acquisition with External ModeExternal Mode concept, chirp excitation, capturing live data from a running MCU~20 min
3Identification β€” Five MethodsGrey-box physical model and five ways to fit it β€” from a closed-form backslash on base MATLAB all the way up to the System Identification Toolbox GUI~45 min
4Controller DesignClosed-loop control β€” PI baseline, then Super-Twisting sliding-mode for the non-linear plant~30 min
5Simulate & DeployClosed-loop simulation, one-click code generation to the target~15 min
6Validate & BeyondHardware response vs. simulation β€” the “zero tuning iteration” payoff, then pointers to go further~15 min

Audience. No prior MBD experience required. Basic Simulink familiarity helps. Every concept is introduced when it is first used.


Why a Picooz?

The Picooz is a ~€15 toy helicopter. Opening one up reveals a small brushed DC motor driving a plastic rotor against significant aerodynamic drag. As an MBD teaching vehicle it hits every sweet spot:

PropertyWhy it matters
Cheap (~€15)Buy spares. Break things.
SafeA few grams, a plastic rotor on a bench clamp.
Non-trivial dynamicsNon-linear aerodynamic drag β€” forces grey-box identification, a linear model is not enough.
Sensor-less speedSpeed is inferred from back-EMF, the same technique used in industrial brushless controllers.
CompleteEvery MBD phase (acquisition Β· identification Β· control Β· deployment Β· validation) is demonstrated in an afternoon.

Once you have the workflow in your hands, apply it to a PMSM motor, a buck converter, or an industrial axis β€” the four-phase loop is identical.

The four phases you are about to walk through are the loop of every MBD project β€” Picooz is simply a concrete vehicle for them:

Acquire β†’ Identify β†’ Control β†’ Validate (then Deploy and Validate again on hardware).


What you need before starting

Hardware β€” a Picooz (or any small brushed DC motor) on a clamp, plus one of:

  • dsPIC33AK Curiosity Platform Development Board (EV74H48A) β€” used by default in the tutorial models
  • Curiosity Nano EV17P63A β€” also supported
  • Any dsPIC33C / PIC32 / SAM board β€” the tutorial models rebuild for any supported target by changing one field in the Master block

Software

  • MATLAB + Simulink + Embedded Coder (any release R2018b or newer)
  • MPLAB Device Blocks for Simulink β€” install from MATLAB File Exchange
  • MPLAB X IDE + XC-DSC compiler (free from Microchip )
  • No other toolbox is strictly required β€” methods L0-L2 on the identification page and the Super-Twisting controller all work on base MATLAB

See the Installation page for the complete setup.


Downloadable assets β€” reproduce the entire tutorial

Every page ships a self-contained asset bundle: the Simulink model, the recorded dataset, and the scripts. Reproduce, modify, adapt.

PageAssets
02 Acquisitiontutorial_picooz_acquire.slx Β· tutorial_picooz_acquire_extmode.slx Β· tutorial_picooz_chirp.mat Β· tutorial_picooz_chirp_log.mat Β· tutorial_picooz_process_log.m
03 Identificationpicooz_motorBlade_m.m Β· identify_L1_backslash.m Β· identify_L2_fminsearch.m Β· identify_L3_lsqnonlin.m
05 Deploytutorial_picooz_simulation.slx Β· tutorial_picooz_deploy_tunable.slx

Reference material

  • This tutorial expands the live 30-minute demo delivered at Γ‰cole Centrale Nantes on 2025-12-04 (Model-Based Design: From Laboratory to Embedded Deployment) into a self-paced, reproducible walkthrough β€” every figure and dataset from that demo is re-used in the six pages below.
  • Rapid Control Prototyping course, INSA Lyon 2022 β€” 3-hour teaching module including fixed-point deep-dive and multi-rate scheduling (reveal.js slides, French).
  • ctrl-elec project β€” advanced motor-control algorithms and educational material.

Ready? β†’ Start with 1. Hardware .

1. Hardware

What is the Picooz? The Picooz is an inexpensive IR-controlled toy helicopter (~€15). Inside it you find:

Read more β†’

2. Acquisition with External Mode

Goal. Record how the motor reacts to a known PWM input signal, so we have the data needed to fit a mathematical model in the next step. πŸ’» Try the …

Read more β†’

3. Identification β€” Five Methods

Goal. Turn the recorded pair \((u(t), \omega(t))\) into a mathematical model we can simulate β€” and do so without relying on an expensive add-on …

Read more β†’

4. Controller Design

Goal. Design a controller that drives the rotor to a commanded speed setpoint, rejecting disturbances (wind, battery droop, rotor wear), and is cheap …

Read more β†’

5. Simulate & Deploy

Goal. Verify on the PC that the identified model + designed controller behave correctly, then generate embedded C code and flash the target β€” in one …

Read more β†’

6. Validate & Beyond

Goal. Verify that the real hardware response matches the simulated prediction β€” and draw the conclusion that gives MBD its name. The final check β€” …

Read more β†’