The most complete model of the Tunneling Ball Device is designed in Ptolemy II, making use of its heterogeneous modeling abilities. Ball drops, a continuous model for motor dynamics, PID control, and trajectory planning are all incorporated.
Code Generation in Ptolemy II
Ptolemy II has an extensive code generation framework, and is able to target the Luminary microcontroller. The controller is built in the PTIDES model of computation, and generated code is linked against the PtidyOS real-time operating system. The code generation framework is not complete, and needs augmentation to solve the Tunneling Ball Problem.
- Currently, issues with the Continuous domain in Ptolemy II prevent simulating the motor plant in a closed-loop configuration with DE or PTIDES. Specifically, integrals with feedback drive the solver step size down until the simulation essentially stops. A separate model exists to replicate the plant response and position control in the Continuous domain only. In the complete model used for code generation, motor dynamics are trivially deployed.