Introduction: Autonomous/RC Human Bot

intro:18+
I am a 24 yr old student at York Technical Institute studying electrical engineering and this is my robot that I have been building for a project and wanted to share with all students, educators, and hobbyists.

This  robot can be controlled via a PC, remote control or Microcontroller.


Building a robot is all about creativity, how it is controlled, and intelligence.

This robot is built from:
  • 13 Parallax and hitec servos
  • home made pan and tilt head camera system
  • servo erector set brackets with ball bearings
  • erector set parts as body
  • lynx motion tank tread kit
  • wireless camera for live video streaming
  • parallax ping sensors
  • LED light strips for headlights (24 LEDs)
  • parallax Bs2 and bs2px microcontrollers
  • parallax Propeller microcontroller
  • 2 parallax HB-25 motor controllers
  • parallax Propeller usb servo controller
  • spektrum DX5e reciever and transmitter
  • 2 12 volt 6mm shaft (50:1 gear ratio) motors
  • parallax LCD screen
  • Misc. sensors
  • different software programs such as roborealm for object tracking and more.
  • Reedy LiPo 7.4V 1800mAh lithium battery pack
  • Reedy LiPo 14.8V 3600mAh lithium battery pack

Here is a link to my video of the robot
http://www.youtube.com/watch?v=lLuBOUzhSWc&feature=player_detailpage


http://www.youtube.com/watch?feature=player_profilepage&v=jgGu_RPKA-w

If you would like to build a robot similar to this but would rather make something cheap and easy all you need is what I included in my last page. I started with something much smaller and not as complex as this and in time I advanced. You can modify and change anything you want but you have to be creative and willing to learn. Enjoy!.





Step 1: Building the Base

The base of the robot consists of 6 very strong and durable lexan panels with a tri track tank tread kit that wraps around 6 sprockets on each side. The sprockets interlace with the treads like a timing chain  locking them in so that there is no slipping. The tracks replicate the real design and work very well even with higher speeds. Here is a step by step guide on how to build the base. After you assemble the base you can organize your electronics and make a plan on what to put onto the base. You can drill holes very easy to mount any extra parts if necessary. This base is fully customizable and can handle a good amount of weight.




Step 1.
Attach four 3" aluminum bars to the inside pair of lexan panels as shown. Use 4-40 x .375" hex screws. 
Step 2.
Attach 1.5" hex standoffs to the lexan panels as shown. Use 4-40 x .375" screws.
Step 3.
Attach the motors, using four 3mm x 8mm screws. Make sure the motor shafts and the hex standoffs are on the same side of the lexan panels.
 Step 4.
Install the hubs onto the motor shafts. Align the hub to be flush with the end of the motor shaft. Tighten the set screw down firmly.
Step 5.
Install the sprockets onto the hubs. Take your time to make sure teeth on the sprockets line up! Use two 4-40 x .625" screws per side.
Step 6.
Prepare the idler sprockets. Install the two sprocket halves back-to-back on the long end of the idler hub. Take care to make the teeth on the sprockets line up! Attach them with two 3mm x 8mm screws. Make four idler sprocket assemblies.
Step 7.
Attach ball bearings to the idler sprockets, depending on which version of the idler hub you have. Install the idler sprockets into the side panel. Slide twelve nylon bushings over the nylon standoffs.
Step 8.
Install the outer lexan panels to close up the assemblies. Use twelve 4-40 x .375" screws. 
Step 9.
Wrap the 21-segment track assembly around the sprockets, push the axel in and secure with two nylon snap rivet fasteners. These parts are included with the track kit, not the chassis kit.
Step 10.
Take a small  break.
Step 11.
Attach 1.5" hex standoffs to the bottom panel as shown. Use 4-40 x .375" screws.
Step 12.
Attach the top panel . Use six 4-40 x .375" screws.
Step 15.
Attach the track assemblies to the chassis. Use eight 4-40 x .375" screws.
You can install the  base rotate using the top screws from the standoffs.
Step 17.
Push the capacitor legs through the holes in the motor terminals. Bend the capacitor legs down onto the terminals.
Step 18.
Push the motor wire connectors onto the motor terminals. Make sure to put the red wires on (+) and the yellow wires on (-).



Step 2: The Body

The body is made up from many different erector set parts from Toys R Us and hobby stores. I also use lnynx C, H, and L brackets, Hitec servos and Parallax servos. I started off with some erector set parts, bolts, nuts and misc. bracktes and ended up with this. It has Lynx H misc. brackets mounted on the erector body to act as it's shoulders with metal gear Hitec servos mounted on each right and left bracket. Coming off each servo is more brackets with servos on them and ball bearings as well with the end result of human like arms. The functionability of these arms replicate the movements of humans with the degree of movement allowed. Picking up objects is a task that can be performed with the right program written or with the remote control.

Step 3: Electronics

