• Nenhum resultado encontrado

RoboSapien powered by TI MSP430

N/A
N/A
Protected

Academic year: 2021

Share "RoboSapien powered by TI MSP430"

Copied!
84
0
0

Texto

(1)

RoboSapien Powered by MSP430

Pedro Dinis Gaspar, António Espírito Santo, Humberto Santos, Bruno Ribeiro

(2)

Agenda

• MSP430@UBI-DEM:

ƒ Electromechanical engineering classes and,

ƒ Last year projects

• Electromechanical Engineering classes - Robotics:

ƒ RoboSapien powered by MSP430

• Last year projects:

ƒ Sounds Recording and Reproduction System based in

(3)

MSP430@UBI-DEM

• The MSP430 microcontroller family is used in the Electromechanical Engineering Department of the University of Beira Interior (DEM-UBI) – Portugal in:

ƒ Electromechanical engineering classes and,

ƒ last year projects

• Due to:

ƒ its cost;

ƒ plenty of hardware starter kits and software integrated

(4)

MSP430@UBI-DEM

• Electromechanical Engineering classes

• Introduction to Microprocessors:

ƒ Description of the various systems embedded in a microcontroller; ƒ Architecture characteristics;

ƒ Memory Hierarchy; ƒ Internal modules; ƒ Input/Output ports; ƒ Peripherals;

ƒ Programming language Assembler / C; ƒ Arithmetic;

(5)

MSP430@UBI-DEM

• Electromechanical Engineering classes

• Instrumentation and Data Acquisition (Lab examples):

ƒ MSP430 Monitoring System - Develop a low cost system for

event record.

Tilt sensor conditioningSignal

LCD LED’s Light sensor Signal conditioning I/O I/O I/O

(6)

MSP430@UBI-DEM

• Electromechanical Engineering classes

• Automation (Lab examples):

ƒ MSP430 home heating, illumination and security control.

Light sensor Indoor Comparator Light sensor Outdoor Comparator Temperature Sensor Relay Relay Motor Speed and Direction Control Heating Motor Light ADC I/O LCD Controller

(7)

MSP430@UBI-DEM

• Electromechanical Engineering classes

• Robotics (Lab examples):

ƒ MSP430 control board and software for the FESTO robot.

LED’s Buttons End course switch Optical Photocouplers Optical Photocouplers Drivers ADC I/O I/O

(8)

• Electromechanical Engineering classes - Robotics:

ƒ 2006 Project - RoboSapien powered by TI MSP430; ƒ Born by the collaboration between DEM-UBI and TI; ƒ Substitution of RoboSapien’s control/regulation

electronics;

ƒ Replicate the RoboSapien operation;

(9)

RoboSapien powered by MSP430

• The tasks involved in the project consisted in the:

(1) analysis of the robot dynamics (evaluation of the robot movements and its characteristics);

(2) analysis of all sensor/actuator devices on the robot and respective signal conditioning and regulation

electronics;

(10)

Who is RoboSapien?

• RoboSapien (RS) is a toy-like biomorphic robot.

• Is preprogrammed with moves, and also controlled by an IR remote control;

• It is capable of:

ƒ a walking motion;

ƒ grasp objects with either of its hands

Origi

nal RoboSapi

(11)

Who is RoboSapien?

• A brief presentation of the RoboSapien operation.

Origi

nal RoboSapi

(12)

Who is RoboSapien?

• RoboSapien views.

(13)

Who is RoboSapien?

• Dynamic walking gait of RoboSapien.

(1) The trunk motor tilts the upper body to the right. The center of mass shifts over the right foot. The left foot lifts from the

ground.

(2) The leg motors move into opposite directions, resulting in a forward motion of the robot. As the upper body swings back, the left foot regains contact with the ground.

(14)

Programming of the RoboSapien

• The RS controller, is equipped with a basic level of programmability.

• Users can string together movement commands to form either macros or mini-programs (instructions sets).

• Broadcast of an instructiset to the RS, save it on-board memory for later execution.

Origi

