How to program a Zumo Robot with Simulink



Similar documents
Set up and Blink - Simulink with Arduino

Work with Arduino Hardware

Step by Step. Use the Cloud Login Website

INTRODUCTION TO SERIAL ARM

Adafruit's Raspberry Pi Lesson 5. Using a Console Cable

Setting up a Local Interconnect Network (LIN) using dspace MicroAutoBox 1401/1501 Simulink Blocks

How to use SURA in three simple steps:

A REST API for Arduino & the CC3000 WiFi Chip

KeePass Getting Started on Windows

EE289 Lab Fall LAB 4. Ambient Noise Reduction. 1 Introduction. 2 Simulation in Matlab Simulink

Firmware & Software update procedures Amicroe TouchTAB IV.

How to download your NI Press ebook for Nook Users

Drobo How-To Guide. Topics. What You Will Need. Using Drobo and Backblaze for Simple Online Backup

Tutorial for Programming the LEGO MINDSTORMS NXT

Installing the Gerber P2C Plotter USB Driver

How To Configure CU*BASE Encryption

Introduction to Simulink

Contents Models 3500 / 3600 Software & Driver Installation... 1 Install Amplifier Control Panel... 2 Download and Install the Drivers...

Additional Guides. TETRIX Getting Started Guide NXT Brick Guide

Installing the VPN Client for Microsoft Windows OS

Analog Devices Welcomes Hittite Microwave Corporation NO CONTENT ON THE ATTACHED DOCUMENT HAS CHANGED

EE 402 RECITATION #13 REPORT

FAQs. OneDrive for Business?

Remote Desktop Web Access. Using Remote Desktop Web Access

Instructions for Installing and Using the FOCUS DL-15 Data Transfer Software

Microsoft SharePoint 2010 End User Quick Reference Card

Plena Voice Alarm System Firmware update

Initial Setup of Microsoft Outlook 2011 with IMAP for OS X Lion

Census. di Monitoring Installation User s Guide

Quick Start Using DASYLab with your Measurement Computing USB device

FAQs. OneDrive for Business?

Tutorial for Creating a DEBA Lawyer Directory Listing

Xilinx ISE. <Release Version: 10.1i> Tutorial. Department of Electrical and Computer Engineering State University of New York New Paltz

How To Program An Nxt Mindstorms On A Computer Or Tablet Computer

Guide to Using Citrix at SLU (Windows)

How to Install Applications (APK Files) on Your Android Phone

JBoss Portal 2.4. Quickstart User Guide

Virtual Office Remote Installation Guide

Adafruit's Raspberry Pi Lesson 5. Using a Console Cable

Installing S500 Power Monitor Software and LabVIEW Run-time Engine

Operate Backup Data. This how-to document will walk you through how to acquire and view your (M)SDS collection from the backup we send you.

Lizard Standalone Mode Guide Version 1.0:

Welcome! Want to find out more? Follow this tutorial, then launch Part 1 to get started.

Guidance for IA DMM: Connecting Your Computer to FSU Video File Server

Arduino Lesson 1. Blink

Schools Remote Access Server

Arduino Lesson 13. DC Motors. Created by Simon Monk

Computer Basics Handouts: Computer Basics

itunes Song Library and/or Music CD Conversion Software Installation & Operational Instructions

Voice over IP. Orator Dictation Voice-over-IP Quick Start Installation Guide

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

ANYWHERE POLLING - POLLING WITH A QUESTION LIST

Office of elearning & Innovation

ParishSOFT Remote Installation

Using SMIGRATE to Backup, Restore and Migrate Team Sites in SharePoint Products and Technologies 2003

A Teacher s Guide to Updating Multiple TI-Nspire. Handhelds

Introduction: The Xcode templates are not available in Cordova or above, so we'll use the previous version, for this recipe.

Section 5: Connecting the Laser to Your Computer

Remote Viewer Recording Backup

Introduction to RefWorks

E-Loader Operation Manual

JAVS Scheduled Publishing. Installation/Configuration... 4 Manual Operation... 6 Automating Scheduled Publishing... 7 Windows XP... 7 Windows 7...

MOODLE Installation on Windows Platform