The electronics I chose to use are all from Parallax. I am using 2 basic stamp usb board of education microcontrollers. One is a Basic Stamp bs2 and other is a high performance Stamp bs2PX. I am also using a propeller microcontroller which is inside the body. There is a Propeller servo controller, 24 LED lights and many different sensor including a temp sensor, accelerometer, and bluetooth sensor etc.

A BASIC Stamp is a single-board computer that runs the Parallax PBASIC language interpreter in its microcontroller. The developer's code is stored in an EEPROM, which can also be used for data storage. The PBASIC language has easy-to-use commands for basic I/O, like turning devices on or off, interfacing with sensors, etc. More advanced commands let the BASIC Stamp module interface with other integrated circuits, communicate with each other, and operate in networks.  

  • Controlling the servos is a Parallax Propeller USB servo controller which operates the arms. You can connect up to 15 servos on one board. The basic stamp microcontroller controls the servo controller making all the functions possible.
  • The motors are controlled from 2 Parallax HB-25 motor controllers which are also controlled from another Bs2 microcontroller.
  • I have many different sensors I use to take temperature readings, operate automatic headlights with darkness% and many other applications.
  • The microcontrollers are the brains of this machine and the possibilities are endless when it comes to the things you are able to do with some knowledge and experiments.

RC MODE:
As far as using a RC remote control to drive my robot, this is done with a 2.4GHzSpektrum DX5e system. The reciever is mounted onto the robot and the two drive motor wires are connected to the reciever. The HB-25 motor controller is ran on servo pulses so most RC systems will work with some modifications. With this technology and my wireless camera I can sit inside my home and drive my robot around the block and view everything from my PC. Very cool!!

This is a code I wrote to load into the processor in order to make this robot roam around autonomously. It roams around and when it encounters an object with its ping sensor that used to be mounted where the camera is it stops and scans the surrounding area for a clear path then resumes its mission. Learning how to program takes time but once you try it you will enjoy it and want to learn more. This is all done with the stamp editor software from parallax.


Run wires from ping to top 3 pin port 13
Run wires from servo to top 3 pin port 14
Run wires from HB-25 to top 3 pin port 15
HB-25 has its own power source with a switch.
jumper wires are ran from one HB-25 to the other connecting them together to be ran on one servo pulse.
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[Object Detection and Avoidance ]---------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

PingServo PIN 14 ' PING))) Servo
Ping PIN 13 ' PING))) Sensor
HB25 PIN 15 ' I/O Pin For HB-25

' -----[ Variables ]-------------------------------------------------------

pulseCount VAR Byte ' Used For Measuring Turns
distance VAR Word ' Current Distance Of Object
oldDistance VAR Word ' Old Distance Value
counter VAR Word ' PING))) Cycle Counter
task VAR Nib ' Current Task
index VAR Word ' Counter For Ramping

' -----[ Initialization ]--------------------------------------------------

DO : LOOP UNTIL HB25 = 1 ' Wait For HB-25 Power Up
LOW HB25 ' Make I/O Pin Output/Low
PAUSE 5 ' Wait For HB-25 To Initialize
PULSOUT HB25, 750 ' Stop Motor 1
PAUSE 1 ' 1 mS Delay
PULSOUT HB25, 750 ' Stop Motor 2


' -----[Main Code ]----------------------------------------------------

Main:
DO

counter = counter + 1 ' Increment Passive Counter

IF counter > 10 THEN
GOSUB Ping_Out
ENDIF

IF (distance > 40) THEN ' is distace greater than 40 cm??
GOSUB Forward_Pulse
ELSE
GOSUB Back_Up
GOSUB Ping_Around
ENDIF


LOOP



' -----[ Subroutines ]-----------------------------------------------------

Forward_Pulse:

FOR index = 250 TO 250 ' Ramp Up To Full Speed
PULSOUT HB25, 750 + index ' Motor 1 Forward
PAUSE 1 ' 1 mS Delay For Motor 2 Pulse
PULSOUT HB25, 750 - index ' Motor 2 Reverse
PULSOUT PingServo, 750 ' Ping Servo Forward Pulse Value
PAUSE 20
NEXT
RETURN

' *************************************************************************

Turn_Left:
FOR pulseCount = 1 TO 35 ' Left Turn, About 45 Degrees
PULSOUT HB25, 750 + index ' Motor 1 Forward
PAUSE 1 ' 1 mS Delay For Motor 2 Pulse
PULSOUT HB25, 750 + index ' Motor 2 Reverse
PULSOUT PingServo, 750 ' Ping Servo Forward Pulse Value
PAUSE 20
NEXT
RETURN

' *************************************************************************

Turn_Right: ' Right Turn, About 45 Degrees
FOR pulseCount = 1 TO 35 ' Number Of Pulses To Turn
PULSOUT HB25, 750 - index ' Motor 1 Forward
PAUSE 1 ' 1 mS Delay For Motor 2 Pulse
PULSOUT HB25, 750 - index ' Motor 2 Reverse
PULSOUT PingServo, 750 ' Ping Servo Forward Pulse Value
PAUSE 20
NEXT
RETURN

' *************************************************************************

