With the controller running on the target, capture the closed-loop response the same way you captured the open-loop response on page 2: External Mode, Data Inspector, export to workspace. Overlay this hardware response with the simulation output from page 5.

The simulated and real curves lie on top of each other. No tuning iteration was performed on the hardware. This is the deliverable of Model-Based Design β a faithful simulation predicts reality, so you can explore the design space on your PC and commit the result to hardware with confidence.
Fidelity of the model is the enabler. A faithful model makes simulation a reliable prediction of reality.

This tutorial deliberately stopped at the basic closed-loop-validated controller. Here is where to go from here:
Replace the fixed setpoint with a Slider in Simulink. Drag it at runtime β the motor follows. Add live read-out of the integral term and watch it compensate disturbances. Inject a step load (press the rotor briefly); watch the controller recover. All of this happens without recompiling.
See External Mode & PIL .
The controller runs at 1 kHz; BEMF sampling runs at 20 kHz; UART logging runs at 100 Hz. Put each in its own triggered subsystem with distinct sample times β the toolbox’s Rate-Monotonic Scheduler handles real-time scheduling automatically.
See Scheduler & Multi-Tasking .
Change the Master block chip from dsPIC33AK512MPS506 to a dsPIC33CK, a PIC32MK or a SAM E70. The controller’s C code is unchanged. Peripheral pinning adapts.
The dsPIC33A has a hardware single-precision FPU β use floats guilt-free. On a dsPIC33C without FPU, the same controller works but at a higher CPU cost. The toolbox supports Fixed-Point Designer conversion for maximum efficiency.
The INSA Lyon 2022 course goes deep into this topic.
The four-phase workflow (acquire β identify β control β validate) is identical for:
Once Super-Twisting is familiar, explore:
Original Picooz work: R. Delpoux (INSA Lyon, Laboratoire AmpΓ¨re) and L. Kerhuel (Microchip Technology), with assistance from many students and interns over the 2012β2025 iterations.
You now know how to:
That is the entire MBD workflow. Every project you tackle next β PMSM, PFC, autopilot, whatever β is a specialisation of these six pages.
Back to the series index β Tutorial β Picooz Helicopter
Back β 5. Simulate & Deploy