-->

Using a Robot Arm with FUZE BASIC

As part of the educational kit, the FUZE Workstation can be purchased with an accompanying robot arm. This is a 149 piece kit-form robotic arm, that requires assembly and is powered by four D-type batteries. It’s connected to the RPi or FUZE via a USB cable and is also Windows compatible.

I, ROBOT


We won’t go into the construction of the robot arm here, the instructions which come with the arm are easy to follow and it can be completed and ready for use within a couple of hours or so. Let’s look at how to get it working.

Step 1

The robot arm is one of the first external hardware components that was released and fully compatible with the Raspberry Pi; as such, it’s an excellent project to get into, from the construction of the arm itself, to operating it via the FUZE Workstation.

Using a Robot Arm with FUZE BASIC
Using a Robot Arm with FUZE BASIC


Step 2

Start by plugging the robot arm into one of the spare USB ports on the back of the FUZE workstation. Ensure that the arm has its batteries correctly in place and that its power switch is On. Now open FUZE BASIC and remain in the Immediate Mode.



Step 3

To begin with, let’s look at a few commands to make the robot arm move. In Immediate Mode, in FUZE BASIC, enter:

ArmBody (1)

This starts the arm rotating clockwise (looking down on it).



Step 4

Once the arm begins to rotate clockwise it will get to the limit of its range and start clicking. When it starts this quickly enter the command:

ArmBody (0)

This will stop the arm from moving.



Step 5

Now enter:

ArmBody (-1)

This will start moving the arm anti-clockwise. Again, when it starts to click enter the command:

ArmBody (0)

To stop it from moving.



Step 6

The other commands to make the arm move are:

  1. ArmShoulder (x) – where x can be 1, -1
  2. or 0
  3. ArmElbow (x) – where x can be 1, -1 or 0
  4. ArmWrist (x) – where x can be 1, -1 or 0
  5. ArmGripper (x) – where x can be 1 -1, or 0
  6. ArmLight (x) – where x can be 1 or 0

Note: you can press the up arrow key to re-enter the previously typed commands, so you can quickly stop the arm’s movement when it reaches its limit.



Step 7

Let’s create a program allowing you to move the arm around freely. There are some new commands here: PROC and DEF PROC, that enables BASIC to jump to a PROCedure, another part of the program, then back with ENDPROC. FONTSCALE determines the size of the on-screen print display and HVTAB is an X and Y coordinate system to print on-screen.



Step 8

Press F2, and type in the following:

  1. PROC ResetArm
  2. PROC DisplayInstructions
  3. End
  4. DEF PROC ResetArm
  5. ArmBody (0)
  6. ArmShoulder (0)
  7. ArmElbow (0)
  8. ArmWrist (0)
  9. ArmGripper (0)
  10. ArmLight (0)
  11. ENDPROC
  12. DEF PROC DisplayInstructions
  13. CLS
  14. FONTSCALE (2,2)
  15. Ink = Red
  16. Print “I, Robot”
  17. Ink = White
  18. HVTAB (0,2)

This is the start of the program, resetting the arm and preparing the on-screen display.



Step 9

Now to expand the program to control the arm:

  1. Print “Press:”
  2. Print
  3. Print “1 or 2 for Body Left & Right”
  4. Print “3 or 4 for Shoulder Up & Down”
  5. Print “5 or 6 for Elbow Up & Down”
  6. Print “7 or 8 for Wrist Up & Down”
  7. Print “9 or 0 for Gripper Open & Close”
  8. Print “Enter to turn the Light On or Off”
  9. Ink = Red
  10. Print “Spacebar to stop all movement and turn off
  11. the light.”
  12. ENDPROC



Step 10

Now we need to process the user input. There’s a lot here but type the content as shown in the screenshot. Save the code and Run; you can now control the robot arm using the number keys 1 to 0, the Enter key for the light and Spacebar to reset everything.

0 Response to "Using a Robot Arm with FUZE BASIC"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel