Rochester Institute of Technology Real Time and Embedded Systems: Project 2a

Similar documents
EE 314 Spring 2003 Microprocessor Systems

Arduino Control of Tetrix Prizm Robotics. Motors and Servos Introduction to Robotics and Engineering Marist School

UART2PPM. User s Guide. Version 2.04 dated 02/20/16. Gregor Schlechtriem

J. La Favre Controlling Servos with Raspberry Pi November 27, 2017

Grundlagen Microcontroller Counter/Timer. Günther Gridling Bettina Weiss

LeCroy UWBSpekChek WiMedia Compliance Test Suite User Guide. Introduction

Lock Cracker S. Lust, E. Skjel, R. LeBlanc, C. Kim

Veyron Servo Driver (24 Channel) (SKU:DRI0029)

Laboratory set-up for Real-Time study of Electric Drives with Integrated Interfaces for Test and Measurement

Exercise 5: PWM and Control Theory

J. La Favre Using Arduino with Raspberry Pi February 7, 2018

Electronics Merit Badge Kit Theory of Operation

Project Proposal. Underwater Fish 02/16/2007 Nathan Smith,

Computer Aided Manufacturing

Web-Enabled Speaker and Equalizer Final Project Report December 9, 2016 E155 Josh Lam and Tommy Berrueta

Copley ASCII Interface Programmer s Guide

Montgomery Village Arduino Meetup Dec 10, 2016

Arduino Platform Capabilities in Multitasking. environment.

Cost efficient design Operates in full sunlight Low power consumption Wide field of view Small footprint Simple serial connectivity Long Range

5096 FIRMWARE ENHANCEMENTS

The Allen-Bradley Servo Interface Module (Cat. No SF1) when used with the Micro Controller (Cat. No UC1) can control single axis

WSPR VCXO Controller

ENGR 1110: Introduction to Engineering Lab 7 Pulse Width Modulation (PWM)

About the DSR Dropout, Surge, Ripple Simulator and AC/DC Voltage Source

CprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones

Intelligent Systems Design in a Non Engineering Curriculum. Embedded Systems Without Major Hardware Engineering

User's Manual. ServoCenter 4.1. Volume 2: Protocol Reference. Yost Engineering, Inc. 630 Second Street Portsmouth, Ohio

Using the Z8 Encore! XP Timer

Jaguar Motor Controller (Stellaris Brushed DC Motor Control Module with CAN)

SRVODRV REV7 INSTALLATION NOTES

