Monday, November 1, 2010

Hands-On Robotics

Let's check out the "Create" model robots...


Note the...
Handle

Omnidirectional IR receiver





  • omnidirectional?
  • IR?
  • receiver?

Tailgate

Cargo bay

Cargo bay connector

Charging socket

Serial port





  • May have a cover to remove
  • Plug in the cable and then remove (gently!):
  • Embossed arrow faces outward, see figure -















External hardware mounting holes
Power button
  • Why that symbol?
  • (per IEEE 1621)

Power LED
  • LED?
  • green=charged
  • amber=partial charge
  • red=little charge
  • flashing red=no charge
  • What is the charge of yours?

Play button
Play LED
Advance button
Advance LED
Resetting the robot:
  • Power cycle it. Try it.

Choosing a demo (10 of'em)
  • Press the 'Advance' button
  • Printed with a double arrow
  • 4 beeps for demo #4
  • long beep for #5
  • long + 4 shorts for #9
  • How about #10?

Try each demo outside where there is more room...
Contact points for home base
  • Why not save $ by making them out of plastic?

Cliff sensors
  • Are these spring-loaded feelers, or electronic?

Battery
  • Carefully turn robot upside down
  • Take out battery
  • Put it back in
  • Press both ends to make sure it is seated;
    • sometimes one end hasn't clicked yet







































































































Musical robots

send:
128 132 (start, then put robot in full programmer control mode)

send: 140 0 4 62 12 68 12 69 12 74 36
(loads a song)

send:
141 0
(plays the song)

140=defines a song
0=name it song #0
4=we'll see later :)
62=MIDI note #62 (range 31-127)
12=twelve 64ths of a second
Etc.

You can send all three at once:
  • 128 132 140 0 4 62 12 66 12 69 12 74 36 141 0
  • Notice the 68 is a 66 this time
  • Should give you control, then load, then play the new song

Try some variations on
128 132
140 0 4 62 12 68 12 69 12 74 36
141 0
recalling that:
140=defines a song
0=name it song #0
4=song has four notes
62=MIDI note #62 (range 31-127)
12=twelve 64ths of a second
Etc.

Insert a 5th, superhigh tone, 111
Play it for a longish time, 100:
128 132
140 0 5 62 12 68 12 69 12 74 36 111 100
141 0
Try it

Program new variations and we'll have a concert...


Robot motion

Moving
- a key function for robots!

Initialize: send
128 131
Make it move:
be ready to catch it if it falls
send :
137 0 100 128 0
 (If you both initialize and send on one line, it might not work (why?)

137=drive
0 100=go 100 mm/sec
128 0=go straight, no circle

Notice that:
128 131
is not the same as
128 132
which gives full control
This time try
128 132 (instead of 128 131)
Then again make it move:
  • (falling alert: be ready to catch or pick it up!):
  • 137 0 100 128 0
Pick it up
Now what to do??!

Change the initialization back to:
128 131
and send it

What is the slowest speed you can get it to go?


Scripts

A kind of small program

152 17 137 0 44 128 0 156 0 144 137 0 44 0 1 157 0 90 153

Let's analyze it!

152=define a script
17=it has 17 more bytes
137 0 44 128 0=drive, 0+44=44 mm/sec., 128 0=straight
(137 1 44 128 0 would drive 256+44=300 mm/sec.)
156 0 144=wait until 0+144=144 mm
137 0 44 0 1=drive, 0+44=44 mm/sec., 0 1=spin counterclockwise
157 0 90=wait until 0+90=90 degrees
153=repeat script
Notice how this makes it go in a rectangle!

To run the script:
send 128 131 (start in safe mode)
send 152 17 137 0 44 128 0 156 0 144 137 0 44 0 1 157 0 90 153
send 153 (to run it)

Recall:
152=define a script
153=play a script

Well,
154=show the script
try it
what happens?

Let's review the script program...
Then try variations on the program
- see board for command details

If time allows - show off your new program

No comments:

Post a Comment

(Anyone may comment)