1 / 45

Robonova-1 Instruction Manual v1.5

Written by Meena Seralathan. Robonova-1 Instruction Manual v1.5. Overview.

heman
Télécharger la présentation

Robonova-1 Instruction Manual v1.5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Written by Meena Seralathan Robonova-1 Instruction Manual v1.5

  2. Overview • The Robonova-1 is a humanoid robot able to execute a number of pre-programmed moves, as well as execute new moves through use of the RoboBASIC programming language, and the RoboBASIC’s catch-and-play feature, which allows for real-time recording of servo positions for even simpler routine coding. While there are also a program designed for emulating the remote control (roboRemocon) and a program designed to be a version of RoboBASIC that is coded more like a script and less like a program(roboScript), it is generally easier to program in the RoboBASIC program, and thus it will only be the RoboBASIC program that will be highlighted in this presentation.

  3. What the Robonova-1 Comes With • 16 servos • MR-C3024 controller board • 5-cell NiMH rechargeable battery and charger • IR sensor on head for use with included remote control • 8 AD ports • PIEZO speaker for basic sound capabilities • CD with RoboBASIC, roboRemocon, and roboScript (all v2.5) for programming the robot’s moves; also comes with code demonstrating various movements the Robonova-1 can do, such as walking, sitting, and punching, and an instruction PDF (in English, Japanese, or Korean)‏

  4. What the Robonova-1 Can Be Modified To Have • Up to 8 additional servos • Touch Sensors • Sound Sensors • IR Sensors • Sonar Sensors • Light Sensors • Tilt Sensors • Accelerometer • Gyro • Gripper Hands (to replace hands included with robot)‏ • Camera • Different-colored head/brackets

  5. Stand up (useful if the robot falls on its back or its stomach)‏ Left/Right kick Left/Right hand attack Fast walk “Fly” Handstand Dance List of Actions Included with the Robonova-1 • Standard Pose • Sit • Bend • Raise hands • Left/Right/Front punch • Tumble forward/backward • Cartwheel left/right • Turn left/right • Step forward/backward/left/right

  6. Writing Code for a Single Action A Glimpse of RoboBASIC

  7. GETMOTORSET G24, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0 SPEED 5 MOTOR G24 MOVE G6A,100, 76, 145, 93, 100, 100 MOVE G6D,100, 76, 145, 93, 100, 100 MOVE G6B,100, 30, 80, 100, 100, 100 MOVE G6C,100, 30, 80, 100, 100, 100 WAIT Writing Code for a Single Action • On the right is an example of what roboBASIC code looks like. This code tells the robot to move to its standard position. Before giving a more detailed explanation of how to program using this language, we will explain what this code block does.

  8. GETMOTORSET G24, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0 Writing Code for a Single Action • This command is used to read the position of a set of servos, and to then set the servo positions. In this line, GETMOTORSET reads the positions of all servos (G24 refers to all servos under the control of the board), and then sets each to the values listed after G24. A “1” tells the Robonova-1 to keep the position of the servo as-is, while a “0” tells the Robonova-1 to change the servo to its initial position. It is best to put this at the beginning of all programs, because it sets the servos to positions that will ensure that it starts moving safely.

  9. SPEED 5 Writing Code for a Single Action • This command is rather straightforward; it sets the speed of the servo movement. The higher the value after SPEED, the faster the robot will move. Values can range between 1 and 20, but it is best to keep most movements at 10 or lower for stability (any value higher than 15 is likely to cause problems with an unmodded robot). For very fast movements there is a HIGHSPEED command, which will be touched on later.

  10. MOTOR G24 Writing Code for a Single Action • This command turns on the output port of the specified servo set (in this case, all of them). In other words, it opens the servo ports so that your code can talk to the servos and tell them to move. If planning on having all body parts of the robot move during your routine, this is a must-have piece of code at the beginning of the file.

  11. MOVE G6A,100, 76, 145, 93, 100, 100 MOVE G6D,100, 76, 145, 93, 100, 100 MOVE G6B,100, 30, 80, 100, 100, 100 MOVE G6C,100, 30, 80, 100, 100, 100 Writing Code for a Single Action • These lines are what actually move the Robonova-1. The command MOVE is followed by the set of servos you want to move (more info about what G6A, etc mean on the next slide). • 100 is the initial value for servo positions; values above 100 move the servos clockwise, while values below 100 move the servos anti-clockwise.

  12. A: Servos 0-5 B: Servos 6-11 C: Servos 12-17 D: Servos 18-23 Writing Code for a Single Action • Besides the group G24, there are 4 subsets of servos that one can concentrate on. Each set can control six servos at a time.

  13. Writing Code for a Single Action To the right is a diagram to show what servo corresponds to what number in the motor group. As you can see: • Group A mostly controls the left leg • Group B mostly controls the left arm • Group C mostly controls the right arm • Group D mostly controls the right leg

  14. WAIT Writing Code for a Single Action • Last but not least is the WAIT command. This command tells the servos to wait until every specified motor set has finished moving before going onto whatever code comes after the movement. This is particularly useful if you plan on having multiple movements in one routine.

  15. Using Multiple Commands in a Single Program A Glimpse of RoboBASIC

  16. Using Multiple Commands in a Single Program • There are ways to program the Robonova-1 to execute multiple movements in succession, as well as ways to program it to loop through commands, or to read input from the remote control and act accordingly. Each will be described briefly.

  17. GETMOTORSET G24, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0 SPEED 5 MOTOR G24 ‘standard pose MOVE G6A,100, 76, 145, 93, 100, 100 MOVE G6D,100, 76, 145, 93, 100, 100 MOVE G6B,100, 30, 80, 100, 100, 100 MOVE G6C,100, 30, 80, 100, 100, 100 WAIT ‘bend SPEED 8 MOVE G6A, 100, 58, 135, 160, 100, 100 MOVE G6D, 100, 58, 135, 160, 100, 100 MOVE G6B, 100, 30, 80, , , , MOVE G6C, 100, 30, 80, , , , WAIT ‘standard pose MOVE G6A,100, 76, 145, 93, 100, 100 MOVE G6D,100, 76, 145, 93, 100, 100 MOVE G6B,100, 30, 80, 100, 100, 100 MOVE G6C,100, 30, 80, 100, 100, 100 WAIT Programming a Chain of Movements • This program will cause the robot to move to its standard pose, take a bow, then return to its standard pose. Putting a quotation mark before a line is how one comments out a line of code. As you can see, having one move succeed another is as easy as putting the new servo values after the previous move.

  18. DIM I AS INTEGER DIM X AS INTEGER X = 2 FOR I = 0 TO 10 IF X < 10 THEN ‘bend SPEED 8 MOVE G6A, 100, 58, 135, 160, 100, 100 MOVE G6D, 100, 58, 135, 160, 100, 100 MOVE G6B, 100, 30, 80, , , , MOVE G6C, 100, 30, 80, , , , WAIT ‘standard pose MOVE G6A,100, 76, 145, 93, 100, 100 MOVE G6D,100, 76, 145, 93, 100, 100 MOVE G6B,100, 30, 80, 100, 100, 100 MOVE G6C,100, 30, 80, 100, 100, 100 WAIT ENDIF X = X + 4 NEXT Using For Loops, If Statements • For loops and if statements are included in RoboBASIC and are similar to their BASIC parallels. • For the interval in the for loop one has to take a predefined variable (in this case, I), set it to an initial value (0), and choose a value to increase the initial value to (10). The end of the for loop is signified by the NEXT command. • For the if statement, one chooses a predefined variable with a value (X), determines the condition of the statement (X < 10), then gives a command for the program should that condition be fulfilled. If statements are then ended by the ENDIF command. • This is a good time to also point out how to declare variables in RoboBASIC. The syntax is basically, DIM (variable letter) AS (variable type; only bytes and integers are supported). Assigning variables is rather similar to most other languages: variable name = value.

  19. MAIN: A = REMOCON(1) IF A <> 1 THEN GOTO MAIN SPEED 8 GOSUB bow_pose DELAY 1000 SPEED 6 GOSUB standard_pose GOTO MAIN Reading from the Remote Control • RoboBASIC already has commands to read in values for sensors, and has a command that specifically reads the input sent from the remote to the robot. In this code we are trying to have the robot bow if the user presses 1 on the remote control pad. A is a predefined variable that stores the value coming from the first instance of REMOCON (in other words, the first controller to send data to it). If A isn’t 1 (A <> 1), then the code restarts at the beginning of MAIN (GOTO MAIN); otherwise, it goes to another function that defines the bow position, delays the robot’s movement for a second (DELAY 1000), then moves the robot to its standard position and loops back to the beginning of MAIN.

  20. read_bluetooth: ERX 57600, X, read_bluetooth RETURN Reading from Serial Device • This bit of code will read and store a byte sent over a serial connection with a baud rate of 57600, and will loop back to the beginning of read_bluetooth until it gets a byte. When it does get a byte, it stores it in X and then returns to the part of the code that called the function. • ERX (baud rate), (predefined byte variable), (location in code to go to if byte is not read)‏

  21. Things to Note When Reading From a Bluetooth Device • The Robonova-1's board works with TTL, not RS-232. To get bluetooth working you will need a converter.

  22. Via RoboBasic v2.5 Using the Catch-and-Play Features

  23. Catch-and-Play • You can pull up this screen by going to the menu and clicking Control -> Servo Motor Real-Time Control. • To use the catch-and-play feature, you first unselect all of the servos that you want to move. This is about the equivalent of MOTOR. After that, you move the robot into the position you want, then make sure that all boxes are checked again. This is the equivalent of GETMOTORSET. Finally, to add the new position to your code, press the Move Insert button of each motor group. Don’t forget to add a WAIT command at the end! • You can also use this window to learn more about servo position values, in case you’re interested in correctly coding these values without having to use the catch-and-play interface.

  24. Quick Index of RoboBASIC Commands A Deeper Glimpse at RoboBASIC

  25. Jumps to a specified part of program and executes all code henceforth Jumps to specified part of program and executes code until a RETURN is reached Returns from a subroutine to the point where the subroutine was called End the program Stop the program Run the program continuously Wait until the program has finished before moving on Delay the execution of the next line of code (value in milliseconds)‏ Pause the program and switch to debug mode General Program Commands • GOTO [function] • GOSUB [function] • RETURN • END • STOP • RUN • WAIT • DELAY [time] • BREAK

  26. Declare a variable as a type Declare a constant variable Used with DIM...AS to declare an integer variable Used with DIM...AS to declare a byte variable Commands Related to Variables • DIM [variable] AS [type] • CONST • INTEGER • BYTE

  27. Start a conditional statement Start a secondary conditional statement Set a default statement for when no conditions have been met End a set of conditional statements Start a for loop End a for loop or iterate variable to next value For Loops/If Statements • IF...THEN • ELSEIF...THEN • ELSE • ENDIF • FOR...TO • NEXT

  28. < > <= >= = <> Supported Logical Expressions • AND • OR • XOR • NOT

  29. Read signal from input port Send signal to output port Read a byte from input port Send a byte to the output port Reduce chattering Get status of output port Send pulse signal to output port Reverse status of output port Receive input from analog keyboard Digital Signal Commands • IN [port#] • OUT [port#], [outputValue] • BYTEIN [port#] • BYTEOUT [port#], [outputValue] • INKEY [port#] • STATE [port#] • PULSE [port#] • TOGGLE [port#] • KEYIN [ADPort], [#keys]

  30. Read data from controller RAM Write data to controller RAM Read data from external EEPROM RAM Write data to external EEPROM RAM Memory Commands • PEEK [region] • POKE [region], [byteData] • ROMPEEK [region] • ROMPOKE [region], [byteData]

  31. Initialize LCD module Clear all characters displayed on LCD Set x/y coordinates of the characters displayed in the LCD Display letter in LCD Set type format of characters on LCD Turn cursor in LCD on Turn cursor in LCD off Set letter contrast Send decimal character to LCD (used with FORMAT)‏ Send hexadecimal character to LCD (used with FORMAT)‏ Send binary character to LCD (used with FORMAT)‏ LCD Screen Commands • LCDINIT • CLS • LOCATE [x],[y] • PRINT [charString], [ASCIInumber] • FORMAT [var], [type], [position] • CSON • CSOFF • CONT • DEC • HEX • BIN

  32. Set neutral angle of servo Turn on the output port of the servo Turn off the output port of the servo Move a set of servos to specified positions Set the speed of the servos (1-15; 3 is initial)‏ Set the direction of the servos Turn simultaneous control of servos on/off Control a particular servo Motor/Servo Commands • ZERO [motor0_neutral]... [motorN_neutral] • MOTOR [motor#] • MOTOROFF [motor#] • MOVE [motor0_angle]...[motorN_angle] • SPEED • DIR • PTP • SERVO

  33. Set pulse width control for DC motor Set pulse width and frequency Allow/disable servos to move in “fast mode” Operate servos at maximum speed Set a position for the robot Move to specified POS Move all 24 servos at the same time Read in the motor values for the current position Get the current servo values and determine whether to keep them or set them to their initial positions (1 = keep, 0 = initialize)‏ Set initial pose Even More Motor/Servo Commands • PWM • FPWM • HIGHSPEED • FASTSERVO • POS • MOVEPOS • MOVE24 • MOTORIN • GETMOTORSET • INIT

  34. Control motors via an AI motor Turn off AI motor Read position values from AI motor Use in conjunction with other commands to enter setup mode Cancel setup mode Use in conjunction with other commands to enter setup mode for all servos Cancel setup mode for all servos Last Batch of Motor/Servo Commands • AIMOTOR • AIMOTOROFF • AIMOTORIN • SETON • SETOFF • ALLON • ALLOFF

  35. Assign servos 0-5 to group A Assign servos 6-11 to group B Assign servos 12-17 to group C Assign servos 18-23 to group D (not available for original robot)‏ Assign servos 24-29 to group E (not available for original robot)‏ Assign servos 0-7 to group A Assign servos 8-15 to group B Assign servos 16-23 to group C Assign servos 24-31 to group D (not available for original robot)‏ Assign servos 0-11 Assign servos 0-15 Assign servos 0-23 Assign servos 0-31 (not available for original robot)‏ Assigning Motor Group Commands • G6A • G6B • G6C • G6D • G6E • G8A • G8B • G8C • G8D • G12 • G16 • G24 • G32

  36. Plays a note based on inputted frequency/duration Plays a string of notes based on inputted note information Sets the tempo of the song/sound Sound Commands • SOUND [pitch],[length] • MUSIC [stringOfNotes] • TEMPO [value]

  37. 1 = whole note 2 = half note 3 = dotted half note 4 = quarter note 5 = dotted quarter note 8 = 8th note 9 = dotted 8th note 6 = 16th note 7 = dotted 16th note 0 = 32nd note MUSIC Command (More Detail)‏ • Scale starts at, C (CDEFGAB)‏ • # = sharp note • $ = flat note • <space>, P = rest • > = raise an octave • < = lower an octave • L = Low Octave • M = Middle Octave • H = High Octave • T = change tempo

  38. MUSIC “M4GGAA GGE GGEED” MUSIC “DE#FGAB>#CD” MUSIC Command (Even More Detail)‏ • Extra notation is placed before the actual note • Song is written as a string of notes

  39. Reads a byte from a RS-232 connection through the RX port (goes to ErrorProcessFunction if byte is either not received or is invalid)‏ Sends a byte through the TX port using the RS-232 connection Reads analog signal from device connected to specified AD port Reads signal from remote control/virtual REMOCON Reads distance being measured by the ultrasonic wave port (lower controller port = output ultrasound port, higher controller port = input ultrasound port)‏ Reads signal from RC remote control Sets direction of motor group when they are connected to a specified gyro Assigns gyro to particular set of servos Sets sensitivity of servo group to the gyro External Communication Commands • ERX [baudRate],[byteVar],[ErrorProcessFunction] • ETX [baudRate], [byteVar] • AD(<ADPort>)‏ • REMOCON(1)‏ • SONAR(<UltrasoundPort>)‏ • RCIN(<RCPort>)‏ • GYRODIR [group],[motorDirection] • GYROSET [group],[gyroPort] • GYROSENSE [group],[byteSensitivityValue]

  40. Ultrasound Port # Ultrasound Port Information • Digital In/Out Controller Port # Port #0 #0 Ultra-sonic Port output Port #1 #0 Ultra-sonic Port input Port #2 #1 Ultra-sonic Port output Port #3 #1 Ultra-sonic Port input Port #4 #2 Ultra-sonic Port output Port #5 #2 Ultra-sonic Port input Port #6 #3 Ultra-sonic Port output Port #7 #3 Ultra-sonic Port input Port #8 #4 Ultra-sonic Port output Port #9 #4 Ultra-sonic Port input Port #10 #5 Ultra-sonic Port output Port #11 #5 Ultra-sonic Port input Port #12 #6 Ultra-sonic Port output Port #13 #6 Ultra-sonic Port input Port #14 #7 Ultra-sonic Port output Port #15 #7 Ultra-sonic Port input Port #16 #8 Ultra-sonic Port output Port #17 #8 Ultra-sonic Port input Port #18 #9 Ultra-sonic Port output Port #19 #9 Ultra-sonic Port input Port #20 #10 Ultra-sonic Port output Port #21 #10 Ultra-sonic Port input Port #22 #11 Ultra-sonic Port output Port #23 #11 Ultra-sonic Port input

  41. Gyro Port # Gyro Port Information Port #0 (Port #32) Gyro #1 channel output Port Port #1 (Port #33) Gyro #2 channel output Port Port #2 (Port #34) Gyro #3 channel output Port Port #3 (Port #35) Gyro #4 channel output Port Port #4 (Port #36) Gyro #1 channel input Port Port #5 (Port #37) Gyro #2 channel input Port Port #6 (Port #38) Gyro #3 channel input Port Port #7 (Port #39) Gyro #4 channel input Port • AD Port #

  42. 57600 76800 115200 230400 Baud Rates SupportedAll with 8-bit data, no parity, 1 stop bit • 2400 • 4800 • 9600 • 14400 • 19200 • 28800 • 38400

  43. Get a random byte number Another way of commenting code Go to a specified section of the code when a variable is of a certain value (simpler version of long if/elseif block)‏ Set controller that will run the program once compiled Set a servos' maximum rotation angle (default 10-190)‏ Random Commands • RND • REMARK [Description] • ON [variable] GOTO [function] • $DEVICE [Controller] • $LIMIT [Motor#],[MinValue],[MaxValue]

  44. standardPose()‏ bend()‏ sit()‏ step(distance, direction)‏ Can step forward, backward, left, or right turn(angle, direction)‏ Can turn left or right standUp(direction)‏ Can get up from the front or the back Using the Robonova-1 with Myro • The commands on the right are the ones available in Myro that are specific to the Robonova-1 (for actions that are available to any robot with a fluke, such as taking pictures, see the Myro documentation on wiki.roboteducation.org).

  45. Finit

More Related