HB-25 Motor Controller (#29144)

Four Quadrant Speed Control of DC Motor with the Help of AT89S52 Microcontroller

Servo Indexer Reference Guide

Chapter 2: Your Boe-Bot's Servo Motors

Experiment 4.B. Position Control. ECEN 2270 Electronics Design Laboratory 1

Built-in soft-start feature. Up-Slope and Down-Slope. Power-Up safe start feature. Motor will only start if pulse of 1.5ms is detected.

Boe-Bot robot manual

ASCII Programmer s Guide

Lab 3: Embedded Systems

In this lab, you ll build and program a meter that measures voltage, current, power, and energy at DC and AC.

Pic-Convert Board Instructions

Using Z8 Encore! XP MCU for RMS Calculation

Generating DTMF Tones Using Z8 Encore! MCU

Project Final Report: Directional Remote Control

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

Cost efficient design Operates in full sunlight Low power consumption Wide field of view Small footprint Simple serial connectivity Long Range

Stensat Transmitter Module

Part (A) Using the Potentiometer and the ADC* Part (B) LEDs and Stepper Motors with Interrupts* Part (D) Breadboard PIC Running a Stepper Motor

Experiment #3: Micro-controlled Movement

µchameleon 2 User s Manual

User Manual Solenoid Controller BI-SC1001

PAK-Vb/c PWM Coprocessor Data Sheet by AWC

Ultrasonic Positioning System EDA385 Embedded Systems Design Advanced Course

Jet Central Sequencer Plus

ECE251: Tuesday October 3 0

Understanding the Arduino to LabVIEW Interface

Hello, and welcome to this presentation of the FlexTimer or FTM module for Kinetis K series MCUs. In this session, you ll learn about the FTM, its

In this activity, you will program the BASIC Stamp to control the rotation of each of the Parallax pre-modified servos on the Boe-Bot.

LM8322 Mobile I/O Companion Supporting Key-Scan, I/O Expansion, PWM, and ACCESS.bus Host Interface

Greater Resolution for the QED s 8-bit DAC

Standard single-purpose processors: Peripherals

the Multifunctional DCC decoder for servo s and accessory s with Arduino for everybody (with a DCC central station)

Pololu TReX Jr Firmware Version 1.2: Configuration Parameter Documentation

arxiv:physics/ v1 [physics.ed-ph] 19 Oct 2004

Hello, and welcome to this presentation of the STM32L4 comparators. It covers the main features of the ultra-lowpower comparators and some

DC Brushed Motor Controller Module EDP-AM-MC1

Sensors and Sensing Motors, Encoders and Motor Control

BEYOND TOYS. Wireless sensor extension pack. Tom Frissen s

LC-10 Chipless TagReader v 2.0 August 2006

Servo Tuning Tutorial

ECE 511: FINAL PROJECT REPORT GROUP 7 MSP430 TANK

Programming and Interfacing

TX4400 UHF CB RADIO INSTRUCTION MANUAL TX4400 INSTRUCTION MANUAL PAGE 1

RC SERVO EXAMPLE WITH BAE0910

Antenna Switch Box. Update, Feb 2012

MICROPROCESSORS A (17.383) Fall Lecture Outline

Design of stepper motor position control system based on DSP. Guan Fang Liu a, Hua Wei Li b

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE

Motion Controller MELSEC System Q

Counter/Timers in the Mega8

UM DALI getting started guide. Document information

Measuring Distance Using Sound

Microcontrollers: Lecture 3 Interrupts, Timers. Michele Magno

General Purpose Controller Software for Controls Lab

the Board of Education

Adafruit 16 Channel Servo Driver with Raspberry Pi

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 11 Motor Control

Embedded Test System. Design and Implementation of Digital to Analog Converter. TEAM BIG HERO 3 John Sopczynski Karim Shik-Khahil Yanzhe Zhao

Hello, and welcome to this presentation of the STM32 Infrared Timer. Features of this interface allowing the generation of various IR remote control

ANLAN203. KSZ84xx GPIO Pin Output Functionality. Introduction. Overview of GPIO and TOU

Castle Creations, INC.

AN4507 Application note

Brushless 5 click. PID: MIKROE 3032 Weight: 25 g

Freescale Semiconductor, I

AC : PERSONAL LAB HARDWARE: A SINE WAVE GENERATOR, LOGIC PULSE SIGNAL, AND PROGRAMMABLE SYNCHRONOUS SERIAL INTERFACE FOR ENHANCING EDUCATION

Training Schedule. Robotic System Design using Arduino Platform

Freescale Semiconductor, I

Utilizing the Trigger Routing Unit for System Level Synchronization

Input/Output Control Using Interrupt Service Routines to Establish a Time base

User Manual Version 1.0

Transcription:

Rochester Institute of Technology Real Time and Embedded Systems: Project 2a Overview: Design and implement a STM32 Discovery board program exhibiting multitasking characteristics in simultaneously controlling a pair of servo motors using a custom interpreted control language. The system will be responsive to simultaneous independent, externally provided commands. The servo positions are controlled with pulse-width modulation (PWM). This first portion of the project utilizes the STM32 Discovery board. Each servo will be controlled by its own recipe of commands in the custom interpreted control language. Servo and PWM Overview: The servos can be positioned to any of six positions (0, 1, 2, 3, 4, 5) approximately evenly spaced along the servos potential 160 degree arc. Position 0 is at the extreme clockwise position, and Position 5 is at the extreme counterclockwise position. Typical Futaba position control servos require a PWM control signal with a 20 millisecond period. The duty cycle of this PWM signal controls the servo through its range of positions. The typical duty cycle ranges from 2% to over 10% for full range of positions. Pulse widths from 0.4 milliseconds to 2.0 milliseconds are a typical range.

Connecting the Futaba Servo: These servos require 5 volts with sufficient current to move the motor. Use the 5 volt power adapter in the kit. Be sure to connect all grounds! On the servo the black line is the ground, the red line is the +5 volts, and the white line is the PWM input line. Connect this PWM line to your selected GPIO output pin on the STM32. Mandatory Demo of PWM Signal: Before you will be allowed to connect to a servo motor you MUST demonstrate that your code produces a valid PWM signal. You will demonstrate this using an oscilloscope. If you fail to do this step and burn out a servo motor you are responsible for its replacement cost. Command Language: As memory space on microcontrollers is often at a premium, each of the recipe commands are encoded into one byte. These recipes are typically implemented as an array of byte values. A master timer generates interrupts every 100 milliseconds, serving as the time basis the wait commands below. Since we are running on in a bare metal environment you do not have to use a timer interrupt. You can simply wait at the bottom of your control loop for the remainder of the 100 milliseconds. Design Recommendation: Create a non-blocking infinite loop that executes one loop every 100 milliseconds. This loop checks for a keyboard input and accumulates command lines, processes state changes for servo 1 (if any), processes state changes for servo 2 (if any), and then waits the remainder of the 100 milliseconds. This is a simple type of scheduling algorithm that ensures that all tasks are completed within the required amount of time.

Command Format: Recipe Commands: command opcode command parameter 3 bits wide 5 bits wide Mnemonic Opcode Parameter Range Comments MOV 001 The target position 0..5 An out of range number parameter value WAIT 010 The number of 1/10 seconds to delay before attempting to execute next recipe command LOOP 100 The number of additional times to execute the following recipe block produces an error. * 0..31 The actual delay will be 1/10 second more than the parameter value.. ** 0..31 A parameter value of n will execute the block once but will repeat it n more times. *** END_LOOP 101 Not applicable Marks the end of a recipe loop block. RECIPE_END 000 Not applicable (Other opcodes such as 011, 110 and 111 are illegal, and if encountered at run time, transition the task into an error state.) *An out-of-range parameter causes the task to enter an error state. The error state inhibits the operation of the Continue override command (see below), but all other overrides remain functional. ** The parsing of a wait command (as all other commands) takes a full system clock cycle (e.g. 1/10 second) to execute. Thus a wait + 0 skips 1/10 of a second before execution of the next command, a wait+1 would takes 2/10 seconds, etc. *** Nested loops are not permissible and places the task in an error state See recipe_ideas.c for some example code. Status: Use the red and green LEDs as described below to indicate the status. Display these status indications for just the first servo: Recipe Running (only green on) Recipe Paused (all off) Recipe Command Error (red on) Recipe Nested Loop Error (red and green both on)

User Commands: The User commands are entered via the system console keyboard. Each set of overrides are entered as a pair of characters followed by a <CR>. The first character represents the command for the first servo, the second for the second servo. Each character entered will be echoed to the console screen as entered. The <CR> will initiate the simultaneous execution of the overrides by each motor and generate a <LF> followed by the override prompt character > on the beginning of the next line. Note that if either X or x is entered before the <CR>, the entire override command is cancelled and the > override prompt character is written on the beginning of a new line on the system console. See below for an example. User Command Details: Command Mnemonic Comments Pause Recipe execution P or p Not operative after recipe end or error Continue Recipe execution C or c Not operative after recipe end or error Move 1 position to the right if possible R or r Not operative if recipe isn t paused or at extreme right position Move 1 position to the left if possible L or l Not operative if recipe isn t paused or at extreme left position No-op no new override entered N or n for selected servo Begin or Restart the recipe B or b Starts the recipe s execution immediately Example override commands: Pc <CR> Pause the recipe on Servo 1 and continue (resume) the recipe on Servo 2. Rn <CR> Move Servo 1 to the right one position (if possible), no op of Server 2. Bb <CR> Restart Servo 1 s recipe and Servo 2 s recipes. As servo motors take time to reach a new position, the programs will need to introduce a delay in fetching and executing the next recipe command after a mov command. The delay will need to be adjusted depending upon how far the new position is from the current position. A starting estimate of the necessary added delays to reach a new position is approximately 200 milliseconds per position. For safety, your program s execution should begin with tasks in the paused state. The startup sequence should include appropriate initialization of the task values. Include a robust pair of demo recipes (a different one for each servo to demonstrate multitasking.)

The following test recipe snippets must be included in your demo: MOV+0 MOV+5 MOV+0 MOV+3 LOOP+0 MOV+1 MOV+4 END_LOOP MOV+0 MOV+2 WAIT+0 MOV+3 WAIT+0. MOV+2 MOV+3 WAIT+31 WAIT+31 WAIT+31 MOV+4 ; There must NOT be intervening instructions in this group to allow ; verification of default time delay. ;Test the default loop behavior. ; Move to an adjacent position to verify ; Measure the timing precision of the 9.3 second delay with an external ; timer. Additional test recipes: Include a recipe to verify the moves to all possible positions. Include a recipe to end normally (i.e. with an RECIPE_END command, followed and by a MOV command to a position different from the previous MOV destination. This allows verification of the CONTINUE override. Include a recipe with a deliberate error near the end of a task s demo recipe, then follow the erroneous command with a MOV command to a new position. Graduate Student extensions: There are three unused recipe opcodes in the command descriptions above. Design one additional command and use one of the unused opcodes. Your report must document its operation, the limiting factors and parameters, etc. Add a new user command if appropriate. The new opcode must be included in the demo recipes to clearly demonstrate this new command s capabilities and limitations. NOTE Graduate students are responsible for all undergraduate components as well as this graduate student extension work. Due Date: Please refer to the course schedule for the due date. An in-class demo will be required. Please submit your source code and your report (in either PDF or Word compatible format) to the corresponding mycourses drop box.

Grading Criteria: Program Operation and Demo 50% o Hardware setup is orderly and well organized 10% o Demo sheet functions all completed 30% o Demo operates without faults or restarts 10% Program Design - 15% o Proper initialization o Correct use of functions (no copy/paste/edit slightly) o Separation of hardware related code from pure software (e.g. the results reporting code) Source Code Structure and Readability 10% o Appropriate use of white space 2% o Consistent and good indentation 2% o Appropriate comments at the function and paragraph levels (such as a for loop) 2% o Following C style guide (good names, etc.) Report Content 25% o Report is at least 2 pages (not counting pictures, cover page, diagrams) 5% o Demonstrates team understands the problem, solution, and technology (hardware and software) 10% o Report contains all required sections per the report guidelines 10%