SysML allow both structural and behavioral modeling of the system. SysML models can be formally interpreted and executed. Ones executed analysis can be performed at system level. Ones we are good with simulation results we can prototype. Using programmable Lego Mindstors NXT for prototyping is an out of the box way to test and demonstrate future system behavior. We can use same system model to control and calibrate prototype.
In the second video [1st reference – 1st part] from the series of three we will demonstrates the SysML transmission model connected to LEGO Mindstorms NXT linear gearbox. We will demonstrate how using API between Cameo Systems Modeler and LEGO executable SysML model controls switching between gears in LEGO model. We will show how model is built to use API.
See video demonstrating working integration and model setup:
Java API of LEGO Mindstorms NXT is accessed by Cameo Systems Modeler plugin [2nd reference], which enables below functions in the model to control motors and read sensors data.
x – Motor number starting from 0
Y – Power (with “–“ in front if direction is opposite)
Z – Degrees of rotation
Sample: color = NXTManager.getColorBySensor();
Sample: distance = NXTManager.getDistanceFromSensor();
X – number of motor
Functions are used in custom created opaque behaviors library associated with state machine states to execute when entering the states, leaving the states, and in transition. Fig. 1 demonstrate setup and use of the opaque behaviors library.
In the third video we will demonstrate how LEGO gearbox (hardware in the loop) is calibrated to get right gears transfer rate and speed eliminating instability of motor speed depending on load introduced by gearbox.
- Building Executable SysML Model – Automatic Transmission System (Part 1) https://blog.nomagic.com/building-executable-sysml-model-automatic-transmission-system-part-1/
- Interface between Cameo Systems Modeler and LEGO Mindstorms https://blog.nomagic.com/collaboration-between-simulated-model-and-external-system-controlling-lego-mindstorms-with-cameo-simulation-toolkit/
About Cameo Simulation Toolkit
The Cameo Simulation Toolkit provides the first in the industry extendable model execution framework and infrastructure based on number of standards:
- Model debugging and animation environment
- Pluggable engines, languages and evaluators
- User Interface prototyping support
- Model driven configurations and test cases
The standard based model execution of:
- Activities (OMG fUML standard)
- Composite structures (OMG PSCS)
- State Machines (W3C SCXML standard)
- Actions/scripts (JSR223 standard)
- Parametrics (OMG SysML standard) including build in and external math solvers: Math solvers: Built-in solver, Matlab, Maple, Mathematica, OpenModelica.
- Sequence diagrams (OMG UML Testing Profile)