Top Topics

74*245 Motor Driver

H-Bridge Driver

Simple PWM Gen.

Handy Method Measuring RPM

Measuring RPM via Photo reflector

Introduction to Robotic

DC, Stepper,and Servo Motor

Related Link

Microcontroller Tutorial

Computer Interface
Tutorial

.............more links

 

 

BACK

Don't expect miracles from this simple hardware: it can crawl for an hour or so at its top speed of a few cm per second provided that the underground is smooth and level. The steppers deliver just enough power to move the vehicle, so it will not ride over any substantial obstacle. A toothpick in its path can be enough to block it.

The three stepbots shown below use essentially the same hardware. The first (left) one was build on a piece of wood using a solderless breadboard for easy modification. A battery pack can be put on its back. The middle one has its electronics (on a small PCB), the two steppers and a battery pack in a small gray case. Both use 12V steppers from 5.25 inch drives. The right one uses smaller 5V steppers from a small printer. It is not succesfull because the steppers do not deliver enough pull and I could not find a suitable rear wheel.

The essence of a simple Jal program to move the robot is shown below. The delay can be varied to find the minimal step interval which can start the robot. The library procedure stepper_motor_full_forward produces the sequence 0001, 0010, 0100, 1000. Similar procedures are available for half stepping and for stepping backward. The initial values can be changed to 0b_0011 to get a two coil sequence.

-- a robot that just rides at a constant speed
include 16f84_10 -- define target
include jlib -- standard libraries
var byte left = 0b_0001 -- start of the stepper sequences
var byte right = 0b_0001 -- "
port_b_direction = all_output -- an input would not help us much
forever loop --
stepper_motor_full_forward( left ) -- step both sides forward
stepper_motor_full_forward( right ) -- "
port_b_low = left -- output the new steps
port_b_high = right -- "
delay_1mS( 25 ) -- 25 mS delay between steps
end loop

A more interesting but still very simple robot follows a line on a piece of paper. I use a black line on white paper. The line is approximately 5 mm wide. The robot is placed on the line before it is started. The main problem is to follow a line which bends abruptly. One sensor could be used, but this requires the robot to sweep left and right to keep locked onto the line. I used two (reflective) sensors.

-- a robot that follows a line using two sensors
include 16f84_10 -- define target
include jlib -- standard libraries
var bit left dark at pin_a0 -- define IO pins
var bit right_dark at pin_a1 -- "
var byte left = 0b_0001 -- start of the stepper sequences
var byte right = 0b_0001 -- "
port_b_direction = all_output -- IO direction
port_a_direction = all_input -- "
forever loop --
if ! left_dark then -- when left sensor sees white
stepper_motor_full_forward( left ) -- step left motor
end if --
if ! right_dark then -- when right sensor sees white
stepper_motor_full_forward( right ) -- step right motor
end if --
port_b_low = left -- output the new steps
port_b_high = right -- "
delay_1mS( 25 ) -- 25 mS delay between steps
end loop

 

BACK