This submission contains the work done for a senior design project to build a Lego motorcycle and control it. The authors
- Simulink simulation model, including 3d animation!
- Simulink model that is connected to the Lego
- Lego hardware design steps
- MATLAB script to generate parameters used by the models
- Report and presentation covering the project
They’ve also provided a very nice overview video. In it, one of the authors describes the hardware design, and discusses how Simulink was used to design the controller.
Because there is a simulation-only model, those of us without the hardware can run it and see the behavior with the 3d animation.
Note: Simulink 3d Animation required.
The simulation is set up to stream data to Simulink Data Inspector so you can compare simulation runs and see the design choices they made.
My only point of feedback would be to use Stateflow for the switching logic for calibration/control/stopping. Right now, the model is keeping track of time itself with an integrator, implementing a bunch of logic to check which state is current, and then enabling the correct subsystem. This strategy doesn’t scale well and could easily yield bugs if the logic allows multiple states to be active at the same time. I’ve highlighted it below with the purple area and will send MathWorks swag to whoever emails me (email@example.com) or posts a link to a working version of this model using a Stateflow chart that gives identical results.
Published with MATLAB® R2017a
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.