# Category Archives: Robotics

# Geometric model for differential wheeled mobile robot

## Problem specification

We’ll assume that the following parameters are known:

- is the radius of the wheels
- the distance between the center of the robot and the wheels
- and are the instantaneous angular velocities of respectively the left and right wheels

Our goal is to calculate the pose of the robot according to the upper figure:

- and are the coordinates of the robot
- is the angular orientation of the robot

## Elementary displacement calculation

First, let’s calculate the linear velocity of each wheel:

The average velocity of the robot is then given by:

The robot velocity can now be projected along the and axes:

The angular velocity of the robot is given by the difference of the wheels linear velocities:

Previous equation can be reformulated as:

The elementary displacement of the robot is given by the following relation:

## Absolute position

The absolute position can be calculated thanks to the following equations :

\begin{array}{r c l}

x_{i}&=&x_{i-1}+\Delta_x \\

y_{i}&=&y_{i-1}+\Delta_y \\

\Psi_{i}&=&Psi_{i-1}+\Delta_{\Psi}

\end{array}

where

- and are the coordinates of the robot at time step
- is the orientation of the robot at time step

# PI-based first-order controller

## Introduction

## Close loop transfer function

The transfer function of the system is given by:

as is assumed to be a first-order system, its equation is given by:

where is the sampling time, and the time constant of the open loop system.

is the PI controller, its equation is given by:

The transfer function of the closed loop system is now given by:

Previous equation can be simplified:

The new transfer function is given by:

## Static gain of the closed loop system

Let’s consider the response of the closed loop system when the input is a unity step ():

According to the final value theorem for Z-transforms, the static gain of the system is given by :

The static gain of the system is equal to 1, the static error will be equal to zero.

## Time constant of the closed loop system

The closed loop system is also a first-order :

where is the sampling time, and the time constant of the closed loop system. Note that can be less than (the time constant of the open loop system). If the system is more reactive (but is also more energy consuming). In practice, is a good compromise. From the previous equation :

and :

To get the same response time in closed and open loop, the previous equation becomes :

## Stability

The system is stable if all the poles are located inside the unity circle. Here, as the system is a first-order, there is one pole : . The system is stable if:

The previous equation can be rewrite as:

and:

Note that if is calculated from ( ), the term is included in and the system is necessarely stable because it leads to .

## Discrete-time function

The transfert function of the controller expressed in the discrete-time domain is given by:

Let’s expressed the previous equation in the discrete-time domain:

or :

## Video

## Download

**Matlab script - PI controller for a first-order system 0.97 KB**

## Acknowledgements

I want to thank Laurent Hardouin from the University of Angers for his help and explainations.

# Gameduino shield and Arduino Mega 2560 (or ADK)

# Videos from Innorobo 2014

## Wall riding robots:

## Wheelless line follower robot:

## Baxter from Rethink Robotics:

## A humanoid robot playing with a ball:

## Humanoid dancing robots:

# Photos from Innorobo 2014

# Inside the maxon EC brushless DC motor

# Open and closed loop

## Open loop

Let’s consider the following system in open loop:

The transfert function of the system is given by:

## Closed loop

Let’s now consider the same system in closed loop:

The error is defined by the difference between the reference (expected value) and the output of the system (the real value):

The output of the system is given by:

By replacing in the previous equation we get:

This equation can be rewritten to get the transfert function:

## Closed loop with controller

Let’s now assume that a controller is added:

We can deduce the new transfert function:

# Artificial conscience

# Introduction to EAGLE

## Tutorial

Introduction to EAGLE – Part 1 – Control panel

Introduction to EAGLE – Part 2 – Schematic editor

Introduction to EAGLE – Part 3 – Board editor

## Advanced usage

Introduction to EAGLE – Adding mounting holes to a PCB

Introduction to EAGLE – Adding copper pour

Introduction to EAGLE – Understanding layers

Introduction to EAGLE – Create Solidworks 3D model from Eagle

## Téléchargements

**EAGLE Manual 5.17 MB**

**EAGLE Tutorial 888.52 KB**

# Introduction to EAGLE – Adding copper pour

## Copper pour

## Board outline conflict

## Attaching a net

To add or change the copper pour net attachment, select the NAME command and click on the polygon. A window pop up and the user can modify or specify the name of the copper pour. When the name is the same as an existing track (for example GND), an electric connection is automaticaly created between the track and the copper pour. On the following board, the copper pour is connected to the groung:

## Remove copper pour

# Introduction to EAGLE – Adding mounting holes to a PCB

## VIA versus HOLE

## Hole diameters

[mil] | [mm] |
---|---|

19.68504 mils | 0.5 mm |

23.62205 mils | 0.6 mm |

27.55906 mils | 0.7 mm |

31.49606 mils | 0.8 mm |

35.43307 mils | 0.9 mm |

39.37008 mils | 1.0 mm |

43.30709 mils | 1.1 mm |

47.24409 mils | 1.2 mm |

51.1811 mils | 1.3 mm |

55.11811 mils | 1.4 mm |

59.05512 mils | 1.5 mm |

62.99213 mils | 1.6 mm |

78.74016 mils | 2.0 mm |

86.61417 mils | 2.2 mm |

110.23622 mils | 2.8 mm |

125.98425 mils | 3.2 mm |

If the value is not listed, check this link : Distance converter.

# Introduction to EAGLE – Part 3 – Board editor

## Forward and backward annotation

## Workspace

## Placement

## Routing

The inverse tranformation (from tracked route to airwire) is not done with the DELETE tool. This action removes the connection. While forward and backward annotation is enable, deleting a connection is not possible from the board editor; it must be done in the schematic editor. To unroute a track, use the RIPUP tool:

With the SPLIT command you add a bend in a wire. It is usefull to push or modify an existing track:

## Modifying the board

## Design rule check

# Introduction to EAGLE – Part 2 – Schematic editor

## Workspace

## Adding symbols

Click to the ADD icon as explained previously for adding the frame. EAGLE is provided with a large number of librairies, and the user can enter one or more search patterns in the search field by using special characters (wild cards) ‘?’ and ‘*’:

- * is a search pattern that can be replaced by one or several characters. For example *555 will provide all the entries ending by 555. 555* will provide all the entries beginning by 555 and *555* will provide all the entries containing 555.
- ? is a search pattern similar to ‘*’, excepted that it can only be replaced by a single character.

It is usefull to remember that when you add a device, right click rotate and left click place the symbol. Once a symbol is placed, several operations are still possible :

Search and add the following components in your design (the belonging library and package is mentioned in brackets) :

Component | Library | Device | Package |
---|---|---|---|

555 timer | st-microelectronics | NE555 | DIL-08 |

Resistor | rcl | R-EU | 0204/7 |

Polarized capacitor | rcl | CPOL-EU2,5-6E | E2,5-6E |

Capacitor | rcl | C-EUC1206 | C1206 |

Screew terminal | con-ptr500 | AK500/2 | AK500/2 |

5mm LED | led | LED5MM | LED5MM |

VCC supply symbol | supply2 | VCC | - |

GND supply symbol | supply2 | GND | - |

## Adding connections

## Component name and value

## Check errors

## Generating board

Click here for the next step

Click here to return to the main summary

# Introduction to EAGLE – Part 1 – Control panel

**E**asily

**A**pplicable

**G**raphical

**L**ayout

**E**ditor. It is an electronic CAD software manufactured by CadSoft Computer GmbH, a German company, since 1988. This software is provided with, among other, a schematic capture editor, a PCB (

**P**rinted

**C**ircuit

**B**oard) layout editor, an auto-router, a

**C**omputer-

**A**ided

**M**anufacturing (CAM)… It supports Windows, Linux and Mac OS X. This tutorial has been prepared under version 6.5.0 / Ubuntu 12.04 LTS

## Control panel

When EAGLE is started, the following window appears on the screen,this is the control panel, the EAGLE starting window.On the left hand side of the window the user manage existing and new projects and can get an overview about the libraries and settings :

**Libraries:**this entry lists libraries of components, each component is composed of a schematic and a footprint linked together.**Design Rules:**the user can tune the parameters relevant to the board and its manufacture.**User Language Programs:**this is C-like programs that can be used for a variety of tasks. It can be used, for example, to modify your project and automize certain tasks.**Scripts:**the user can execute sequences of commands that are stored in a script file. It provides the ability to customize the program according to your own wishes (assign keys,

load pc board shapes, change colors…)**CAM Jobs:**CAM stands for**C**omputer-**A**ided**M**anufacturing. It generates output data for the manufacturing tools (for exemple exporting Gerbers files which is the most used professional format).**Projects:**this entry lists the examples and projets. When a new project is created, it is automaticaly added in the tree.