Back_Up: ' Back Up
FOR pulseCount = 0 TO 5 ' Number Of Pulses To Backup
PULSOUT HB25, 750 ' Motor 1 stopped Fwd
PAUSE 1 ' 1 mS Delay For Motor 2 Pulse
PULSOUT HB25, 750 ' Motor 2 stopped Rev
PULSOUT PingServo, 750 ' Ping Servo Forward Pulse Value
PAUSE 20
NEXT
RETURN


Ping_Out: ' PING)))
counter = 0 ' Reset Passive Delay Counter
LOW Ping ' Force PING))) Line Low
PULSOUT Ping, 5 ' Activate PING))) Pulse
PULSIN Ping, 1, distance ' Receive Return Pulse
distance = distance ** 2257 ' Calculate Distance
RETURN

Ping_Around: ' Start 180 Degree Pan-Scan
counter = 0 ' Reset Passive Delay Counter
oldDistance = 30 ' Current Old Distance Values
task = 0 ' Current Task Priority

' *************************************************************************

FOR pulseCount = 0 TO 20 ' Number Of Pulses To Spin
LOW Ping ' Force PING))) Line Low
PULSOUT PingServo, 1085 ' Ping Servo 90 Left Pulse Value
PULSOUT Ping, 5 ' Activate PING)))
PULSIN Ping, 1, distance ' Receive Distance Value
PAUSE 20 ' Refresh Delay
NEXT

distance = distance ** 2257 ' Calculate Distance In cm
IF distance > oldDistance THEN ' Is distance > Last Clear Path
oldDistance = distance ' Update oldDistance Value
task = 1
ENDIF

' *************************************************************************

FOR pulseCount = 0 TO 20 ' Number Of Pulses To Spin
LOW Ping ' Force PING))) Line Low
PULSOUT PingServo, 850 ' Ping Servo 45 Left Pulse Value
PULSOUT Ping, 5 ' Activate PING)))
PULSIN Ping, 1, distance ' Receive Distance Value
PAUSE 20 ' Refresh Delay
NEXT

distance = distance ** 2257 ' Calculate Distance In cm
IF distance > oldDistance THEN ' Is distance > Last Clear Path
oldDistance = distance ' Update oldDistance Value
task = 2
ENDIF

' *************************************************************************

FOR pulseCount = 0 TO 20 ' Number Of Pulses To Spin
LOW Ping ' Force PING))) Line Low
PULSOUT PingServo, 400 ' Ping Servo 45 Right Pulse Value
PULSOUT Ping, 5 ' Activate PING)))
PULSIN Ping, 1, distance ' Receive Distance Value
PAUSE 20 ' Refresh Delay
NEXT

distance = distance ** 2257 ' Calculate Distance In cm
IF distance > oldDistance THEN ' Is distance > Last Clear Path
oldDistance = distance ' Update oldDistance Value
task = 3
ENDIF

' *************************************************************************

FOR pulseCount = 0 TO 20 ' Number Of Pulses To Spin
LOW Ping ' Force PING))) Line Low
PULSOUT PingServo, 225 ' Ping Servo 90 Right Pulse Value
PULSOUT Ping, 5 ' Activate PING)))
PULSIN Ping, 1, distance ' Receive Distance Value
PAUSE 20 ' Refresh Delay
NEXT

distance = distance ** 2257 ' Calculate Distance In cm
IF distance > oldDistance THEN ' Is distance > Last Clear Path
oldDistance = distance ' Update oldDistance Value
task = 4
ENDIF

ON task GOSUB Task0, Task1, Task2, Task3, Task4

distance = 50 ' Prevent Scan From Looping

RETURN

Task0: ' Forward Was Clearest Path
GOSUB Turn_Right ' This Could Mean Narrow Path
GOSUB Turn_Right ' So We'll Turn Around
GOSUB Turn_Right ' You Can Change The Behavior
GOSUB Turn_Right ' Of Any Of The Tasks
RETURN

Task1: ' 90 Degrees Left Was Clearest
GOSUB Turn_Left
GOSUB Turn_Left
RETURN

Task2: ' 45 Degrees Left Was Clearest
GOSUB Turn_Left
RETURN

Task3: ' 45 Degrees Right Was Clearest
GOSUB Turn_Right
RETURN

Task4: ' 90 Degrees Right Was Clearest
GOSUB Turn_Right
GOSUB Turn_Right
RETURN

Step 4: For Anyone Who Is New to Robotics This Is Where I Started

This is for anyone who wants to build something similar to my main post but wants to start small and cheap.
Everything on this is from parallax and cost a total of around $ 220-$270.
This small version still roams around with same microcontroller and is capable of doing the same things my main bot does but on a smaller scale.

Parts include:

  • Parallax Boe Bot kit with the tank treads ( your base)
  • Ping sensor
  • Parallax servo for ping
  • Erector parts
  • optional LCD screen
  • optional 2 extra arm servos
National Robotics Week Robot Contest

Finalist in the
National Robotics Week Robot Contest