BEST Robotic, Inc. MATLAB/Simulink Team Training

Slides:



Advertisements
Similar presentations
Teacher/Mentor Institute Using the Cortex Chuck Powell.
Advertisements

Using the SmartPLS Software
© 2002 QxDesign, Inc. Building a PI controller This unit discusses Installation of Visual ModelQ The Visual ModelQ default model Placing and configuring.
BEST Robotic, Inc. easyC Team Training
Jason Howard. Agenda I. How to download robotc II. What is tele-op used for? III. How to build a basic tele-op program IV. Getting the robot to drive.
Simulink Support for VEX Cortex BEST Robotics 2013 Sandeep Hiremath
© by Pearson Education, Inc. All Rights Reserved.
Chapter 11 Exploring Windows XP Vol. 1 Part One - Windows XP Professional: The Basics.
Administrative Functions Certiport Offline Learning System 2.1 Administrative Functions © Certiport, Inc All Rights Reserved.
LSU 06/04/2007BASIC Stamp Editor1 The BASIC Stamp Editor Programming Unit, Lecture 3.
Software Development. Chapter 3 – Your first Windows 8 app.
Microsoft Visual Basic 2012 CHAPTER TWELVE (ENRICHMENT CHAPTER) Windows Store Apps.
Digital Logic and State Machine Design Installing Xilinx WebPACK 12.4 CS 2204 Digital Hardware.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
LAB 1 MATLAB, dSPACE and Simulink
Office 2013 and Windows 8: Essential Concepts and Skills
Teacher/Mentor Institute Using easyC Joel Kirkland July 30-31, 2015.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
Office 2013 and Windows 8: Essential Concepts and Skills Microsoft Access 2013.
BEST Robotic, Inc. easyC Breakout Session By: Guy Chetrit Programming With easyC September 15, Copyright © 2012 BEST Robotics, Inc. All rights reserved.
Advanced Digital Circuits ECET 146 Week 2 Professor Iskandar Hack ET 221B,
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
1 Simulink Support for VEX Cortex BEST Robotics 2012 Sandeep Hiremath.
Version How to Use Packet Tracer MarinaMD.
 To begin you first need to sign up to Weebly by going to or alternatively and we will create an account.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VII Introduction to SIMULINK Rajeev Madazhy
1 BEST National Conference 2011 Making the Most of BEST Robotics Library for Simulink Greg Young Auburn University Thursday Jul 21, 2011.
Teacher/Mentor Institute Using easyC David Dominguez June 2, 2015 Update Version.
INTRODUCTION TO SIMULINK by Yasmin Hanum Md Thayoob & Aidil Azwin Zainul Abidin.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
File and File Systems Compiled by IITG Team Need to be reorganized and reworded.
Getting started with Simulink
5/14/2003Sprint TekNet IP Train the Trainer1 Open TekNet Software If working at a client station, enter the IP address of the server and mark page as a.
Teacher/Mentor Institute Intro to easyC Programming Scott McEwen July 21-22, 2016.
Pasewark & Pasewark 1 Windows Vista Lesson 1 Windows Vista Basics Microsoft Office 2007: Introductory.
MATLAB The name of MATLAB stands for matrix laboratory. Starting a MATLAB Session -On Microsoft® Windows® platforms, start the MATLAB program by double-clicking.
Fundamentals of Windows Mouse n 4 Basic Operations: –Pointing –Clicking –Double Clicking –Dragging.
General Adult Education and
Introduction to Vexnet
Dive Into® Visual Basic 2010 Express
BEST National Conference 2011
Getting Started with Windows 10
New Perspectives on Microsoft Windows 10
ECEN/MAE 3723 – Systems I MATLAB Lecture 2.
An Introduction to Computers and Visual Basic
Basics for Robotics Programming
Introduction to Computers
Dayton Metro Library Computer Basics September 19, 2018
Office 2010 and Windows 7: Essential Concepts and Skills
Microsoft Windows 2000 Professional
Module 1: Getting Started with Windows 95
Windows xp PART 1 DR.WAFAA SHRIEF.
Windows 7                      .
Microsoft Windows 7 Basics
Simulink Support for VEX Cortex BEST Robotics Sandeep Hiremath
Dayton Metro Library Place photo here Computer Basics December 8, 2018.
Digital Image Processing
Computer Basics.
An Introduction to Computers and Visual Basic
Grauer and Barber Series
Software Setup & Validation
How to create an Itunes account to your computer
Shelly Cashman: Microsoft Word 2016
University of Warith AL-Anbiya’a
MECH 3550 : Simulation & Visualization
University of Warith AL-Anbiya’a
Shelly Cashman: Microsoft Windows 10
Shelly Cashman: Microsoft Windows 10
RapidFinder Analysis Software How-To Guide
Introduction to Programing the Cortex for BEST
Presentation transcript:

