Presentation is loading. Please wait.

Presentation is loading. Please wait.

UBI >> Contents 1 Copyright 2009 Texas Instruments All Rights Reserved www.msp430.ubi.pt Chapter 15 Advanced Laboratories RoboSapien powered by MSP430.

Similar presentations


Presentation on theme: "UBI >> Contents 1 Copyright 2009 Texas Instruments All Rights Reserved www.msp430.ubi.pt Chapter 15 Advanced Laboratories RoboSapien powered by MSP430."— Presentation transcript:

1 UBI >> Contents 1 Copyright 2009 Texas Instruments All Rights Reserved Chapter 15 Advanced Laboratories RoboSapien powered by MSP430 MSP430 Teaching Materials Texas Instruments Incorporated University of Beira Interior (PT) Pedro Dinis Gaspar, António Espírito Santo, Bruno Ribeiro, Humberto Santos University of Beira Interior, Electromechanical Engineering Department Copyright 2009 Texas Instruments All Rights Reserved

2 UBI >> Contents 2 Copyright 2009 Texas Instruments All Rights Reserved Contents RoboSapien powered by MSP430 What is RoboSapien? How RoboSapien works? Analysis of the dynamics and kinematics of the robot Analysis of all sensors, actuators and signal conditioning MSP430 integration (PCB board and electronics) MSP430 C code programming Tests and development of new functionality 2

3 UBI >> Contents 3 Copyright 2009 Texas Instruments All Rights Reserved Robotics is being increasingly used as a vehicle for motivating students to learn: Embedded systems; Artificial intelligence; Computer science; And even general science and engineering. Typically, laboratory classes for courses using robotics involve the construction and programming of simple robots, typically composed of: Microcontroller; Sensors; Remote communication devices; DC or stepper motors; mounted in all types of robot bodies. 3 RoboSapien powered by MSP430 (1/2)

4 UBI >> Contents 4 Copyright 2009 Texas Instruments All Rights Reserved The robotics topics involve both in mechanical and electronic engineering. Projects involve both hardware and software development, tailored to a specific application. This advanced laboratory takes a multidisciplinary approach and integrates together topics from different knowledge areas: Control systems, for the different control approaches; Embedded systems based on the MSP430; Instrumentation and measurements for the sensor signal conditioning and data acquisition; C/C++ programming. 4 RoboSapien powered by MSP430 (2/2)

5 UBI >> Contents 5 Copyright 2009 Texas Instruments All Rights Reserved The RoboSapien is a humanoid robot designed by Mark W. Tilden, marketed by WowWee (www.wowwee.com/) for the toy market; The RoboSapien measures approximately 34 cm in height and its weight is about 2.1 kg, including four mono (D) type batteries located in its feet; 5 What is RoboSapien? (1/7)

6 UBI >> Contents 6 Copyright 2009 Texas Instruments All Rights Reserved What is RoboSapien? (2/7) Is preprogrammed for different motions and is controlled by an infra-red (IR) remote controller: Users can string together movement commands to form either macros or mini-programs (sets of instructions); Send a set of instructions to the RS by IR, and save it in on- board memory for later execution; Sensor-keyed instruction set, performing a specific set of actions in conjunction with a specific sensor system. RoboSapien is capable of: Walking motion; Grasping objects with either of its hands; Throwing grasped objects with mild force. It has a small loudspeaker unit, which can emit several different sounds. 6

7 UBI >> Contents 7 Copyright 2009 Texas Instruments All Rights Reserved What is RoboSapien? (3/7) Some words of the Robot Tech Support, from WowWee Ltd.: The RoboSapien is designed for modification. Here is the short hint list for the budding RS hacker. First off, we must warn you that completely replacing the RS brain should only be attempted by those with a lot of time, electronic skills, and programming ego. You dont have to though if you carefully remove the connectors and lift the RS motherboard, on the back you will find all inputs and outputs labeled, and right next to gold pads convenient for soldering wires… in 7

8 UBI >> Contents 8 Copyright 2009 Texas Instruments All Rights Reserved What is RoboSapien? (4/7) This biomorphic robot was designed to be easily modified or hacked, the electronics inside the RS being easily accessed and clearly labelled; A growing community has devoted themselves to modify and add new functionalities to the robot: Some features have been added in order to provide new features to the RS: 8

