0121-14 Monarco HAT Balancing Ball

Example Projects > 0121 Monarco HAT > 0121-14 Monarco HAT Balancing Ball

Ball balancing on a Spool

This folder contains the source files for the demonstration project on using REXYGEN on the Raspberry Pi minicomputer with the Monarco HAT add-on board. It illustrates what can be achieved with the Monarco HAT and its high-speed analog inputs and outputs.

The Monarco HAT is configured to act as a controller of a ball balancing on a spool.

Timing of the project

The algorithm runs each 5 milliseconds (0.005 s). See the EXEC function block,
tick x ntick0 = 0.005 x 1 = 0.005 s.


  • REXYGEN Runtime Core and MonarcoDrv modules must be installed and running on the Raspberry Pi.

Running the example

  • The *exec.mdl file is the project main file, open it with REXYGEN Studio.
  • Compile and download the project to the target device.
  • Switch to Watch mode and observe the algorithm (use Target->Watch Selection to display real-time data).


Additional information