Robotics is a unique mixture of science and technology that produces machines that mimic the actions of humans.

In the early 2000s, 90% of robots were in car manufacturing plants replacing humans for repetitive tasks. Now robots can vacuum houses and even serve in restaurants.

A robot usually consists of three types of components; the mechanical body; the electric skeleton, and finally a brain made with code.

These components allow a robot to collect data (often from sensors), make decisions via programmed logic to adapt behavior and complete tasks.

Robots may have three types of programs; Remote Control (RC), Artificial Intelligence (AI), or Hybrid.

RC programs require the intervention of a human being who can give the start and/or the stop signal for the execution of code to the robot. Programs consist of various types of algorithms, each with a different function.

## What is an algorithm?

An algorithm is a series of lines of code that a robot can use to perform certain instructions. It translates the ideas of the developer into a language that is understood by robots.

Algorithms can be expressed in many kinds of notation, including pseudocode, flowcharts, programming languages, or control tables.

In this article we’ll discuss some common types of algorithms used in these programs.

## Types of algorithms used in robotics

### 1. Anytime A* Algorithm

The A* algorithm is a path search algorithm that is used to find the most optimal path between two points, i.e., with the smallest cost.

Anytime A* Algorithm has a flexible time cost and can return the shortest path even if it is interrupted as it generates a non-optimal solution first and then optimizes it.

This allows for faster decision making as the robot can build upon previous calculations instead of starting from scratch.

#### How does it work?

It does this by forming a ‘tree’ which extends in from the start node until the criteria for termination is triggered which means there is a less costly path available.

A 2D Grid is made with obstacles and a starting cell and target cells are pin-pointed.

The algorithm defines a node’s ‘value’ by f which is the sum of parameters g (the cost of moving from the starting node to the node in question) and h (the cost of moving from the node in question to the target node).

#### Applications

A lot of games and web-based maps use this algorithm for finding the shortest path efficiently. It can also be used for mobile robots.

You can also solve complex problems like the Newton–Raphson iteration applied to finding the square root of a number.^{}

It is also used in trajectory problems to predict the motion and collision of an object in space.

### 2. D* Algorithm

D*, Focused D* and D* Lite are incremental search algorithms to find the shortest path between two points.

They, however, are a mixture of A* algorithms and new discoveries that allow them to add information to their maps for unknown obstacles.

They can then recalculate a route based on new information, much like the Mars Rover.

#### How does it work?

The working of D* Algorithm is similar to that of A*, the algorithm first defines f, h and creates an open and closed list.

After this, the D* Algorithm determines the current node’s g value using the g value of its neighboring nodes.

Each neighboring node makes a guess about the current one’s g value and the shortest g value is adapted as the new g value.

#### Applications

D* and its variants are widely used for mobile robot and autonomous vehicle navigation.

Such navigation systems include a prototype system tested on the Mars rovers Opportunity and Spirit and the navigation system that won the DARPA Urban Challenge.

### 3. PRM Algorithm

A PRM, or probabilistic roadmap, is a network graph of possible paths based on free and occupied spaces on a given map .

They are used in complex planning systems and also to find low cost paths around obstacles.

PRMs use a random sample of points on their map where a robot device can possibly move and then the shortest path is calculated.

#### How does it work?

PRM consists of a construction and query phase.

In the first phase, a roadmap is graphed that approximates possible motions in an environment. A random configuration is then created and connected to some neighbors.

The start and goal configurations are connected to the graph in the query phase. The path is then obtained by a Dijkstra’s shortest path query.

#### Applications

PRM is used in local planners, where the algorithm computes a straight line path between two points, namely the initial, and goal points.

The algorithm can also be used to improve path planning and collision detection applications.

### 4. Zero Moment Point (ZMP) Algorithm

Zero Moment Point (ZMP technique) is an algorithm used by robots to keep the total inertia opposite to the reaction force of the floor.

This algorithm uses the concept of calculating the ZMP and applies it in a way to balance bipedal robots. Using this algorithm on a smooth floor surface seemingly allows the robot to walk as if there were no moment.

Manufacturing companies such as ASIMO (Honda) use this technique.

#### How does it work?

The motion of a walking robot is planned using the angular momentum equation. It makes sure that the generated joint motion guarantees dynamical postural stability of the robot.

This stability is quantified by the distance of the zero-moment point (calculated by the algorithm) within the boundaries of a predefined stability region.

#### Applications

Zero moment points can be used as a metric to assess the stability against tipping over of robots like the iRobot PackBot when navigating ramps and obstacles.

### 5. Proportional Integral Differential (PID) Control Algorithm

Proportional Integral Differential Control or PID, creates a sensor feedback loop to adjust settings for mechanical components by calculating the error value.

These algorithms combine all three basic coefficients, i.e., proportion, integral, and derivative so that it produces a control signal.

It works in real-time and applies corrections where needed. This can be seen in self-driving cars.

#### How does it work?

The PID controller uses three control terms of proportionality, integral and derivative influence on its output to apply accurate and optimal control.

This controller continuously calculates an error value as the difference between a desired setpoint and a measured process variable.

It then applies a correction to minimize the error over time by adjustment of the control variable.

#### Applications

This controller can control any process that has a measurable output, a known ideal value for that output, and an input to the process that will affect the measurable output.

Controllers are used in the industry to regulate temperature, pressure, force, weight, position, speed and any other variable for which a measurement exists.

## Conclusion

So, these were some of the most common algorithms used in robotics. All these algorithms are quite complex with a mixture of physicals, linear algebra and statistics being used to map out actions and movement.

However, as technology advances robotics algorithms will develop to become even more complex. The robots will be able to complete more tasks and think more for themselves.

If you enjoyed this article, subscribe to HashDork’s Weekly updates via emails, where we share the latest AI, ML, DL, Programming & Future Tech news.

## Leave a Reply