How to make super Simple Beginners Robot Part-2

How to make super Simple Beginners Robot Part-1

Step 9Install servos


Install servos
Super glue the servos to the bottom side of the plywood base and up against the servo / IR mount. It only takes a drop or two..

Route the servo wires through the holes in the servo / IR mount as shown. 

Step 10Install the microcontroller


Install the microcontroller
Install the microcontroller on the standoffs as shown.

It may be necessary to place a washer on each standoff to lift the microcontroller over the tailwheel assembly depending on your layout skills.

Secure the microcontroller with either 4-40 nuts or 2.5 inch female to male standoffs (shown) for the **SPECIAL** add on later.

Step 11Install wheels


Install wheels
This step is a biggy... Install your wheels of choice and adjust the tailwheel do that the base sites level or slightly rear low.

Instuctable goody: I have extra sets of the wheels out in the shop, email for details.

Step 12Add a battery


Add a battery
Double sticky tape the battery in the space behind the servos and in front of the tailwheel on the bottom of the base. The battery needs to sit on edge to fit.

If you are building the **SPECIAL** version you can wait and use the upstairs space to mount the battery.

Step 13Plug in the servos


Plug in the servos

Plug the left servo into oopic servo port 31. Right most 3 pin port.
Plug the right servo into oopic servo port 30.

Look for the two servo connectors with yellow wires in the image notes at the rear of the picture. 

Step 14Install the IR


Install the IR
Super glue the Sharp GP2D12 over the holes/wires on the front mount.

Mount the IR as high as you can to minimize floor reflections.

Place it wires up and you can see a little relief in the plastic case for the servo wires to fit behind. 

Step 15Wire the IR


Wire the IR
The hardest part of the whole robot, trust me.
On each of the wires for the GP2D12 place a 1 inch piece of heat shrink tubing. Slide it way out of the way.

Solder (or crimp) a single female crimp pin receptacle on to each wire.

OPTIONAL - NOT RECOMMENDED FOR NON SOLDERERS!
You can solder the end of the wire just to the tip of the needed microcontroller pins and slide the heat shrink over it to protect from shorting. It must be done fast and carefully.

Slide the heat shrink tubing flush to the face of the crimp receptacle.

Using a lighter of heat gun shink the tubing.

Sorry, I could not get a good picture all all of this small stuff.

Find any open 5 volt pin on the oopic and plug the red GP2D12 wire into it. There are lots of them. I used a spare 5 volt from the 12C port. Shown in the image notes.

Find any open GND pin on the oopic and plug the black GP2D12 wire into it. There are lots of them. I used a spare GND from the 12C port. Shown in the image notes.

Find pin3 and plug the white GP2D12 wire into it. 

Step 16Source Code


Source Code
UPDATED 2/16/09
SOURCE CODE FOR THE SONAR OPTION IN THE NEXT STEP (SPECIAL STUFF)

Follow the directions for your microcontroller and cut and paste this code into the editor. Compile and send to the robot.

The code is ultra simple but the bot avoids most obstacles it sees. It is easy to take my code and expand upon it.

'SuperSimpleBeginnersRobot
'www.instructables.com
'Ted Macy
'ted@oobug.com
'2/16/09
'-----------------------------------------------------------------
' Create and Setup Objects
'-----------------------------------------------------------------
Dim Servo_Right As New oServo
Dim Servo_Left As New oServo
Dim SRF04Servo As New oServo
Dim GP2D12 As oIRRange(3,8,cvOn)
Dim SRF04 As oSonarDV(8,9,cvOn)

SRF04Servo.IOLine=29 'Set the servo to use I/O Line 30.
SRF04Servo.Center=28 'Set the servos center to 28. (see manual)
SRF04Servo.Operate=cvTrue 'Last thing to do, Turn the Servo on.
Servo_Right.IOLine = 30 'Set the servo to use I/O Line 30.
Servo_Right.Center = 28 'Set the servos center to 28. (see manual)
Servo_Right.Operate =cvTrue 'Last thing to do, Turn the Servo on.
Servo_Left.IOLine = 31 'Set the servo to use I/O Line 31.
Servo_Left.Center = 28 'Set the servos center to 28. (see manual)
Servo_Left.Operate =cvTrue 'Last thing to do, Turn the Servo on.
'-----------------------------------------------------------------
' End Create and Setup Objects
' Main routine is your primary routine called upon power up!
'-----------------------------------------------------------------
Sub main()
Do
Call IR
Call Forward_All
Call SServo
Loop
End Sub
'-----------------------------------------------------------------
' End of Main routine
' Start of Drive System Subroutines
'-----------------------------------------------------------------
Sub Spin_Left()
Servo_Left.Invert=0
Servo_Left = 62
Servo_Right = 60
End Sub

Sub Spin_Right()
Servo_Right.Invert=1
Servo_Left = 62
Servo_Right = 60
End Sub

Sub Forward_All()
Servo_Right.Invert=0
Servo_Left.Invert=1
Servo_Right = 60
Servo_Left = 62
End Sub

Sub REVERSE()
Servo_Right.Invert=1
Servo_Left.Invert=0
Servo_Right = 60
Servo_Left = 62
End Sub

Sub STOP()
Servo_Left = 0
Servo_Right = 0
Call SServo
End Sub
'-----------------------------------------------------------------
' End of Drive System Subroutines
' Start of Sensor Subroutines
'-----------------------------------------------------------------
Sub SServo()
SRF04Servo.Position=15
SRF04.Operate.Pulse(1,1,250)
If SRF04.Value<128 Then
Call Spin_Right
Else Call Forward_All
End If
ooPIC.Delay=600

SRF04Servo.Position=31
SRF04.Operate.Pulse(1,1,250)
If SRF04.Value<64 Then
Call REVERSE
Else Call Forward_All
End If
ooPIC.Delay=600

SRF04Servo.Position=46
SRF04.Operate.Pulse(1,1,250)
If SRF04.Value<128 Then
Call Spin_Left
Else Call Forward_All
End If
ooPIC.Delay=600

SRF04Servo.Position=31
SRF04.Operate.Pulse(1,1,250)
If SRF04.Value<64 Then
Call REVERSE
Else Call Forward_All
End If
ooPIC.Delay=600
End Sub

Sub IR()
If GP2D12.Value<64 Then
Call STOP
End If
End Sub
'-----------------------------------------------------------------
' End of Sensor Subroutines
'------------------------------------------------

1 Comments
Disqus
Fb Comments
Comments :

1 comment:

  1. Hi, I am visit at your blogs and see. Your blogs are very nice. It is high quality Digital servo. I am impressed from your services.

    ReplyDelete