Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

3 wheel robot with servo motor and 8951

Status
Not open for further replies.

pei_jet

New Member
i need help in building the robot... i don't know where to start and not very good in programming.. i wish someone can provide me with some sites that offer schematics as well as the program itself....
 

falleafd

New Member
First of all, I think you must understand the 3 wheel robot. It's palm pilot project, first published by cmu.

( I don't know if 3 wheel mean the NEWT model or palm pilot).

|__________|
| |
| |
| |-| |-|| <---- wheels
| |_| |_||
| |
| free |
| wheel |
____________



If this is your project, its NEWT model. All you have to do is to drive the two motors. You may use a H brigde, and pls take a look for an example of L298. You will see wat you need to output from a microcontroller.

I send here an easy code, that the robot will go forward until its bumper ON, then turn around, and continue to go forward. It's writen on 8951, it's similar to 8952.

Code:
	ORG	0000H
		LJMP MAIN
		ORG 0030H
MAIN:	MOV	R1,#01H
		MOV	R2,#00H
		MOV	R3,#00H
		MOV	R4,#00H
		MOV	A,P1
		MOV P2,A
		CJNE A,#0FFH,CHECK
		JMP MOVE
CHECK:	MOV	R1,#00H
CHKB3:	JB	ACC.3,CHKB1
		MOV	R2,#04H
CHKB1:	JB	ACC.1,CHKB2
		MOV	R2,#02H
CHKB2:	JB	ACC.2,CHKB0
		MOV	R2,#03H
CHKB0:	JB	ACC.0,CHKB5
		MOV	R2,#01H
CHKB5:	JB	ACC.5,CHKB4
		MOV	R3,#06H
CHKB4:	JB	ACC.4,CHKB6
		MOV	R3,#05H
CHKB6:	JB	ACC.6,MOVE
		CJNE R2,#01H,MOVE
		MOV	R2,#00H
		MOV	R3,#00H
		MOV	R4,#01H
MOVE:		MOV A,R4
		JNZ STOP
		MOV	A,R2
		ADD	A,R3
		JNZ	TURN
FWR:		MOV P0,#44H
		MOV R0,#55
LPFW1:		MOV R1,#5
		DJNZ R1,$
		DJNZ R0,LPFW1
		MOV P0,#04H
		MOV R0,#25
LPFW2:		MOV R1,#5
		DJNZ R1,$
		DJNZ R0,LPFW2
		MOV P0,#00H
		MOV R0,#20
LPFW3:		MOV R1,#5
		DJNZ R1,$
		DJNZ R0,LPFW3
		LJMP MAIN
TURN:		MOV P0,#00H
		MOV R4,#255
LPTSP1:	MOV R0,#100
LPTSP2:	MOV R1,#15	
		DJNZ R1,$
		DJNZ R0,LPTSP2
		DJNZ R4,LPTSP1
RSV:		MOV R4,#255
LPTR:		MOV P0,#0D4H
		MOV R0,#80
LPTR1:		MOV R1,#15	
		DJNZ R1,$
		DJNZ R0,LPTR1
		MOV P0,#0C0H
		MOV R0,#80
LPTR2:		MOV R1,#15
		DJNZ R1,$
		DJNZ R0,LPTR2
		DJNZ R4,LPTR
		LJMP MAIN		
STOP:		MOV P0,#00H
		MOV	R0,#100
LPSTP:		MOV R1,#15
		DJNZ R1,$
		DJNZ R0,LPSTP
		LJMP MAIN
FINI:		SJMP $	
		END

My friend wrote this for a toy bumper robot, but she use TA7288P, and I dont remember the pins.
 

falleafd

New Member
First of all, I think you must understand the 3 wheel robot. It's palm pilot project, first published by cmu.

( I don't know if 3 wheel mean the NEWT model or palm pilot).

|__________|
|__________|
|__________|
|_|-|____ |-|| <---- wheels
|_|_|____|_||
|__________|
|____free___|
|___ wheel__|
____________



If this is your project, its NEWT model. All you have to do is to drive the two motors. You may use a H brigde, and pls take a look for an example of L298. You will see wat you need to output from a microcontroller.

I send here an easy code, that the robot will go forward until its bumper ON, then turn around, and continue to go forward. It's writen on 8951, it's similar to 8952.

Code:
	ORG	0000H
		LJMP MAIN
		ORG 0030H
MAIN:	MOV	R1,#01H
		MOV	R2,#00H
		MOV	R3,#00H
		MOV	R4,#00H
		MOV	A,P1
		MOV P2,A
		CJNE A,#0FFH,CHECK
		JMP MOVE
CHECK:	MOV	R1,#00H
CHKB3:	JB	ACC.3,CHKB1
		MOV	R2,#04H
CHKB1:	JB	ACC.1,CHKB2
		MOV	R2,#02H
CHKB2:	JB	ACC.2,CHKB0
		MOV	R2,#03H
CHKB0:	JB	ACC.0,CHKB5
		MOV	R2,#01H
CHKB5:	JB	ACC.5,CHKB4
		MOV	R3,#06H
CHKB4:	JB	ACC.4,CHKB6
		MOV	R3,#05H
CHKB6:	JB	ACC.6,MOVE
		CJNE R2,#01H,MOVE
		MOV	R2,#00H
		MOV	R3,#00H
		MOV	R4,#01H
MOVE:		MOV A,R4
		JNZ STOP
		MOV	A,R2
		ADD	A,R3
		JNZ	TURN
FWR:		MOV P0,#44H
		MOV R0,#55
LPFW1:		MOV R1,#5
		DJNZ R1,$
		DJNZ R0,LPFW1
		MOV P0,#04H
		MOV R0,#25
LPFW2:		MOV R1,#5
		DJNZ R1,$
		DJNZ R0,LPFW2
		MOV P0,#00H
		MOV R0,#20
LPFW3:		MOV R1,#5
		DJNZ R1,$
		DJNZ R0,LPFW3
		LJMP MAIN
TURN:		MOV P0,#00H
		MOV R4,#255
LPTSP1:	MOV R0,#100
LPTSP2:	MOV R1,#15	
		DJNZ R1,$
		DJNZ R0,LPTSP2
		DJNZ R4,LPTSP1
RSV:		MOV R4,#255
LPTR:		MOV P0,#0D4H
		MOV R0,#80
LPTR1:		MOV R1,#15	
		DJNZ R1,$
		DJNZ R0,LPTR1
		MOV P0,#0C0H
		MOV R0,#80
LPTR2:		MOV R1,#15
		DJNZ R1,$
		DJNZ R0,LPTR2
		DJNZ R4,LPTR
		LJMP MAIN		
STOP:		MOV P0,#00H
		MOV	R0,#100
LPSTP:		MOV R1,#15
		DJNZ R1,$
		DJNZ R0,LPSTP
		LJMP MAIN
FINI:		SJMP $	
		END

My friend wrote this for a toy bumper robot, but she use TA7288P, and I dont remember the pins.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Top