BEST Robotic, Inc. MATLAB/Simulink Team Training Programming With MATLAB/Simulink September 10, 2016 BISON BEST

What You’ll Need… Minimum System Requirements Software required Microsoft Windows 7 or Later 32-bit or 64-bit machine Administrator Access on the PC Internet connection Software required MATLAB R2016a free version available at http://www.mathworks.com Go to mathworks.com Search “Best Robotics” On the search List, choose “BEST Robotics” Click “Request Software” If you are not registered at Mathworks, you will be asked to create an account You will get an approval by email in minutes. Installation instructions will be provided in the approval email Associate to your license to your registered account Download and install MATLAB from the link provided (about 40 minutes) Activate the MATLAB September 10th, 2016 Bison BEST 2

Key Software Locations September 10th, 2016 Bison BEST 3

Starting MATLAB Click on the MATLAB r2015b link September 10, 2016 Bison BEST

What You’ll Need… After installing MATLAB, choose Apps -> Get More Apps September 10, 2016 Bison BEST

Copyright © 2010 BEST Robotics, Inc. All rights reserved. September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

After the VEX block opens, choose Get Support Package Choose Apps, then VEX Companion After the VEX block opens, choose Get Support Package (Must be connected to the internet) September 10, 2016 Bison BEST

At the end of installation, it helps to restart MATLAB MathWorks Website opens, Click Get Support Package and follow instructions for installation. At the end of installation, it helps to restart MATLAB September 10, 2016 BISON BEST

Something on MATLAB MATLAB Window Opens: MATLAB means Matrix Laboratory. It is textural programming environment. It can execute commands directly as typed in the command window or run a script code from a saved file Familiarize yourself with the three tabs: HOME, PLOTS, APPS September 10, 2016 Bison BEST

Copyright © 2010 BEST Robotics, Inc. All rights reserved. MATLAB Simulink Simulink is MATLAB’s graphical programming interface. Programming is accomplished by connecting various graphical icons in a specific order. Simulink graphical icons are collected in what are known as Libraries. Simulink programs are known as Models The Simulink Library collection is opened by clicking the Simulink library icon September 19, 2015 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

For BEST Robotics tools Choose Apps from the main menu September 10, 2016 Bison BEST

….Best Robotics tools Choose VEX Companion September 10th, 2016 Bison BEST

Using VEX Support Mathworks VEX support is embedded in Simulink, which is accessed using the following interface September 10, 2016 Bison BEST

Copyright © 2010 BEST Robotics, Inc. All rights reserved. Simulink VEX Library To open Simulink VEX Library, Click Open Library NOTE: The Library window may be hidden far to the right of your screen September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Before Creating your Program You must know what you want to achieve The connection layout of motors and servos to the Cortex controller. The assignment of Joystick keys and their intended control functions. How the joysticks will control the motors and servos Any other interaction between the Cortex controller and the hardware such as sensors September 19, 2015 Bison BEST

