Activity 4


Getting the robot to move

 

Most simple wheeled robots have two independently driven wheels, one mounted each side of the robot. The power and direction of each motor can be independently varied. Robotocists call this a differential drive. Differential drives are often found on tanks, where instead of two indepdently driven wheels, there are two independently driven tracks.

 

For convenience, we shall assume a common configuration for the robot buggy.

 

For a LEGO RCX buggy:

 

For a LEGO NXT buggy (such as the Tribot):

(*** Need to check this config ***)

 

For a simulated buggy:

 

Exercise: Moving the robot forwards

 

How would you make the robot move forwards in a straight line for 1, 2 or 3 seconds and then stop?

 

 

What units of time does the wait action use?

 

What value does the SetDrivePower expect for full power?

 

Programming tips

 

Configuration

 

Download this for a complete project configured for a LEGO RCX buggy: act 5 move fwd (rcx).zip

 

Exercise: Moving the robot backwards

 

How do you make the robot move backwards in a straight line?

 

 

Download this for a complete project configured for a LEGO RCX buggy: act 5 move bwd (rcx).zip

 

Exercise: Moving the robot forwards and then backwards

 

How do you make the robot drive forwards, and then backwards, for the same amount of time?

 

 

Download this for a complete project configured for a LEGO RCX buggy: act 5 move fwd and bwd (rcx).zip

 

How easy is it to change the time? Using a variable makes it easier to make changes consistently.

 

 

Download this for a complete project configured for a LEGO RCX buggy: act 5 move fwd and bwd with var.zip

 

Programming tips

 

Exercise: turning the robot

 

What happens if you power the left and right motors at different power levels?

 

What happens if you drive one motor and stop the other (power = 0)?

 

What happens if you drive one motor forward and the other backward?

 

 

Download this for a complete project (not configured): act 5 turn.zip

 

 

Discussion question

 

What differences are there between the behaviour of a simulated robot and the behaviour of a real robot?

 

Back to Home or on to Activity 5