Simulink and LEGO MINDSTORMS EV3

Simulink And Lego Mindstorms Ev3-PDF Download

  • Date:02 Jul 2020
  • Views:1
  • Downloads:0
  • Pages:60
  • Size:3.11 MB

Share Pdf : Simulink And Lego Mindstorms Ev3

Download and Preview : Simulink And Lego Mindstorms Ev3


Report CopyRight/DMCA Form For : Simulink And Lego Mindstorms Ev3


Transcription:

Simulink and LEGO MINDSTORMS EV3, Licensed under a Creative Commons Attribution ShareAlike 4 0 International CC BY SA 4 0. This is a human readable summary of and not a substitute for the license. http creativecommons org licenses by sa 4 0 legalcode. You are free to, Share copy and redistribute the material in any medium or format. Adapt remix transform and build upon the material for any purpose even commercially. The licensor cannot revoke these freedoms as long as you follow the license terms. Under the following terms, Attribution You must give appropriate credit provide a link to the license and indicate. if changes were made You may do so in any reasonable manner but not in any way that. suggests the licensor endorses you or your use, ShareAlike If you remix transform or build upon the material you must distribute your. contributions under the same license as the original. No additional restrictions You may not apply legal terms or technological measures that. legally restrict others from doing anything the license permits. Simulink and LEGO MINDSTORMS EV3,Motivation for this workshop 4.
Getting started 4,How to use and work with this manual 5. I1 Workshop run through options 5,I2 Notation and formatting 5. Project 0 Getting Familiar with Simulink 6,Simulink 6. Simulink Library Browser and Simulink Models 6,More on Simulink 8. Project 1 Explore Simulink and LEGO MINDSTORMS EV3 9. P1 1 Get Started Program EV3 Status Light with Simulink 9. P1 2 Work with EV3 I O Access and Display EV3 Sensor Value 13. P1 3 Model Test and Implement Collision Avoidance Behavior 15. P1 4 Control interactively Speed and Steering Control 17. Project 2 Complex System Design with Simulink 20,P2 1 Line Following Robot 20.
P2 2 Line Following and Collision Avoiding Robot With Base Simulink Blocks 22. P2 3 Line Following and Collision Avoiding Robot With User Defined MATLAB Function Block 24. P2 4 Line Following and Collision Avoiding Robot Event driven modeling 27. Optional Project 1 Plant Modeling for LEGO EV3 Robot 31. OP1 1 Simulation Model of EV3 Robot 31,OP1 2 Motor Modeling for EV3 Plant 35. Optional Project 2 Controller Design for Lego Robot 42. OP2 1 Design PID Controller for EV3 Robot 42, OP2 2 Fine tune PID Controller for desired step response 48. Optional Project 3 Event driven modeling using Stateflow 53. Appendix 1 Background Information 57,Simulink 57,Hardware Support Packages 57. LEGO MINDSTORMS EV3 58,Appendix 2 Software and Hardware Setup 59. Software 59,Hardware 59,Configuration 60,Simulink and LEGO MINDSTORMS EV3.
Motivation for this workshop, As the industry technology and society make rapid progress there is a growing need to teach the next. generation of engineers ever more complex concepts and build intuition quickly so that they can apply. their knowledge to develop the technology of the future This calls for hands on and project based. learning via low cost easy to use hardware and software platforms to make it easier and fun to teach. learn and test the engineering ideas, Simulink has long been the tool of choice of the industry automotive aerospace electronics etc since. it provides a very user friendly collaborative and flexible environment for designing simulating testing. and eventually implementing complex multi domain systems and their control logic. Starting 2012 Simulink includes the capability to program low cost hardware like LEGO MINDSTORMS. NXT and EV3 Arduino Raspberry Pi and BeagleBoard This new capability enables students to develop. and test a variety of controls signal image and video processing related applications from within. This workshop is based on Simulink Support Package for LEGO MINDSTORMS EV3 The participants will. have a chance to work through lab modules with examples of obstruction detecting and line following. robots They will gain practical hands on experience in building high level examples themselves. Additionally participating faculty members would have a chance to understand the potential for use in. classrooms with students, At the end of this workshop the participant will be able to. design simulate and test custom algorithms in Simulink. implement these algorithms on low cost embedded hardware such as LEGO MINDSTORMS EV3. without writing any C code, see how easy it is to program low cost hardware with Simulink. Getting started, If you are new to MATLAB Simulink or Simulink Support Packages take a look at the following.
introductory material to get started, To learn more about MATLAB and Simulink check out interactive tutorials at. http www mathworks com academia student center tutorials. For the latest information about LEGO MINDSTORMS NXT Support from Simulink see. http www mathworks com hardware support lego mindstorms ev3 simulink html. Supported hardware for project based learning, http www mathworks com academia hardware resources. Simulink and LEGO MINDSTORMS EV3,How to use and work with this manual. I1 Workshop run through options, While working through this manual there are several entry points that you can choose from. To understand manual notation we recommend reviewing intro sections I1 and I2. Depending on your Simulink skills level you might start with example problem P0 1 or with the. first self constructed model P1 2, Reference material for frequently used tasks is listed in Appendices 1 and 2 for your convenience.
Start at the section relevant to your Simulink experience level. Section Focus Level Recommend Experience,Project 0 Introduction to Simulink Beginner None. Project 1 1 1 2 Intro to programming EV3 with Beginner None. Project 1 3 1 4 Designing and implementing Intermediate Simulink. intelligent behavior with Simulink, Project 1 4 Remote control of EV3 from Intermediate Simulink SSP for EV3. Project 2 1 2 2 Designing complex behavior Intermediate Simulink SSP for EV3. knowledge of controls, Project 2 3 Using MATLAB code in Simulink Intermediate Simulink SSP for EV3. models Basic Control Theory, Project 2 4 State based system design with Advanced Simulink SSP for EV3. Simulink Basic State Machines, Optional Project 1 Plant Modeling and Parameter Advanced Physical Modeling.
Optional Project 2 Controller Design and Advanced Feedback controller. Optimization design, Optional Project 3 Event driven System Design Advanced State machines. SSP Simulink Support Package,I2 Notation and formatting. All required information is formatted as standard text on white background. Important information is highlighted with a grey background. Buttons on the brick and in Simulink are displayed as such or bracketed e g OK for the OK. button or Deploy to Hardware, Menu navigation in Simulink is shown as a sequence. e g Tools Run on Target Hardware Prepare to Run, MATLAB code to be run copied is included in the document as below. xlabel Time sec,Simulink and LEGO MINDSTORMS EV3,Project 0 Getting Familiar with Simulink.
Simulink is a block diagram environment for multi domain simulation and Model Based Design It. supports system level design simulation automatic code generation continuous test and verification of. embedded systems Simulink provides a graphical editor customizable block libraries and solvers for. modeling and simulating dynamic systems It is integrated with MATLAB enabling you to incorporate. MATLAB algorithms into models and export simulation results to MATLAB for further analysis. Key Features, Graphical editor for building and managing hierarchical block diagrams. Libraries of predefined blocks for modeling continuous time and discrete time systems. Simulation engine with fixed step and variable step ODE solvers. Scopes and data displays for viewing simulation results. Project and data management tools for managing model files and data. Model analysis tools for refining model architecture and increasing simulation speed. MATLAB Function block for importing MATLAB algorithms into models. Legacy Code Tool for importing C and C code into models. With the help of code generation products like Simulink Coder and Embedded Coder design logic in. Simulink models can also be converted to C code optimized for specific embedded platforms. Simulink Library Browser and Simulink Models, To get started with Simulink launch the Simulink Library Browser Click on the Simulink Library Browser. button on the Home Tab of MATLAB Desktop or type simulink at the MATLAB command prompt. The Simulink Library Browser is a collection of high level blocks. that you can use to create a block diagram representation of. the system you are trying to design From a different. perspective these blocks allow you to access or generate apply. algorithms and visualize or save the processed data or. information which flows through the system,Figure 1 Starting Simulink. Once the Simulink Library Browser launches you will see a. window like Figure 2 below Depending on the products included in the MATLAB installation you will see. some or all of the block libraries In particular we will work with the Simulink Support Package for LEGO. MINDSTORMS EV3 Hardware which is highlighted below Figure 3. Simulink and LEGO MINDSTORMS EV3,Figure 2 Simulink Library Browser. Figure 3 Simulink Support Package for LEGO MINDSTORMS EV3. Simulink and LEGO MINDSTORMS EV3, A Simulink Model Figure 4 represents the high level design of a system or an algorithm You can create.
models by dropping blocks from the Simulink Library After that you can run the simulation or deploy it. to the hardware Figure 4 shows the simulation model of a self balancing Lego robot You can explore. this model from OptPrj2 selfBalancing EV3 Sim Balance Move slx in the workshop folder. Instructions on how to run this model are specified at the end of the Optional Project 2 section page 53. Figure 4 Different parts and simulation of a Simulink model. More on Simulink, If you want to try out some more examples go to Simulink documentation under. MATLAB Desktop Help Product Documentation Simulink Examples. Simulink and LEGO MINDSTORMS EV3, Project 1 Explore Simulink and LEGO MINDSTORMS EV3. P1 1 Get Started Program EV3 Status Light with Simulink. Motivation, At the end of this project you will be able to program an EV3 brick from Simulink. Create first model in Simulink,Check hardware and software installation. Tasks Challenge,Make Green Status Light on the EV3 brick blink.
1 Create a Simulink model like the one in Figure 5. 2 Deploy it to the EV3 brick over Wi Fi, When this Simulink model is deployed to EV3 a constant. input value will be applied to the Status Light which will. controls its color and blinking,Figure 5 Project 1 1 Blink LED. Steps Approach,Create Simulink model,1 Open the Simulink Library Browser. 2 Create a new model and save it as blinkLED slx in the Working directory. 3 Find the blocks listed in the table below,4 Drag and drop them into blinkLED slx window. 5 Double click on a block to open its Block Dialog Box. 6 Replace set block properties in the dialog box as listed in the table below. LIBRARY BLOCK PROPERTY SETTING VALUE,Simulink Sources Constant Constant value 4.
Simulink Support Package,for LEGO MINDSTORMS EV3 Status Light NA NA. Simulink and LEGO MINDSTORMS EV3,Figure 6 Constant Block Parameter. Prepare Model for Deployment to EV3 Brick,Figure 7 Select target hardware. Figure 8 Prepare to run,Figure 9 Set EV3 IP Address. To find the IP Address of the EV3 Brick on the brick go to. a Settings Tab Brick Info IP Address OR, b Setting Tab WiFi Click on the network to which the brick is connected.
Note that the IP Address of the EV3 Brick might change every time it is connected to the network. 10 P a g e,Simulink and LEGO MINDSTORMS EV3,Deploy Simulink Model to EV3 Brick. To deploy the Simulink model to EV3 Brick just click on the. Deploy to Hardware button Figure below shows what it looks. The green status lights should start blinking,Figure 10 Deploy Simulink model to EV3. Next Steps, Use different integer values in the Constant block and see how the Status Lights change color or. For detailed steps on getting started with Simulink Support Package for LEGO EV3 refer to the. following tutorials on MathWorks website,Getting Started with LEGO MINDSTORMS EV3 Hardware. http www mathworks com help legomindstormsev3 examples getting started with. lego mindstorms ev3 hardware html,Communicating with LEGO MINDSTORMS EV3 Hardware.
http www mathworks com help legomindstormsev3 examples communicating with. lego mindstorms ev3 hardware html,11 P a g e,Simulink and LEGO MINDSTORMS EV3. If you are curious, Q1 How do I test Wi Fi connection of my PC with the EV3 Brick See Appendix 2 for more details. A1 To test Wi Fi connection run the following command at the MATLAB Command Prompt with current. IP Address noted from Brick Info,h legoev3 xxx xxx xxx xxx. If an EV3 Brick is found you will get a valid handle H to the EV3 Brick which will allow you to interact with. the Brick programmatically,legoev3 with properties. ipAddress xxx xxx xxx xxx, Q2 What happens when the Deploy to Hardware button is clicked.
A2 Simulink does the following for you, Check algorithm and model integrity connections block settings settings data types etc. Automatically convert model to C code and use appropriate drivers to create connections to. Simulink Simulink is a block diagram environment for multi domain simulation and Model Based Design It supports system level design simulation automatic code generation continuous test and verification of embedded systems Simulink provides a graphical editor customizable block libraries and solvers for modeling and simulating dynamic systems It is integrated with MATLAB enabling

Related Books