The Typical BEST Robot Model The robot can be driven either in Tank or in Arcade mode. The joystick has four analog channels and four digital channels The controller can drive Up to 10 motors and servos in analog mode Up to 4 servos in digital mode Can read up to 8 analog sensors (such as potentiometers) Can read up to 8 digital sensors (such as limit switches) Simulink library has an icon for each of the possible functions: to read the joystick, to drive motors and servos, and to read sensors. Our next example robot will run in arcade driven by two motors; there will be two actuator motors, one with a limit switch and four servos Analog joysticks to motors and digital sticks to servos September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Creating a Simulink Robot Program Open a robot model window by clicking the “Create new model” button on the VEX Support Package Companion menu September 10, 2016 Bison BEST

Copyright © 2010 BEST Robotics, Inc. All rights reserved. The BEST Robot Model September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Copyright © 2010 BEST Robotics, Inc. All rights reserved. Reading the Joystick Signals Accelerometer rotate left limit - 127 The joystick and accelerometer limit return values are +127 and -127 as shown in the figure. The buttons have a return value of 0 when pressed and 1 when released. 12 Digital signals (button) on 4 channels 4 Analog signals on four channels (two joysticks) 2 Accelerometer signals (roll and pitch) + 127 - 127 Accelerometer rotate forward limit + 127 Accelerometer rotate back limit - 127 X Axis Y Axis Accelerometer rotate right limit + 127 September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Copyright © 2010 BEST Robotics, Inc. All rights reserved. September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Start building your robot controller Click and drag one Game pad button and one Game pad joystick from the VEX Library into your untitled model. September 10, 2016 Bison BEST

…robot controller building Make four copies of gamepad joystick and four copies of gamepad buttons September 10, 2016 Bison BEST

Copyright © 2010 BEST Robotics, Inc. All rights reserved. Actuating Motors and Servos September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Copyright © 2010 BEST Robotics, Inc. All rights reserved. Actuator Controls September 19, 2015 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Copyright © 2010 BEST Robotics, Inc. All rights reserved. Add motors and Servos September 19, 2015 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Convenience Libraries September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Contents of the Utilities module September 10, 2016 Bison BEST

Motors Drag the Arcade module into your model. Connect two motors and two analog joysticks as Drag the two digital inputs (to serve as limit switches) and one Limit switch control block in the model. Connect the motor, limit switch and joystick September 10, 2016 Bison BEST

Copyright © 2010 BEST Robotics, Inc. All rights reserved. … Finish the connection September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Copyright © 2010 BEST Robotics, Inc. All rights reserved. Set the joystick channels Double click on each joystick and set its channel: Valid channels are from 1 to 4 September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Copyright © 2010 BEST Robotics, Inc. All rights reserved. Set the digital button channels Double click on each digital button and set its channel and the button: Valid channels are from 5 to 8, valid buttons are UP and DOWN September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Set channel for Digital Input Limit Switches Double click on each digital limit switch and set its channel: Valid channels are from 1 to 12 September 10, 2016 Bison BEST

Set motor and servo channels Double click on each motor and each servo and setting their channels: Valid channels are from 1 to 10 Leave gear ratio at 1/13.5 September 10, 2016 Bison BEST

Working with Digital Buttons Motors and servos require inputs of from -127 to +127 to run in either direction at full speed, full range. Analog joysticks spits numbers from -127 to +127, so can drive motors and servos as required. At this time joysticks are ready to run Digital buttons spits only two numbers, 0 and 1, therefore it cannot drive motors and servos. If the output is multiplied by 127, then it can drive the motor full speed on one direction or open servo full range one direction. The direction can be reversed by multiplying by output by -127. No way to drive the motor or servo in both directions September 10, 2016 Bison BEST

Multiplication by 127 The Math Library has a Gain icon You can place the gain between the digital button and the servo Double click on it and set the gain to 127 September 10, 2016 Bison BEST

Minimize the Vex Library, click MATLAB’s Home Tab and Open the Simulink Library September 10, 2016 Bison BEST

Conditioning the digital command Open Ports & Subsystems Library, and click and drag “Subsystems” into your model. September 10, 2016 Bison BEST