9 UBI >> Contents 9 Copyright 2009 Texas Instruments All Rights Reserved What is RoboSapien? (5/7) Microbis Robosapien mods: Active modifications: hand-beams, hand-LEDs, heartbeat, voice off, tunnel-beam, blue eyes. Robosapien RF Sound Mod: (http://home.comcast.net/~robosapien/rfmod.htm) Robosapien Camera Mod: (http://home.comcast.net/~jsamans/robo/robocam.htm) Active modifications: wireless camera, wireless radio, frequency audio and pc control. 9

10 UBI >> Contents 10 Copyright 2009 Texas Instruments All Rights Reserved What is RoboSapien? (6/7) RoboSapienPets RoboSapien page: Active mods: SuperSapien microcontroller mod, color and motion tracking CMUCam Mark Cs Robosapien Hacking Site: Active mods: microcontrollers (PicMicro controllers, and Palm Pilot controllers for the Robosapien) 10

11 UBI >> Contents 11 Copyright 2009 Texas Instruments All Rights Reserved What is RoboSapien? (7/7) Robocup German Open 2005 tournament: 2 teams of 3 RSs each played the 1 st soccer match for humanoid robots worldwide; Head replaced by a PDA, allowing a display of its environment using the camera; Information sent to a PC though the IR of the PDA. (Sven Behnke, Jurgen Muller, and Michael Schreib, Playing Soccer with RoboSapien, Proceedings of The 9th RoboCup International Symposium, Osaka, Japan, July 2005) 11

12 UBI >> Contents 12 Copyright 2009 Texas Instruments All Rights Reserved How RoboSapien works? (1/4) Step 1: Analysis of the robot kinematics and dynamics The first task consists in the analysis of the robot dynamics and kinematics (evaluation of the robot movements and its characteristics). This task requires testing the RS movements. 12

13 UBI >> Contents 13 Copyright 2009 Texas Instruments All Rights Reserved A. Analysis of the RS movements: 13 How RoboSapien works? (2/4) Step 1: Analysis of the robot kinematics and dynamics

14 UBI >> Contents 14 Copyright 2009 Texas Instruments All Rights Reserved How RoboSapien works? (3/4) Step 1: Analysis of the robot dynamics and kinematics A. Analysis of the RS movements: Dynamic walking pattern: (1) The trunk motor tilts the upper body to the right. The centre of mass shifts over to the right foot. The left foot lifts from the ground; (2) The hip motors move in opposite directions, resulting in a forward motion of the robot. As the upper body swings back, the left foot regains contact with the ground; (3) Similar to (1). The trunk motor tilts the body to left; (4) Similar to (2). Hip motors move in other direction. 14

15 UBI >> Contents 15 Copyright 2009 Texas Instruments All Rights Reserved How RoboSapien works? (4/4) Step 1: Analysis of the robot dynamics and kinematics B. Analysis of RSs remote control commands: The RSs remote control unit has 21 different buttons; With the help of two shift buttons, 67 different robot- executable commands are available. 15

16 UBI >> Contents 16 Copyright 2009 Texas Instruments All Rights Reserved How RoboSapien works? (1/21) Step 2: Actuators, sensors and signal conditioning analysis The next task requires a dismantling procedure to allow detailed analysis of the: Actuators (motors); Regulation electronics; Sensors and respective signal conditioning; PCB included with the original robot. A procedure for dismantling the RS in order to give it additional features is detailed in: 16

17 UBI >> Contents 17 Copyright 2009 Texas Instruments All Rights Reserved RSs PCB (Controller U2 and Motor Driver U3) is easily accessed and clearly labelled: M:Motors; P: Input or output port; VDD: Raw battery voltage (fluctuates wildly); Vcc: Regulated voltage (Vcc = 3.6 V); Gnd: Universal ground. 17 How RoboSapien works? (2/21) Step 2: Actuators, sensors and signal conditioning analysis

18 UBI >> Contents 18 Copyright 2009 Texas Instruments All Rights Reserved Tasks: List and investigate the functions of: All the components and devices included on the PCB; Actuators, sensors and output devices; Determine the mechanical and/or electrical characteristics of: Controller U2; Motor driver U3; Power switch; Motors: shoulder (2); elbow (2); hip (2) and trunk (1); Foot touch sensors (4); Finger touch sensors (2); End course position switches (shoulders and elbows); Sound sensor; Eight LEDs (fingers (2) and eyes (6)); IR receiver and external IR remote control. 18 How RoboSapien works? (3/21) Step 2: Actuators, sensors and signal conditioning analysis

19 UBI >> Contents 19 Copyright 2009 Texas Instruments All Rights Reserved A. Motor controller (U2) connections: Details of the connections to the motors of the U2 controller. Shoulder motors: 19 How RoboSapien works? (4/21) Step 2: Actuators, sensors and signal conditioning analysis

20 UBI >> Contents 20 Copyright 2009 Texas Instruments All Rights Reserved A. Motor controller (U2) connections: Details of the connections to the motors of the U2 controller. Elbow motors: 20 How RoboSapien works? (5/21) Step 2: Actuators, sensors and signal conditioning analysis

21 UBI >> Contents 21 Copyright 2009 Texas Instruments All Rights Reserved A. Motor controller (U2) connections: Details of the connections to the motors of the U2 controller. Hip and trunk motors: 21 How RoboSapien works? (6/21) Step 2: Actuators, sensors and signal conditioning analysis

22 UBI >> Contents 22 Copyright 2009 Texas Instruments All Rights Reserved B. Position switches and touch sensor connections: Details of the connections to the switches of the U2 controller. Shoulder position switches: 22 How RoboSapien works? (7/21) Step 2: Actuators, sensors and signal conditioning analysis

23 UBI >> Contents 23 Copyright 2009 Texas Instruments All Rights Reserved B. Position switches and touch sensor connections: Details of the connections to the switches of the U2 controller. Elbow position switches: 23 How RoboSapien works? (8/21) Step 2: Actuators, sensors and signal conditioning analysis

24 UBI >> Contents 24 Copyright 2009 Texas Instruments All Rights Reserved B. Position switches and touch sensor connections: Details of the connections to the switches of the U2 controller. Finger touch sensors: 24 How RoboSapien works? (9/21) Step 2: Actuators, sensors and signal conditioning analysis

25 UBI >> Contents 25 Copyright 2009 Texas Instruments All Rights Reserved B. Position switches and touch sensor connections: Details of the connections to the switches of the U2 controller. Feet touch sensors: 25 How RoboSapien works? (10/21) Step 2: Actuators, sensors and signal conditioning analysis

26 UBI >> Contents 26 Copyright 2009 Texas Instruments All Rights Reserved C. LEDs connections: Details of the connections to the LED of the U2 controller. Finger LED connections: 26 How RoboSapien works? (11/21) Step 2: Actuators, sensors and signal conditioning analysis

27 UBI >> Contents 27 Copyright 2009 Texas Instruments All Rights Reserved C. LEDs connections: Details of the connections to the LED of the U2 controller. Eye LED connections: 27 How RoboSapien works? (12/21) Step 2: Actuators, sensors and signal conditioning analysis

28 UBI >> Contents 28 Copyright 2009 Texas Instruments All Rights Reserved D. Command and power connections: Details of the command and power connections. Command and power connections: 28 How RoboSapien works? (13/21) Step 2: Actuators, sensors and signal conditioning analysis

29 UBI >> Contents 29 Copyright 2009 Texas Instruments All Rights Reserved E. Acquisition and analysis of digital port signals: Continue with the analysis of the digital signals acquired from the ports on the PCB; Evaluate the original microcontroller control output ports when the robot performs a specific command function; Define the time sequence of the active/inactive motor in each specific movement; Procedure: List the active/inactive time of each motor: o Single movement (single motor); o Combined movements (more than one motor). 29 How RoboSapien works? (14/21) Step 2: Actuators, sensors and signal conditioning analysis

30 UBI >> Contents 30 Copyright 2009 Texas Instruments All Rights Reserved E. Acquisition and analysis of digital port signals: Task: Use an oscilloscope to acquire the signals used for single movements; If available, use a logic analyzer to acquire the signals used for the combined movements signals; Connect probes to the output port pins. 30 How RoboSapien works? (15/21) Step 2: Actuators, sensors and signal conditioning analysis

31 UBI >> Contents 31 Copyright 2009 Texas Instruments All Rights Reserved E. Acquisition and analysis of digital port signals: Single motor signal analysis: Compare the output signal from the original microcontroller and the signal that the motor receives. Examples: 31 How RoboSapien works? (16/21) Step 2: Actuators, sensors and signal conditioning analysis

32 UBI >> Contents 32 Copyright 2009 Texas Instruments All Rights Reserved E. Acquisition and analysis of digital port signals: Analysis of signals for combined actions: Connect probes to the original microcontroller ports to measure the digital signals with a logic analyzer. Example: combined movement: Oops. 32 How RoboSapien works? (18/21) Step 2: Actuators, sensors and signal conditioning analysis

33 UBI >> Contents 33 Copyright 2009 Texas Instruments All Rights Reserved F. Analysis of the eyes pattern: Evaluate the eye pattern (6 LEDs – P2.0 to P2.5) depending on the command that is executed: 33 How RoboSapien works? (19/21) Step 2: Actuators, sensors and signal conditioning analysis

34 UBI >> Contents 34 Copyright 2009 Texas Instruments All Rights Reserved G. Analysis of the IR commands: Using a logic analyser, determine the IR command digital value (port IR-OUT) for each movement command of the remote controller. Serial communication specifications: Direct serial input to the IR-OUT pin (active low signals, 1200 bps); Timing based on 1/1200 second clock (~ msec) Signal is normally high (idle, no IR); Data bits: for each of the 8 data bits, space encoded signal depending on the bit values (Sends the most significant data bit first). (Carrier is 39.2 kHz); 34 How RoboSapien works? (20/21) Step 2: Actuators, sensors and signal conditioning analysis

35 UBI >> Contents 35 Copyright 2009 Texas Instruments All Rights Reserved G. Analysis of the IR commands: Serial communication specifications: Preamble: signal goes low for 8/1200 sec; data bit = 0: signal goes high for 1/1200 sec, and low for 1/1200 sec; data bit = 1: signal goes high for 4/1200 sec, and low for 1/1200 sec; Example: Command Wake Up: 0xB1. 35 How RoboSapien works? (21/21) Step 2: Actuators, sensors and signal conditioning analysis

36 UBI >> Contents 36 Copyright 2009 Texas Instruments All Rights Reserved MSP430 Integration (1/9) Development of a PCB to facilitate connections to the MSP430; Microcontroller: MSP430F149; Resources: Motors:P6.0 – P6.7, P2.0 – P2.5; LEDs:P4.0 – P4.7; IR:P1.1; Switches:P1.2 – P1.3; This task requires the fabrication and assembly of the components and devices on the proposed PCB. 36

37 UBI >> Contents 37 Copyright 2009 Texas Instruments All Rights Reserved MSP430 Integration (2/9) New PCB schematics: 37

38 UBI >> Contents 38 Copyright 2009 Texas Instruments All Rights Reserved MSP430 Integration (3/9) New MSP430 PCB Connector Motors_1 connections to the RS controller: New MSP430 PCB Connector Motors_2 connections to the RS controller: 38

39 UBI >> Contents 39 Copyright 2009 Texas Instruments All Rights Reserved MSP430 Integration (4/9) New MSP430 PCB Connector LED connections to the RS controller: 39

40 UBI >> Contents 40 Copyright 2009 Texas Instruments All Rights Reserved MSP430 Integration (5/9) New MSP430 PCB connector switch connections to the RS controller: (*) These connections were not used because the code has been developed to take into account the shoulders and elbows motors active period time, to obtain the end positions. 40

41 UBI >> Contents 41 Copyright 2009 Texas Instruments All Rights Reserved MSP430 Integration (6/9) New MSP430 PCB masks: 41

42 UBI >> Contents 42 Copyright 2009 Texas Instruments All Rights Reserved MSP430 Integration (7/9) Remove the original U2 controller from the RS PCB: 42

43 UBI >> Contents 43 Copyright 2009 Texas Instruments All Rights Reserved MSP430 Integration (8/9) The next task requires soldering wires onto the RoboSapien PCB at each pin location of the U2 controller: 43

44 UBI >> Contents 44 Copyright 2009 Texas Instruments All Rights Reserved MSP430 Integration (9/9) 44 Examples: MSP430 mounted on the back of the RoboSapien PCB; Connections to the original PCB assembled in the RS.

45 UBI >> Contents 45 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (1/13) 45 Project files: C source files:Chapter 15 > Lab11a > main.c Chapter 15 > Lab11a > Global.h Chapter 15 > Lab11a > Commands.h Chapter 15 > Lab11a > Commands.c Chapter 15 > Lab11a > Actions.h Chapter 15 > Lab11a > Actions.c

46 UBI >> Contents 46 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (2/13) 46 Overview: The C code allows the MSP430 to control the RS movements.

47 UBI >> Contents 47 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (3/13) 47 Resources: TIMER_A is configured in compare mode, providing an ISR once every 1 msec; Timer_B is configured in capture mode, providing an ISR to implement the receiver command task; This application makes use of the following MSP430F149 resources: Timer_A; Timer_B; I/O ports; Interrupts;

48 UBI >> Contents 48 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (4/13) 48 Software application organization: Definition and implementation of the command receiver task (Commands.h and Commands.c); Implements all the functions of the system task, to drive the motors and LEDs, and monitor the switches (Actions.h and Actions.c); Defines the movement tables ACTION DATA TABLES (main.c): Times when to toggle each motor state (active/inactive); LED patterns; Motors initially active; Motors enabled; Data from Step2E and Step2F.

49 UBI >> Contents 49 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (5/13) 49 Software application organization: Definition and implementation of the command receiver task (Commands.h and Commands.c); Functions of the System task to drive the motors and LEDs, and monitor the switches (Actions.h and Actions.c); Define the movement tables ACTION DATA TABLES (main.c): Time to toggle each motor state (active/inactive); LED patterns; Motors initially active; Motors enabled; Data from Step2E and Step2F.

50 UBI >> Contents 50 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (6/13) 50 Software application organization: A. Organization of the information required for the RS actions: The table pointers ensure rapid access to the access table information: o Contains all the structure addresses (move data); o Movements = data structures data movements (); o Structure = {time, sequence, initial state, stop}; o Each motor starts at the initial state and toggles between states On and Off when the timer decreases to 0; o When a counter reaches 0, the next timer is activated; o The motor stops if the counter reaches 0 and the next counter contains a count of zero.

51 UBI >> Contents 51 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (7/13) 51 Software application organization: A. Organization of the information required for the RS actions (continued):

52 UBI >> Contents 52 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (8/13) 52 Software application organization: B. Logic motors: The RS motors have 3 states: o Rotate clockwise; o Rotate counter clockwise; o Stop. Control of each motor is implemented as two logic signals.

53 UBI >> Contents 53 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (9/13) M1+, M1- are logical motors; Both represent the physical motor M1; Note: M1+, M1- cannot have the same high state (short circuit) Example: M1 = state 0 If M1+ = High & M1- = Low then, M1 runs counter clockwise 53 Software application organization: B. Logic motors:

54 UBI >> Contents 54 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (10/13) 54 Software application organization: C. Software architecture:

55 UBI >> Contents 55 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (11/13) 55 Software application organization: D. Background task:

56 UBI >> Contents 56 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (12/13) 56 Software application organization: D. System task:

57 UBI >> Contents 57 Copyright 2009 Texas Instruments All Rights Reserved MSP430 C code programming (13/13) 57 Software application organization: E. IR command task:

58 UBI >> Contents 58 Copyright 2009 Texas Instruments All Rights Reserved Tests and development of new functionalities The final task consists of performing tests to evaluate the robot movements and perform fine-tuning; Proposals for the development of new functionalities; Examples: Wireless communications instead of IR remote control; Voice commands (use other devices in the MSP430 family); Integrate sensors (optical, acoustics and others...); Digital camera to provide more autonomy for the RoboSapien. Now, it is up to you! Try to reach the next phase of the RoboSapien evolution. 58


Download ppt "UBI >> Contents 1 Copyright 2009 Texas Instruments All Rights Reserved www.msp430.ubi.pt Chapter 15 Advanced Laboratories RoboSapien powered by MSP430."

Similar presentations


Ads by Google