You are on page 1of 7

Lab6/ACS/E5123/_______

LAB NO. TITLE OBJECTIVE ; : : 6 ROBOTIC ARM PROGRAMMING i. To introduce the basic programming of robotic arm. To familiarize the students with the basic program which produce servo motor rotation for each axis. iii. To familiarize the students with the program code downloading to MCU procedures. Laptop, robotic arm ABLELOGIC RBT-500A and PIC-PRG2 USB PIC programmer.

ii.

EQUIPMENTS: THEORY SERVO MOTOR: :

A servo motor is an electromechanical device in which an electrical input determines the position of the armature of a motor. A normal servo is applied to control an angular motion of between 0 and 180 degrees for each axis. Servo is controlled by sending a pulse of variable width or PWM. The control wire is used to send this pulse which is usually yellow in color while the black wire will be GND and the red color will be VCC. The servo motor expects to see a pulse every 20 ms. The width of the pulse will determine the turning angle of the servo motor.
1 ms 0 degree 20 ms 1.5 ms neutral 20 ms 2 ms 180 degree 20 ms

Neutral is defined to be the position where the servo has exactly the same amount of potential rotation in the clockwise direction as it does in the counter clockwise direction. It is important to note that different servos will have different constraints on their rotation but they all have a neutral position and that position is always around 1.5 ms. PROGRAM THE ROBOTIC ARM: The operation of all the robotic arm servos are all controlled by a microcontroller board which is located and mounted inside the main base unit(not visible to user). A PIC16F877A MCU is used to run programs that control the operation of the motors. In order to program this robotic arm to run users own written program, PIC-PRG2 USB PIC programmer will be used to download users program to the MCU via the ICSP interface port.

1/7

Lab6/ACS/E5123/_______
BASIC STEPS IN USING THE PIC-PROG2 USB PROGRAMMER:

1.
2. 3. 4.

Please ensure to push the ICSP switch to the PROGRAM position. Plug in the USB cable to the PC. Open the WinPic800 software. The software language can be chose at the language tab.

5.

Then, click the Setting tab follow by hardware as shown in the figure below.

2/7

Lab6/ACS/E5123/_______

6.

Make sure the hardware setting is as below. Then, click Apply edits.

7.

Please ensure 16f877a is shown in PIC family selection. Then, click the File tab follow by Open to select desired hex file. Click Program icon to program the IC.

8. 9.

10. Finally, push the ICSP switch to the RUN position and observe the resulting movement.

3/7

Lab6/ACS/E5123/_______
PROCEDURE :

1. 2.
3. 5. 6.

Open the MicroCode Studio software. Then, click the File tab follow by New. Write down the given program in the untitled window. Then, click the Project tab follow by Compile. Download the hex file into PIC16F877a. Show the resulting movement to your labs instructor to get their endorsement for each experiment.

4.

EXPERIMENT 1: Base VAR BYTE TRISB=0 PORTB=0 Base = 80 loop: PULSOUT PORTB.1,Base PAUSE 20 goto loop Lecturer signature: EXPERIMENT 2: Base VAR BYTE TRISB=0 PORTB=0 Base = 210 loop: PULSOUT PORTB.1,Base PAUSE 18 goto loop Lecturer signature: Date: Date:

4/7

Lab6/ACS/E5123/_______

EXPERIMENT 3: temp VAR BYTE Base VAR BYTE

TRISB=0 PORTB=0 loop: FOR

temp = 0 TO 150 Base = 80 PULSOUT PORTB.1,Base PAUSE 20

NEXT FOR temp = 0 TO 150 Base = 200 PULSOUT PORTB.1,Base PAUSE 18

NEXT goto loop Lecturer signature: EXPERIMENT 4: temp VAR BYTE Shoulder VAR BYTE Date:

TRISB=0 PORTB=0 loop: FOR

NEXT FOR

temp = 0 TO 150 Shoulder = 170 PULSOUT PORTB.2,Shoulder PAUSE 20

NEXT

temp = 0 TO 150 Shoulder = 230 PULSOUT PORTB.2,Shoulder PAUSE 18

goto loop

5/7

Lab6/ACS/E5123/_______
Lecturer signature: EXPERIMENT 5: temp VAR BYTE Elbow VAR BYTE Supporter VAR BYTE Date:

TRISB=0 PORTB=0

loop: FOR temp = 0 TO 150 Elbow = 100 Supporter = 210 PULSOUT PORTB.3,Elbow PULSOUT PORTB.2,Supporter PAUSE 20

NEXT FOR

temp = 0 TO 150 Elbow = 210 Supporter = 210 PULSOUT PORTB.3,Elbow PULSOUT PORTB.2,Supporter PAUSE 18

NEXT goto loop Lecturer signature: Date:

6/7

Lab6/ACS/E5123/_______
DISCUSSIONS :

1.

Discuss the movement of robotic arm for each experiment above.

CONCLUSION : 1. Write the conclusion for this experiment with your own words.

7/7

You might also like