LP 2844 Thermal Printer

A Step-by-Step Patient Guide to Upload Medical Images to the Cleveland Clinic Neurological Institute

Tutorial: Packaging your server build

NEW IR DATA WAREHOUSE

How to deploy fonts using Configuration Manager 2012 R2

Beginner s Matlab Tutorial

Multi-Touch Control Wheel Software Development Kit User s Guide

WA1826 Designing Cloud Computing Solutions. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

Path Tracking for a Miniature Robot

Media Control Server MCS-EX Integration Guide for RTI Control Systems

All About Arduino Libraries

ClickView Digital Signage User Manual

MiraCosta College now offers two ways to access your student virtual desktop.

Guide to Installing BBL Crystal MIND on Windows 7

User Guide. Introduction to 3M Digital Designs. User Guide Contents: Installing 3M Digital Designs Software. Setting up a Plotter

A Guide to the Tufts Network School of Arts and Sciences School of Engineering Fletcher School of Law and Diplomacy

How to use Matlab on the Virtual Labs

VIDEO SCRIPT: Data Management

NI InsightCM Server Version 1.0

Introduction to Android Development

Initial Setup of Microsoft Outlook with Google Apps Sync for Windows 7. Initial Setup of Microsoft Outlook with Google Apps Sync for Windows 7

Waspmote IDE. User Guide

Using Drobo for On-site and Off-site Backup with CrashPlan

Introduction. Chapter 1

DS1307 Real Time Clock Breakout Board Kit

Technote 20 Using MSIE to FTP into an AcquiSuite

USB Driver Installation for Windows XP

Arduino Lesson 0. Getting Started

RuleBender Tutorial

Download and Installation Instructions. Android SDK and Android Development Tools (ADT)

LBNL WINDOW 6 AND OPTICS 6 PROCEDURES TO COMPUTE THE SOLAR / OPTICAL PERFORMANCE OF NEW PRODUCTS AND LAMINATED GLASS

SecureClient Central Installation Guide. September 2014

Business Intelligence Office of Planning Planning and Statistics Portal Overview

Connecting a Metrologic MS9535 to a USB BT Adapter (Client Mode)

Transcription:

How to program a Zumo Robot with Simulink Created by Anuja Apte Last updated on 2015-03-13 11:15:06 AM EDT

Guide Contents Guide Contents Overview Hardware Software List of Software components: Simulink Model Generate code, load and run 2 3 4 6 6 10 16 Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 2 of 17

Overview This tutorial covers how to use Simulink to program a Zumo Robot powered by an Arduino Uno. This guide will walk you through the steps to move a Zumo Robot along a specific trajectory. Here are the specific steps to get there: 1. Install Simulink Support package (http://adafru.it/drt) for Arduino 2. Download the Zumo Robot Library (http://adafru.it/dru) for Simulink 3. Create a Simulink Model move the Zumo Robot 4. Build and download the model to see the robot in action The tutorial is a second in a series on using Arduino with Simulink. For a quick introduction to Simulink, refer to Set up and Blink - Simulink with Arduino (http://adafru.it/drv) tutorial. While this tutorial uses the Zumo Robot,a similar Simulink model and the same workflow can be used to control any robot that uses a Simulink supported Arduino board Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 3 of 17

Hardware 1) Assembled Zumo Robot Kit The assembled Zumo Robot Kit serves as a shield for the Arduino Uno R3 and also includes the chassis for the Zumo Robot. To use the Zumo, you can simply add a programmed Arduino Uno and attach 4 AA batteries and you are all set! 2) Arduino Uno R3 The Arduino Uno R3 serves as the brains of the Zumo Robot and is not included as a part of the assembled kit. In the tutorial, we will program the Arduino Uno using Simulink and then add it to the Zumo Robot. 3) USB Cable The cable will be used to connect an Arduino Uno to a computer running Simulink 4) 4 AA Batteries Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 4 of 17

Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 5 of 17

Software List of Software components: 1. MATLAB and Simulink (R2014a) Buy the Student version for $99 (http://adafru.it/drw) Buy a Home-use license for $194 (http://adafru.it/drx) See commercial and other licensing options (http://adafru.it/dry) 2. Simulink Support Package for Arduino (http://adafru.it/drz) Follow this tutorial to complete installation: Set up and blink - Simulink with Arduino (http://adafru.it/ei0) 3. ZumoBot Simulink Library (http://adafru.it/dru) The Zumobot Simulink Library is a collection of blocks used to interface specifically with different components of the Zumo Robot. Download this library from MATLAB Central File Exchange. Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 6 of 17

To install the library: Unzip the downloaded file to your working directory. Open MATLAB, and navigate to the directory named 'zumo_library' in the unzipped folder. Install the library by typing install_zumobotlib in the MATLAB command window If you face any issues related to installation, refer to the text file 'README.txt' for instructions related to installation. Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 7 of 17

To verify successful installation of the ZumoBot Simulink Library, Click on the Simulink Library Icon on the MATLAB Toolstrip to launch the Simulink Library Browser In the Library Browser window, check if ZumoBotLib is included in the list on the left. Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 8 of 17

Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 9 of 17

Simulink Model Now that we have the software environment set up, the next step is to create a model for the system. The curved trajectory along which the Zumo Robot moves can be defined by the angle 'omega' at which the Zumo Robot is turning at an instant and the velocity 'v' at which the robot is moving forward. Using simple kinematic equations, the mathematical relation is given by the following equations: The ZumoBot simulation library includes an example Simulink model for this tutorial. To open the example model navigate to the 'examples' folder, and type Motors in the MATLAB command window. Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 10 of 17

The model accepts velocity 'v' and turning angle 'omega' as inputs and using the subsystem named 'motor command conversion' converts the two inputs into left and right wheel velocities. A subsystem is a collection of Simulink blocks and is a neat way to organize blocks for complex models. It is the block diagram equivalent of writing functions for your code. The 'model command conversion' subsystem implements the math we just saw above in Simulink. To look at the implementation, double click on the subsystem block. Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 11 of 17

The first block named 'change parameters' performs the matrix multiplication operation we saw in the equations above. To look at the block properties, double click on the block. The second block named 'symmetrize motors' accounts for the fact that not all motors are identical. This block multiplies the one of the wheel velocities with a scaling factor called 'symmetrizemotors' which can be tuned depending on the differences between the motors. Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 12 of 17

Up till this point, we were dealing with real world units, however the Zumo Robot understands commands in integer values ranging from -256 to 255 for motor control. The third block named 'change units' performs this conversion. The parameters axlelength, symmetrizemotors, and commandpercmpersecond are all model Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 13 of 17

parameters and can differ slightly from Zumo Robot to Zumo Robot. Thus even though the model currently has some default values, these can be tuned to fit your specific needs. These parameters can be modified through the model workspace which can be accessed through the button highlighted below. The outputs of the motor command conversion subsystem which are the left and right wheel velocities are fed to the 'ZumoMotors' block. The 'ZumoMotors' block represents the motors on the assembled Zumo Robot. Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 14 of 17

Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 15 of 17

Generate code, load and run Now that we have understood the model, let us download it to the robot and see it in action. Open the Motors model from the examples directory that came with the ZumoBot library. To start off, use the default values in the model for velocity 'v' (20 cm/s) and angle of turn 'omega' (0.1 rad/s). To build and download the model on the ZumoBot, click on the Deploy on hardware button in the right top corner of the model. Read the messages at the bottom status bar of the model to confirm that the model is successfully downloaded to the target. See the robot moving in the input trajectory. In this case, the radius of curvature is quite large, and for short distances, the Zumo Robot almost appears to move in a straight line. Now let us modify the input velocity 'v' to 10 cm/s and 'omega' to 1.5 rad/s. Note that you can change the value of 'v' and 'omega' by double clicking on the respective blocks and modifying the constant value parameter. Generate and download the code for the modified model into the Arduino once again. Adafruit Industries https://learn.adafruit.com/zumo-robot-control-with-simulink Page 16 of 17

In this situation the radius of curvature is comparatively smaller, and the Zumo Robot appears to constantly make a sharp turn. Adafruit Industries Last Updated: 2015-03-13 11:15:07 AM EDT Page 17 of 17