Conditioning the digital signal Double click on that subsystem box Click on the line that joins In1 and Out1, and delete it September 10, 2016 Bison BEST

Conditioning the digital signal Make a copy of In1 so you have two inputs In Simulink Library again choose the Stateflow Library, click and drag the Chart into your subsystem September 10, 2016 Bison BEST

Conditioning the digital signal Double click on the Chart to pen the chart editor September 10, 2016 Bison BEST

Click and drag three states; label the first as UP_KEY, the second as NO_KEY and the third as DOWN_KEY Put the mouse pointer at the left edge of the NO-KEY icon, press the left Key (of the mouse), and move the mouse pointer( while the key is still pressed) towards the UP-KEY icon. This draws an arrow from the NO_KEY state to the UP_KEY state. September 10, 2016 Bison BEST

[UP==1&&OUT<127]{OUT=OUT+127;} Put the mouse pointer at the left edge of the NO-KEY icon, press the left Key (of the mouse), and move the mouse pointer( while the key is still pressed) towards the UP-KEY icon. This draws an arrow from the NO_KEY state to the UP_KEY state. Point and click at the leftmost part of the arrow to move the question mark there. Fill the question mark with the following command: [UP==1&&OUT<127]{OUT=OUT+127;} September 10, 2016 Bison BEST

[DOWN==1&&OUT>-127]{OUT=OUT-127;} Repeat the process using the following equations From UP_KEY to NO_KEY [UP==0] From NO_KEY to DOWN_KEY [DOWN==1&&OUT>-127]{OUT=OUT-127;} From DOWN_KEY to NO_KEY [DOWN==0] September 10, 2016

Now add the default setting with {OUT=0;} September 20th, 2014 Bison BEST

Choose Tools -> Model Explorer Choose chart Filter: States/Functions… Transitions… Data … September 10, 2016 Bison BEST

Add Data September 10, 2016 Bison BEST

Assign created data to functions Change View to Stateflow, For the first data change scope to Output and Name to OUT (case sensitive). Click Apply September 10, 2016 Bison BEST

For the second and third elements, change Scope to Input; Name them UP and DOWN September 10, 2016 Bison BEST

Drag the Gain icon and make as many copies as the digital joysticks that you have September 10, 2016 Bison BEST

Close the Model explorer, (File->Close) Rename the nodes as follows (case sensitive): In1 becomes UP In2 becomes DOWN Out1 becomes OUT September 20th, 2014 Bison BEST

Complete the connections Click the Back Arrow September 10, 2016 Bison BEST

Finish Two buttons will now control one servor in both directions, so we remove one servo or we add another button September 10, 2016 Bison BEST

Copyright © 2010 BEST Robotics, Inc. All rights reserved. After Building the Model Save the simulink model file You may want to Simulate the model before downloading into your Vex Controller. Open the utilities block again (if it is closed) Pay attention to the Simulation Input, and the Simulation Output collections September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Copyright © 2010 BEST Robotics, Inc. All rights reserved. September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Copyright © 2010 BEST Robotics, Inc. All rights reserved. Simulating the Arcade Pull a variable input, a the field simulator and a toggle. Make as mane copies as necessary Connect the variable inputs to the inputs of the joysticks Connect the toggles to the inputs of the joysticks Connect the field simulator to the two drive motors September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Copyright © 2010 BEST Robotics, Inc. All rights reserved. Simulation Control August 1, 2010 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Copyright © 2010 BEST Robotics, Inc. All rights reserved. After Simulation Remove all simulation signals and Simulation inputs on all joysticks and digital buttons and inputs. Double click and uncheck “Add Input Port for Simulation” Do the same to remove simulation outputs from motors and servos Save your model file September 10, 2016 Copyright © 2010 BEST Robotics, Inc. All rights reserved.

Upload program into VEX controller and run Deploy to Hardware September 10th, 2016 Bison BEST

Additional support http://www.mathworks.com/academia/student-competitions/best-robotics/ September 10th, 2016 Bison BEST