610 likes | 735 Views
Using Your BRAIN (For Beginners) Teacher-Mentor Workshop July 18-19, 2008 Auburn University. Introduction. New programmable robot controller (BRAIN) 100% roll-out to all hubs in 2008 Current Cost: $100 per BRAIN (includes cables, software, etc) Expected delivery in July time-frame.
E N D
Using Your BRAIN (For Beginners) Teacher-Mentor Workshop July 18-19, 2008 Auburn University
Introduction • New programmable robot controller (BRAIN) • 100% roll-out to all hubs in 2008 • Current Cost: $100 per BRAIN (includes cables, software, etc) • Expected delivery in July time-frame. • Existing tether boxes can be used. • 2007 BRAINS can be used. • Functionally equivalent to 2008 BRAINS • Improvements • Low Battery voltage impact enhancement • Tether noise suppression • Additional LED indicators installed
Who should take this Class? • Hub Directors, Mentors and Teachers who will “Train the Trainers” in their respective Hubs. • Should be limited to the individuals from those Hubs who have not had experience with the BRAIN or DSP controllers. • Programming instruction will be limited to the BRAIN Wizard
Objectives of this Class • Train team personnel how to: • Setup their computers • Program their BRAINs using the BRAIN Wizard • Design a robot control system using the BRAIN • Identify support material to be available to the Hubs and to the Teams and where the current version may be located.
Content of this Basic Class • Section 1: Hardware Overview • Section 2: The Programming Environment • Section 3: Programming Using the BRAIN Wizard • Section 4: Hub Specific Information • Section 5: Training Your Teams • Section 6: BRAIN Support & Feedback • Section 7: Wizard Programming Demonstration
BEST Robotics Advanced Instruction Node Basic BRAIN Training Section 1 - Hardware Overview
BRAIN Overview • Dual 16-bit microcontroller architecture (TI MSP430) • Easy program download via USB interface • Electronics protected by removable cover • Replaceable connectors
BRAIN Features • Interface with standard Futaba radio • PWM input from receiver • Dedicated “trainer” cable interface for tethered operation • 4 proportional motor control outputs • 6 servo motor outputs • 8 discrete digital inputs • USB port for program download • Onboard power switch and replaceable fuse • Powered by a single 7.2 volt RC hobby battery
BRAIN Hardware Connections G = Ground for digital input and battery power B = Battery power (passed through fuse)
Example Hookup Receiver Box Servos DC Motors Battery
Motor Limits Transmitter Channel Servo Output Motor Output Positive Direction Negative Direction Channel 1 Servo 1 Motor 1 Digital 1 Digital 2 Channel 2 Servo 2 Motor 2 Digital 3 Digital 4 Channel 3 Servo 3, 5 Motor 3 Digital 5 Digital 6 Channel 4 Servo 4, 6 Motor 4 Digital 7 Digital 8 Out of the Box Configuration • All channels active as both servo output and proportional speed control motor output.
Out of the Box Configuration • Allows a team to hook up the BRAIN any way they wish and have it work without ever having to program the BRAIN. • Referred to as the “default” project – described later. • This is NOT the only configuration for the BRAIN! • Good for initial checkout, but we want teams to load a unique configuration.
BEST Robotics Advanced Instruction Node Basic BRAIN Training Section 2 - Programming Environment
What You Need… • Minimum System Requirements • PC only, Mac not supported by BEST • 1 USB port available for BRAIN programming • Windows NT, XP, VISTA • Software & Installation • Software provided on CD or via download from http://www.besting.org, 2008 Official Documents • BRAIN installer auto-runs from CD
What is on the BRAIN CD? • FTDI Driver: to access BRAIN via USB • IAR Embedded Workbench – Kickstart • C programming environment • BRAIN Tools • Utility functions for downloading to BRAIN • Provides the hardware interface library • Projects and source code to use with Wizard • BEST Wizard • Integrated tool to generate BRAIN program • Modified to remove rule-imposed limits for 2008.
IAR Software Installation • The BRAIN Support installer performs multiple functions on the target system (PC) to provide all the software support needed to use the BRAIN hardware. The installer loads to your PC: 1. Sample software projects 2. A BRAIN software library 3. A utility to download code to the BRAIN (BSLUSB) 4. A Wizard program 5. USB drivers for communication with the BRAIN (FTDI’s CDM driver) 6. IAR Workbench, Kickstart edition • Because the BRAIN installer includes a driver for the USB interface, you must install the software prior to connecting the BRAIN hardware to a USB port.
Key Software Locations • Start Program Menu item is added for IAR Embedded Workbench (under the IAR Systems Group) • Within IAR Workbench, under the “Tools” menu • BRAIN Wizard • Boot Load via USB • IAR Workbench Projects are added under “My Documents\Best\Brain Projects” • Wizard Project – for use with Wizard • Default Project – runs all motors, all servos
IAR Workbench Setup Initial BRAIN Support Installer dialog box
Initial IAR setup dialog box Sometimes this dialog will be hidden by other windows and the installer will appear to hang
Verifying Your Installation • Verify BRAIN Tools are setup correctly in IAR Workbench • Verify Microsoft serial mouse to avoid conflicts with BRAIN USB
IAR Configure Tools Menus Note: Insure that you configure the BRAIN tools as shown in these drop-down menus.
BRAIN Detected as Microsoft Serial Mouse • On some machines, when the BRAIN is plugged into a USB port, the system detects it as a Microsoft Serial Mouse. This condition will prevent the BSLUSB program from downloading programs to the BRAIN hardware. A “failed to enumerate port” error may appear when trying to download a program to the BRAIN. (This is also the error that will appear if the BRAIN is not plugged into the USB port when a download is attempted.) To fix the detected-as-mouse problem, on a Windows XP system: • Right click on My Computer. • Select Properties. • Select the Hardware Tab. • Select Device Manager. • Click on the + sign next to Mouse and other pointing devices. • Click on "Microsoft Serial Mouse". • Press the Delete key. • Confirm that you want to delete the mouse. • Note that if the BRAIN is later plugged into a different USB port, the problem may occur again.
BEST Robotics Advanced Instruction Node Basic BRAIN Training Section 3 - Programming Using The BRAIN Wizard
Programming (step-by-step) • Generate a wizardgen.h file using the Wizard; save the file into the wizard project directory. • Compile and link the code using IAR Workbench. • Download the program to the BRAIN (from within the IAR Workbench) Refer to BRAIN Software GMKE00005 Revision 0; October 2007 for specific details
Programming Terms • Compile – changes your C program into object code that the linker understands. • Link – combines your program’s object code with the BRAIN API library and other libraries to create code that is executable on the MSP430 processor. • Download / Bootload – transfers the machine code version of your program from the PC to the BRAIN where it will execute.
Software Build Overview YOU ARE HERE
Wizard Output Options - 1 • Speed Control Output – provides motor speed control proportional to the transmitter joystick position. • Servo Output – provides servo position output proportional to the transmitter joystick position. • You CAN enable “speed control output” and “servo output” on the same channel.
Wizard Output Options - 2 • Reversing Switch Output – • When the transmitter joystick exceeds a user-specified position, the motor will be run at full speed; • when the transmitter joystick exceeds another user- specified position, the motor will be run at full speed in the opposite direction. Optionally, you can specify proportional servo output on this same channel. Emulates this method usingkit hardware.
Reversing Switch Output – Threshold Option • Transmitter stick position must exceed threshold value to activate motor. • Value is fraction of full stick movement, i.e., a threshold of 0.2 means the motor will activate when the transmitter stick is moved 20% of the way between the center position and full “throw”. • Small difference in threshold values, provides quick response to stick motion. • Large difference in threshold values, prevents accidental activation.
Illustration of Threshold(only applies to reversing switch output) When the stick position is between threshold values (vertical lines) the motor is off. Positivefull speed Negativefull speed Note: Stick values do not have to be symmetric
Wizard Options – Gain(applies to both speed control & servo outputs) • Multiplier used to map transmitter stick input to motor speed output. • Lower gain requires more stick input; this results in more control, but may limit maximum speed. • Higher gain requires less stick input, i.e., gives a faster reaction, but there is no overall increase in maximum speed.
Illustration of Gain This is only an example. A gain greater than one may be required to get full motor output.
Wizard Options –Motor limits • Input switch closure stops motor travel in one direction. • Separate inputs for positive and negative stick directions. • Can be used to prevent robot mechanisms from exceeding design limits, allow motion to stop at a specific location, etc… • Can be used with either Speed Control Output or Reversing Switch Output
Programming (step-by-step) • Generate a wizardgen.h file using the Wizard; save the file into the wizard project directory. • Compile and link the code using IAR Workbench. • Download the program to the BRAIN (from within the IAR Workbench) Refer to BRAIN Software GMKE00005 for specific details
YOU ARE Step 2. Compile & Link YOU ARE HERE!
Step 2. Compile & Link Use “Rebuild All”
Step 2. Compile & Link Results Message Window Output Rebuilding configuration: wizard - Debug Updating build tree... 4 file(s) deleted. Updating build tree... wizardmain.c Linking Total number of errors: 0 Total number of warnings: 0
Programming (step-by-step) • Generate a wizardgen.h file using the Wizard; save the file into the wizard project directory. • Compile and link the code using IAR Workbench. • Download the program to the BRAIN (from within the IAR Workbench) Refer to BRAIN Software GMKE00005 for specific details
Step 3. Boot Load via USB YOU ARE HERE!
Step 3. Boot Load via USB • Connect the BRAIN to a USB port on your PC • It will take a few seconds for the system to detect the BRAIN • Battery power is not needed
Boot Load Menu Note: if you experience a failure here – “Inability to connect” See the chart regarding MS Serial Mouse errors
Step 3. Boot Load Results Message Window Output MSP430 Bootstrap Loader - FTDI USB Interface (Version 1.02) Mass Erase... Additional mass erase cycles... Transmit standard password... BSL version: 1.10 - Family member: F149 - Process: 0043 Patch for flash programming required! Load PC with 0x0C22... Transmit standard password... Load and verify patch "C:\Program Files\Best\BRAIN\bin\PATCH.TXT"... Erase Check by file "wizard.txt"... 00 KByte 01 KByte 02 KByte Program "wizard.txt"... 00 KByte 01 KByte 02 KByte 2177 bytes programmed. Verify"wizard.txt"... 00 KByte 01 KByte 02 KByte Resetting Target Programming completed.Prog/Verify: 14.1 sec - Over all: 17.0 sec
Testing After Programming • Ensure your robot is ‘safe’ to operate. • Connect either the Team Receiver Box, the Tether Box, or BRAIN Tether Cable. • Make sure BRAIN switch is in OFF position. • Turn on radio transmitter (if not using tether). • Turn BRAIN switch to ON position. • Test robot operations with transmitter.
BEST Robotics Advanced Instruction Node Basic BRAIN Training Section 4 - Hub Specific Information