nal RoboSapi

(15)

RS’s Remote Control

• The RS’s remote control unit has 21 different buttons. With the help of two shift buttons, 67 different robot-executable commands are accessible.

Right sweep Left strike 2 Right throw Step forward Left strike 1 Left pick up Step backward Lean right Lean left

Right (turn right) Lean forward

Lean back

Right strike 3 Left arm up

Left arm out

Right strike 2 Left arm in

Left arm down

Right strike 1 High Five Fart (Oops) Right pick up Burp Bulldozer Origi nal RoboSapi en

(16)

RS eye patterns

• Depending on the command that is executed, the RS’s eyes have different patterns.

• The 6 outputs for the eyes (P2.0 to P2.5) can be used as a very effective digital-level feedback source. His eyes give distinct patterns for all conditions.

Origi

nal RoboSapi

(17)

User modifications

• 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 don’t have to though — if you carefully remove the

Origi

nal RoboSapi

(18)

User modifications

• Mark Tiden designed the RS to be easily modified or hacked;

• The electronics inside the RS are easily accessed and clearly labeled;

• A growing community of hackers have devoted

themselves to adding new functionalities to the robot.

Origi

nal RoboSapi

(19)

User modifications

• microbi’s Robosapien mods (http://www.angelfire.com/droid/rsv2/)

• Active mods: hand-beams, hand-Led’s, 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)

Origi

nal RoboSapi

(20)

User modifications

