Miabot Pro Sequences

From Merlin Systems Wiki

Some basic notes on writing robot sequences, using the built-in commands ([~][+][w])

Contents

Control commands

Several robot commands enable the use of sequences -

  • [$] deletes the existing sequence
  • [+...] adds a command to the sequence
(where the rest of an ordinary command follows, e.g. "[+>]" equivalent to a normal "[>]" command)
  • [~] executes the sequence
  • [wNNNN] causes the sequence to pause for NNNN milliseconds

Operational details

  1. sequences are paused while distance-based movement commands are waiting to complete
  2. a sequence is aborted whenever a new serial command is received
  3. "[~]" added at the end of a sequence, will make it repeat forever


Examples

1) The following sequence will spin the robot in opposite directions repeatedly -

[$]
[+=100,-100]
[+w2000]
[+=-100,100]
[+w2000]
[+~]

2) The following sequence goes around a rough square, and then spins on one wheel for a while -

[$]
[+dv4000]
[+xv100]
[+d>1367]
[+x>50]
[+^]
[+w250]
[+>]
[+w250]
[+^]
[+w250]
[+>]
[+w250]
[+^]
[+w250]
[+>]
[+w250]
[+^]
[+w250]
[+>]
[+w250]
[+=-100,0]
[+w4500]


3) the 'standard' test sequence (run when all dipswitches set 'ON' at powerup) is here -| Standard Sequence.txt

NOTE: latest OS revision (3.3) includes a new test sequence demonstrating the Gripper. This one is available here - Gripper Sequence.txt


Sending sequences from files

Sequences like the above can be stored in a text file and sent using Hyperterminal. However, the speed of transmission may need to be controlled:-

  1. Bring up Hyperterminal 'Properties' window
  2. Find 'Settings' tab, and hit 'Ascii setup ..' button
  3. Set 'Character Delay' to (at least) 50 milliseconds

(you may want to undo this later)

The sequence can be sent by selecting 'Transfer\Send Text File..', and locating the required file.
(NOTE: *not* 'Send File..' which uses file transfer protocols)

It is usually best to start the file with the '[$]' command, to automatically pre-erase the sequence store before adding the commands.

The sequence can be run by typing the '[~]' command