Motion Control
Software to control a robot̵7;s motions takes the form of low-level motor operations and high-level coordination. Many robots use stepper motors as a basic source of mechanical power. Stepper motors are ideal for computer control, as they operate on electronic pulses. Each step takes one pulse from the computer, and it takes a set number of steps to turn the motor shaft 360 degrees. Software easily controls the motor̵7;s speed and direction, allowing the precise movement of arms, wheels and other moving parts.
In addition to raw movement, more complex robots require the coordination of several motors, as with a multi-wheeled rover. A simple software program drives each wheel, and a more complex one oversees all the wheels. To turn right, for example, the master program runs the left wheels faster than the right ones. To turn in place, the software runs the left wheels forward and the right wheels backward at the same speed.
Image Recognition and Navigation
A robot needs to be able to navigate through its surroundings, avoiding walls and obstacles. Image-recognition software processes a video signal from a digital camera and detects the edges of objects. With two cameras, the software detects depth and estimates distance.
Navigation software is yet another program that takes information from image recognition and uses it to manage a robot̵7;s movement. If the image recognition detects an obstacle, for example, it tells the motion software to begin steering around it. The navigation software continuously monitors the robot̵7;s progress around the obstacle until its path becomes clear.
Command Processing
No robot is completely autonomous. They all have ways of receiving commands from an operator, and this requires software to process the input. A program has a list of commands that the robot understands, such as turn on, turn off, move forward and lift an object. This program communicates to the other software that manages the details of these actions in the robot. The software receives the commands from a radio controller, voice command or keypad, and stores commands as predefined sets of actions.
Diagnostics
When the robot develops a problem, such as a stuck motor, diagnostic software displays a code or message, giving the operator clues as to the source of the fault. The software may have a ̶0;limp home̶1; mode, allowing the robot to continue functioning with the failed part but still performing a critical task until someone repairs it. Diagnostics may also have ̶0;exercise̶1; modes designed to demonstrate or test that the robot̵7;s various parts work. For a wheeled robot, the exercise mode may have the robot roll forward one foot, backward one foot and turn in circles. A robot with a manipulator hand demonstrates all the movements of which the hand is capable.