The Arduino MEGA2560 board has been designed with EAGLE. It is provided within the examples:

## Directories

*Option > Directories*:

## Libraries

## New project

To create a new project, select *File > New > Project* :

Right click on the project and select *New > Schematic*.

A new window is automatically open, this is the Schematic Editor:

Click here for the next step

Click here to return to the main summary

# Online motor sizing calculator

**It is strongly recommended that you read this page before any use for a better understanding of the calculator.**

# Eagle 6.5.0 installation on Ubuntu 12.04 LTS 64 bits

When trying to install eagle on Ubuntu 12.04 LTS 64 bits I encounter the folowing error:

```
line 108: /tmp/eagle-setup.9094/eagle-6.5.0/bin/eagle: No such file
```

This error is due to missing packages and can be resolved by processing the following commands before installing:

```
sudo apt-get install libssl1.0.0
sudo apt-get install libcrypto++9
sudo apt-get install build-essential perl gcc-multilib
sudo apt-get install ia32-libs lib32z1 lib32z1-dev
```

# Arduino-based accurate distance measurement with Sharp sensors.

## Measurement survey

Same methodology and graph for the GP2Y0A21YK sensor below:

## Polynomial approximation

For the GP2Y0A21YK a fifth degree polynomial was necessary:

## Results

The same approximation for the GP2Y0A21YK is given by:

```
/*!
\brief make a distance measurement with a Sharp GP2Y0A02YK sensor
\return the measured distance in mm
*/
float get_Sharp_GP2Y0A02YK_Distance(int PinID)
{
// Read analog to digital converter value
float ADCValue = (float)analogRead(PinID);
// Convert in millimeters and return distance
return 2583.711122992086
- 20.197897855471*ADCValue
+ 0.071746539329 *ADCValue*ADCValue
- 0.000115854182 *ADCValue*ADCValue*ADCValue
+ 0.000000068590 *ADCValue*ADCValue*ADCValue*ADCValue;
}
```

For the GP2Y0A21YK :

```
/*!
\brief make a distance measurement with a Sharp GP2Y0A21YK sensor
\return the measured distance in mm
*/
float get_Sharp_GP2Y0A21YK_Distance(int PinID)
{
// Read analog to digital converter value
float ADCValue = (float)analogRead(PinID);
// Convert in millimeters and return distance
return 200.3775040589502
- 2.2657665648980 *ADCValue
+ 0.0116395328796 *ADCValue*ADCValue
- 0.0000299194195 *ADCValue*ADCValue*ADCValue
+ 0.0000000374087 *ADCValue*ADCValue*ADCValue*ADCValue
- 0.0000000000181 *ADCValue*ADCValue*ADCValue*ADCValue*ADCValue;
}
```

## Download

**Data and matlab script for distance measurement with Sharp sensors 102.87 KB**

## Acknowledgements

# Sizing motors

This article is dedicated to motor sizing. Althrough it is dedicated to robotics and electrical motors, it can easily be extended to any application or other kind of motors.

## Problem specifications

Let’s consider a wheeled robot that climb up an inclinated plane:

*Figure a.*

The wheeled robot illustrated on figure a. have the following specifications:

- weight [],
- wheel diameter [],
- maximum velocity of the robot [],
- maximum acceleration of the robot [],
- angle of the greater positive slope to climb up [],
- gear ratio between the motor and the wheel .
- efficiency of the gear box .

Properties to determine :

- torque on wheel shaft [],
- torque on motor shaft [],
- angular velocity of wheel shaft [ and ],
- angular velocity of motor shaft [ and ],
- power of the motor [].

## Angular velocities

Let’s first calculate the angular velocity of the wheel:

The angular velocity of the motor shaft is given by:

The angular velocities converted in rotations per minutes are given by:

## Torque on wheels shaft

Torque is more tricky to calculate. The fundamental principle of dynamics gives us:

Forces acting on the robot are gravity and actuator. The force inducted by the gravity is . When projected on the direction of motion (see figure a.), the force inducted by the gravity is given by:

The fundamental principle of dynamics can be rewritten as:

can be deducted :

Thus, the torque on wheel’s shaft is given by:

## Torque on motor shaft

Considering the gear box specifications gives us:

## Power

The power produced by the motor is given by the product of the angular speed by the torque on the motor’s shaft. We can thus calculate the motor’s minimal power:

## Download

**Sizing motor 1.70 KB**