FASTBot motor command – Move Backward.

FASTBot motor command – Move Backward.

This function is exactly similar to the last function except it takes the robot backwards during its operations. The speed of the motors can be adjusted independently to turn the robot slightly in one direction. This function is used to make turns when moving backward. The speed difference between the left and right motors defines the nature of turn.

You need to define the following parameters.

The speed of the left motor (backward)

The speed of the right motor (backward)

Timing (optional)

Stop the motors once the action is performed (optional)

The structure of function definition with disabled Stop condition is given here:

MoveBackwards (char LeftMotorSpeed, char RightMotorSpeed, int RunTime )

When the function stop condition is enabled, the structure becomes

MoveBackwards_S (char LeftMotorSpeed, char RightMotorSpeed, int RunTime )

The direction of both left and right motors are set to backwards by default and it can’t be changed. If the left motor turns slowly than the right motor, the bot turns left. If the left motor is faster than the right motor, the bot turns right side. During the turn, the radius of the turning arc depends on the speed difference between the two motors.

When the speed of both motors become equal, the bot moves backward and it resembles Go Back function. When the left motor is stopped, the robot turns to left in the arc with the left wheel as the centre in backward direction. This is similar to backward right turn seen the Spin Right function. When right motor is stopped instead of the left motor, the robot turns left in an arc with the right wheel as the centre in the backward direction. This resembles backward left turn seen in the Spin Left function. Thus the Move backward function can effectively substitute Go Back function and some aspects of Spin Left and Spin Right functions.

In addition to replacing these functions, the Move Backward function can be used to make slight turns which can be used to move the robot slightly to the left or the right in the backward direction. Stopping left or right motor enables the robot to turn sharply in backward direction. This option is very useful in tasks like obstacle avoidance where using a simple Turn Right or Turn Left function can result in a collision with the obstacle because the robot moves forward in those functions.

This entry was posted in Articles on FASTBot, FASTBot Motor Control, Knowledge Base and tagged , , , . Bookmark the permalink.

Comments are closed.