• RoboSapienPets RoboSapien page (http://www.aibohack.com/robosap/)

• Active mods: SuperSapien microcontroller mod, color and motion tracking CMUCam

• Mark C’s Robosapien Hacking Site

Origi

nal RoboSapi

(21)

User modifications

• Robocup German Open 2005 tournament;

• 2 teams of 3 RSs each played the 1st soccer match of

humanoid robots worldwide;

• Head replaced by a PDA allowing the perception of its environment using the camera;

• Information sended though the PDA's IR, to a PC.

Origi

nal RoboSapi

(22)

Controller U2

Origi

nal RoboSapi

en

• M means motors,

• P means input or output port,

• VDD is raw battery voltage (caution: fluctuates wildly) • Vcc is regulated 3.6V and Gnd is universal ground.

(23)

Controller U2 - Connections

Origi

nal RoboSapi

en

Left shoulder Right Shoulder

(24)

Controller U2 - Connections

Origi

nal RoboSapi

en

Left shoulder Right Shoulder

M2- M2+ Vcc P1.3 P1.6 Vcc M4- M4+

(25)

Controller U2 - Connections

Origi

nal RoboSapi

en

Left elbow Right elbow

P1.2 M3+ Vcc M3-Vcc Vcc P1.1 P2.7 P2.6 P1.4 Vcc Vcc M1+ Vcc Motors

(26)

Controller U2 - Connections

Origi

nal RoboSapi

en

Left elbow Right elbow

P1.2 M3+ Vcc M3-Vcc Vcc P1.1 P2.7 P2.6 P1.4 Vcc Vcc M1+ Vcc Finger switch

(27)

Left elbow Right elbow P1.2 M3+ Vcc M3-Vcc Vcc P1.1 P2.7 P2.6 P1.4 Vcc Vcc M1+ Vcc

Controller U2 - Connections

Origi nal RoboSapi en

(28)

Left elbow Right elbow P1.2 P1.5 Vcc Vcc Vcc Vcc P1.1 P1.4 P2.6 P2.7 Vcc Vcc M1+

M3-Controller U2 - Connections

Origi nal RoboSapi en Arm LEDs

(29)

Left leg/hip Right leg/hip M6+ M7-M6- M7+ Tilt M5+

M5-Controller U2 - Connections

Origi nal RoboSapi en Motors

(30)

Controller U2 - Connections

Origi nal RoboSapi en Head Vcc P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 IR-OUT Gnd Vrx

(31)

Controller U2 - Connections

Origi nal RoboSapi en Head Vcc P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 IR-OUT Gnd Vrx

(32)

Controller U2 - Connections

Origi nal RoboSapi en Component Speakers Vcc VDD Vcc P1.4 SPK1 SPK1 IN OUT Fr VDD Fr Component P1.1 Vcc Gnd Vcc

(33)

Controller U2 - Connections

Origi nal RoboSapi en Component Speakers Vcc VDD Vcc P1.4 SPK1 SPK1 IN OUT Fr VDD Fr Component P1.1 Vcc Gnd Vcc Foot switch

(34)

Controller U2

Origi

nal RoboSapi

(35)

Controller U2

Origi

nal RoboSapi

(36)

Motor driver U3

Origi

nal RoboSapi

(37)

IR commands

• To input commands is used the direct serial input to the IR-OUT pin (active low signals, 1200 bps).

• Timing based on 1/1200 second clock (~ 0,833 msec) Signal is normally high (idle, no IR).

• Data bits: for each of 8 data bits, space encoded signal depending on bit value (Sends the most significant data

Origi

nal RoboSapi

(38)

IR commands

• Header: signal goes low for 8/1200 sec.

• If the data bit is 0: signal goes high for 1/1200 sec, and low for 1/1200 sec.

• If the data bit is 1: signal goes high for 4/1200 sec, and low for 1/1200 sec.

• Example: Command Stop: 0x8E

Origi

nal RoboSapi

(39)

RoboSapien Replication

• The RS has the following devices and sensors: ƒ IR receiver;

ƒ Power switch; ƒ Microcontroller;

ƒ Seven motors (hands, arms, feet and hip); ƒ Four foot touch sensors;

ƒ Two hand touch sensors,

engi

neering classes

-R

(40)

Signal Analysis

• Digital signals acquired from the electronic board ports; • To know how the microcontroller work when the robot do

a specific command function.

• The procedure consisted in the acquisition of the ports digital signals:

engi

neering classes

-R

(41)

Signal Analysis

• For the single movements we’ve used a Tektronix™ TDS220 oscilloscope.

• For the robot combined movements, a PM3580 Logic Analyzer was used.

engi

neering classes

-R

(42)

Single motor signal graphics

• Illustration of the output signal from the original

microcontroller and the signal that the motor receives.

engi

neering classes

-R

(43)

Combined motors graphics

• Wires connected to the original microcontroller ports:

ƒ In order to connect it to a flat cable to measure the combined

movements digital signals using a logic analyzer.

• Acquisition of the graphical digital signals for the microcontroller motor ports:

ƒ For all the combined functions defined in the remote control.

engi

neering classes

-R

(44)

Combined motors graphics

• Example: Output Ports Signals for the function “Oops”.

• Signal “M1+” (Left Elbow Out) is “high”, for 531 msec and the rest of the time (2125 msec) is “low”.

• Signal “M3+” (Right Elbow Out) presents the same signal. • Both elbows executes the movement at the same time.

engi

neering classes

-R

(45)

New RS Brain – MSP430

• Removal of the original microcontroller from the RS electronic board.

engi

neering classes

-R

(46)

MSP430 I/O functions

Arm goes down Right Arm P6.7 M4-Arm goes up Right Arm P6.6 M4+

Elbow goes in, and closes gripper Right Elbow

P6.5

M3-Elbow goes out, and opens gripper Right Elbow

P6.4 M3+

Arm goes down Left Arm P6.3 M2-Arm goes up Left Arm P6.2 M2+

Elbow goes in, and closes gripper Left Elbow

P6.1

M1-Elbow goes out, and opens gripper Left Elbow P6.0 M1+ Function Motor MSP430F449 Ports Label engin eering classes -R obotics

(47)

Hardware - PCB board

engi neering classes -R obotics • 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;

(48)

Hardware - PCB board

engi neering classes -R obotics C4 10uF TCK TMS TDI TDO/ TDI RST/ NMI XT2I N XT2OUT DVcc1 1 P6.3/A3 2 P6.4/A4 3 P6.5/A5 4 P6.6/A6 5 P6.7/A7 6 VREF+ 7 XIN 8 XOUT 9 VeREF+ 10 VREF-/VeREF-11 P1.0/TACLK 12 P1.1/TA0 13 P1.2/TA1 14 P1.3/TA2 15 P1.4/SMCLK 16 P1. 5 P1. 6 P1. 7 P2. 0/ ACLK P2. 1/ TAI N CLK P2. 2/ CAOUT/ T A0 P2. 3/ CA0/ TA1 P2. 4/ CA1/ TA2 P2. 5/ Ros c P2. 6/ ADC12 CLK P2. 7/ TA0 P3. 0/ STE 0 P3. 1/ SI MO0 P3. 2/ SOMI 0 P3. 3 P3. 4P3.5 33 P3.6 34 P3.7 35 P4.0/TB0 36 P4.1/TB1 37 P4.2/TB2 38 P4.3/TB3 39 P4.4/TB4 40 P4.5/TB5 41 P4.6/TB6 42 P4.7/TB7 43 P5.0/STE1 44 P5.1/SIMO1 45 P5.2/SOMI1P5.3 46 47 P5.4 48 P5. 5 49 P5. 6 50 P5. 7 51 XT2OUT 52 XT2 IN 53 TDO/ TDI 54 TDI/ TCLK 55 TMS 56 TCK 57 RST/ NMI 58 P6. 0/ A0 59 P6. 1/ A1 60 P6. 2/ A2 61 AVs s 62 DVs s 63 AVcc 64 uP1 MSP430F149 100n C3 +3.3 330R R2 TDO/TDI TDI TMS TCK RST/NMI +3.3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 P1 Header 7X2 12pF C1 12pF C2 2 3 1 4 Y1 85SMX DS1 LED3 12 3 4 P5 Switch P12 P13 P14 1 2 3 4 5 6 7 8 P6 LED P40 P41 P42 P43 P44 P45 P46 P47 R1 47K 10nF C15 +3.3 +3.3 P60 P61 P62 P63 P64 P65 P66 P67 P60 P61 P62 P63 P64 P65 P66 P67 P3 1 2 3 4 5 6 7 8 P4 Motores1 P11/IR P11/IR P12 P13 P14 LED1 LED2 LED3 LED4 LED5 LED6 LED7 LED8

(49)

Hardware - PCB board

engi

neering classes

-R

(50)

Software – Operations Principle

[0] [1] [2] [3] [4] [13] [14] 0 0 0 425 2643 0 0 0 1693 319 531 525 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [0] [1] [2] [13] [12] Timers Motors 0 1 0 0 0 1 1 0 0 0 Motor State Motor Initial Value Motor 1 M1+ engi neering classes -R obotics

M1+, M1- are logical motors;

Example: M1 state 0

If M1+ = High & M1- = Low

then, M1 runs counter

(51)

Software – Architecture

engi

neering classes

-R

(52)

Software – Background task

engi neering classes -R obotics Start Initialization Any Command? No Yes

(53)

Software – System task

engi neering classes -R obotics Motor (M1+) Motor (n) Enable Yes Decrement Timer (n) Timer (n) = 0? Get next Timer (n) Yes Timer (n) = 0? Yes Desable No No Motor (...) Motor (n) Enable Yes Decrement Timer (n) Timer (n) = 0? Get next Timer (n) Timer (n) = 0? Yes No No Start Movement On ? Switch On? Yes Debounce Switch On? Yes

System Task Flow Chart

No No Motor (M7-) Motor (n) Enable Yes Decrease Timer (n) Timer (n) = 0? Get next Timer (n) Timer (n) = 0? Yes No No Yes No

(54)

Software – IR command task

engi neering classes -R obotics Comunication OFF Validate Preamble

Signal : Higth to Low

Clear TBR

Capture on rising edge

Preamble is valid Preamble NOT valid

Timeout Condition

Inicialization

Clear TBR Capture on falling edge Initialize data

(55)

Project conclusions

• Successful attempt in the substitution of RoboSapien control/regulation electronics by TI MSP430;

• Excellent demo vehicle of technology;

• Use the RoboSapien in laboratorial classes, as a way to demonstrate the embedded systems capabilities;

engi

neering classes

-R

(56)

Future work

• Include wireless communications like ZigBee;

• Expand computation capabilities (TI C2000) to include voice commands;

• Development of a user friendly PC high level application to perform new actions/movements;

engi

neering classes

-R

(57)

MSP430@UBI-DEM

Last Year Projects

• Last year projects

• Sounds Recording and Reproduction System based

in MSP430 for the RoboSapien

• Implementation of a system of sounds with the

particularity to reproduce the voice signal data, stored in

(58)

PWM frequency

Last Year Projects

• The required frequency for the PWM output signal is equal to the DAC actualization frequency.

• Each alteration in the PWM duty cycle is equivalent to one DAC sampling.

(59)

Global Architecture of the system

• Application block diagram (Analog and digital blocks) since the microphone to the speaker.

(60)

MSP430 used peripherals

• MSP430 Digital peripherals: • ADC12,

• Timer_A and Timer_B, • flash memory.

• The signal conditioning circuit of the microphone is

(61)

Important States

• 2 important states: Recording and Reproduction

• Recording state: 1st analog part and the digital one

actives.

• During this time period, the data converted by the ADC12 will be stored in the flash memory.

(62)

Microphone and Conditioning system

Last Year Projects

• Pre-amplifying circuit and low pass filter • Microphone: input jack 3,5 mm (J1)

• Amplifying stage: Active low pass filter (TI OA TLE2141CP) R3 56k R4 R7 470p C3 D1 2 6 7 8 1k1 R1 C1 Liga ao canal 0 +5V +5V

(63)

PWM DAC and active filter

Last Year Projects

• The PWM DAC is constituted by two RC series low pass filters.

• The digital signal in the TIMER_B compare output is converted to an analog signal.

• To reduce the attenuation amount of the signal produced by the filter, the cut off frequency of the filter should be near the band

(64)

PWM DAC and active filter

• Before amplifying the signal, it is used an Sallen-Key low pass filter with unitary gain.

• 2 resistors (R10 e R11), • 2 condensers (C7 e C8)

• TI OA TLE2141CP with unitary gain (buffer) ƒ Cut off frequency: fcut off = 870 Hz

ƒ Quality factor: Q = 1,97

C7

(65)

Audio amplifier

Last Year Projects

• Volume control: tension divider (R12 and R13) • Limit the input audio signal level.

• Amplifying circuit: Audio amplifier Philips TDA7052

100n C11 1 IC2 8 220u C10 470k R12 +5V Liga à saída do filtro

(66)

Using MSP430F449 OLIMEX kit

Last Year Projects

• 3 external interfaces: JTAG, AEXT and EXT • AEXT interface - ADC12

(67)

PWM signals - Software

Last Year Projects

• Erasing flash memory by segments

Set to 0 the flash memory index which segment is to be erased 5

Set the erase mode by segments 4

Unblock flash memory 3

Select clock source. f ≈ 444 kHz 2

Stop Watchdog timer 1

Description Step

(68)

PWM signals - Software

Last Year Projects

• Write words in flash memory

Un set the word writing mode 5

Attribute the memory index with a 16 bits data 4

Set the word writing mode 3

Unblock flash memory 2

Stop Watchdog timer 1

Description Step

(69)

Storing voice signals - Software

Last Year Projects

• Flash memory used: 370 Kbytes • Duration of speech: 15,3 sec

(70)

Using Timer_A - Software

Last Year Projects

• Speech signal sampling frequency: 1953 Hz = 512 μsec.

• Generate an interruption to save the speech signal sample.

(71)

Using ADC12 - Software

Last Year Projects

• Conversion reference voltage: 0 – 3 V. • Time of conversion: 5,8 μsec.

(72)

MatLab verification

Last Year Projects

(73)

Using Timer_B - Software

Last Year Projects

• PWM outputs each 512 μsec.

• Each signal sample stored in flash memory is sent to the PWM DAC through Timer_B interruption.

(74)

Serial communication DAC

Last Year Projects

• 2nd choice for the global architecture of the system.

• Substitution of the PWM DAC for a serial communication DAC.

• Using the same peripherals but also the USART in SPI mode. • Allows sending the serial data synchronized to the 12 bits DAC

(75)

Using USART - Software

Last Year Projects

• 2nd choice for the global architecture of the system.

• Substitution of the PWM DAC for a serial communication DAC.

• Using the same peripherals but also the USART in SPI mode.

• Allows sending the serial data synchronized to the 12 bits DAC (TI TLV5616CP).

(76)

Serial communication DAC

Last Year Projects

• Using the Olimex kit MSP430F449, the connections are:

1k1 R3 56k R4 R5 R6 18k R7 470p C6 10n C7 D1 D2 3 2 6 7 4 8 1 5 IC1a TLE2141CP 1k1 R1 4.7u C1 680 R2 +5V +5V +5V Liga ao pino 15 de AEXT

(77)

Serial communication DAC

(78)

Serial communication DAC

Last Year Projects

18k R8 18k R9 1k8 R10 18k R11 4.7n C8 3 2 6 7 4 8 1 5 IC1b TLE2141CP DIN 1 SCLK 2 CS 3 FS 4 AGNDREFIN 56 OUT 7 VDD 8 IC2 TLV5616CP 4.7u C3 0.22u C4 +5V Liga ao pino 1 de EXT Liga ao pino 4 de EXT Liga ao pino 5 de EXT Liga ao pino 7 de EXT +5V

(79)

Breadboard development

(80)

Breadboard development

(81)

Project conclusions

Last Year Projects

• Using PWM signals:

ƒ Low quality of the sound reproduced

ƒ Due to the sampling frequency (1953.125 Hz) ƒ Speech duration: 15,3 sec

• Using serial communication DAC TLV5616CP ƒ Higher quality of the sound reproduced

(82)

Project conclusions

Last Year Projects

• The voice commands recognition by the RoboSapien needs:

ƒ Voice acquisition;

ƒ Parameters extraction; ƒ Pattern recognition.

• Voice acquisition: ADC12.

(83)

Summary

• Presentation of the teaching structure at UBI in classes that use microprocessors;

• Exposition of the items covered in the substitution of the RoboSapien microcontroller by TI MSP430, untitled

“RoboSapien powered by MSP430”;

(84)

Acknowledgments

• This project was partially funded by Texas Instruments; • The authors would like to particularly acknowledge the

help provided by: • Christian Speck

Referências

Documentos relacionados

A 30 de maio de 2019, o município deu início ao procedimento para 2ª revisão do PDM, com o objetivo de adaptar o PDM às alterações legislativas, desencadeadas por

Once a wake-up packet (WuPt) is received, the IF ampli- fiers switch to active mode by means of an incoming signal at the SHDN pin.. The signal is a low-to-high pulse which has to

A 10mL sample of peripheral blood, collected from each participant by venipuncture, was sent to the Health Foundation Parreiras Horta [ Fundação de Saúde Parreiras Horta

Foi observado que o b-TCP Cerasorb® é reabsorvido em simultâneo com a formação de novo tecido ósseo, apesar dessa substituição não ser equitativa, havendo menos osso formado do

Neste capítulo será realizada a revisão da literatura sobre o tema de que trata o presente estudo, versando sobre os seguintes tópicos: a Histórico e Princípios Cooperativos, no qual

In the case of sensor networks, it is essential for each sensor node and base station to have the ability to verify that the data received was really sent by a

No plano educacional, os anos 90 têm mostrado o magistério como um espaço profissional definitivamente feminizado em quase todos os níveis de ensino, assim como aumenta a cada dia

Utilizaram-se registros de pesos corporais padronizados aos 120, 210, 365 e 450 dias de idade, provenientes de 30.481 animais da raça Nelore, progênies de 211