0% found this document useful (0 votes)
26 views39 pages

Internship Report Based On Arduino

The internship focuses on the development of a robotic component within the CRIIP of the IUT. It is divided into two parts: simulation on a 'foosball' robot and the development of an autonomous robot capable of moving from point A to point B while avoiding obstacles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views39 pages

Internship Report Based On Arduino

The internship focuses on the development of a robotic component within the CRIIP of the IUT. It is divided into two parts: simulation on a 'foosball' robot and the development of an autonomous robot capable of moving from point A to point B while avoiding obstacles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

INTERNSHIP REPORT

IUT DE CACHANT
University PARIS SUD
From June 2 to July 15
GEORGES DAHER

My internship will focus on the development of a robotic part -


MECHATRONICS at the **CRIIP (Resource Center and
of pedagogical innovation of the IUT.

My internship is divided into two parts:

1. Language V+ (simulation on baby foot robot).

2. autonomous robot capable of going from point A to point B


by avoiding obstacles present on the track at locations
random. (Arduino)

Georges DAHER
Bs Mechatronics Engineering

Georges Daher 1
THANKS
I would like to thank Professor Souhil first and foremost.
MEGHERBI, Director of the IUT of Cachan, University of Paris Sud,
France has accepted them as interns within
the university.

I also thank Mrs. Pascal VAREIL for her hospitality.


warm

I also thank Mr. Bertrand MANUEL, Mr. DEXTER,


for their technical support.

In a more general way, I thank the university for


the interest they showed me throughout the internship as well as for
their help and clarifications.

I thank as well, my faculty dean Dr. Elias KHALIL


for its support during this.

Georges Daher 2
IUT OF CACHAN
Created in 1966 following the Decree of January 7, 1966 establishing the University Institutes of
Technology, the IUT of Cachan has always maintained an essential characteristic: it offers some
industrial specialties focused on Electrical Engineering and Industrial Computer Science and Engineering
Mechanics and Production.

By staying true to this choice, the IUT of Cachan has managed to adapt to the evolution of technology and to
business demands. The list of current specialties at the IUT shows it:

electronics, electrotechnics, telecommunications, industrial computing


mechatronics, automation and control systems, robotics, mechanics, production engineering, CAD
CFAO and DAO.

The IUT has also been able to adapt its courses and teaching methods to the demands of the audience.
concerned. It now offers full-time training courses, with a final internship (status
student) or through an apprenticeship (apprentice status), distance learning, training
continue throughout life with validation of acquired experience and adapted alternation to the
situation of interns.

The diplomas prepared at the IUT are part of the European framework of Bachelor Master Doctorate (LMD)
of Universities, either at the L level: DUT (bachelor +2) and Professional License (bachelor +3), or at the level
Engineer diploma prepared through apprenticeship in partnership with IFIPS (program)
engineer of the UPS

To accomplish the tasks assigned to it, the IUT is structured into 3 departments.
of education with multidisciplinary educational teams:

Electrical Engineering & Industrial Computer Science 1

Electrical Engineering & Industrial Computing 2

Mechanical Engineering and Production

These departments are supported by a set of shared services. In total, there are more than 160.
full-time staff of the National Education who are dedicated to the success of
about 1100 students and trainees attend the IUT of Cachan every year.

Georges Daher 3
FOR MORE INFORMATION

[email protected]

01.41.24.11.00

IUT of Cachan
9 Avenue de la Division Leclerc
94230 Cachan

-------------------------------------------------------------------------------------------------------------------------------

CRIIP
The CRIIP is a Research and Industrial Engineering Center or
Educational. It has the status of a resource center, was created in
November 2000, brings together and validates the various research actions and
industrial or educational collaborations carried out by the three
départements de l’IUT de Cachan: GEII1, GEII2 et GMP.
The CRIIP works on projects in collaboration with partners.
industrial. These allow students of the IUT to get involved
directly, within the framework of tutored projects and execution work,
in the development and realization of industrial and technological projects.
The CRIIP thus provides the necessary logistics for each project.
The three departments GE1, GE2, and GMP are divided into four activities:

Fundamental and applied research,


Educational research,
Technology transfer,

International educational cooperation.

Georges Daher 4
Summary
THANKS
THE IUT OF CACHAN AND THE CRIIP
SUMMARY
INTRODUCTION
PRESENTATION OF PROJECTS

B. second part of the internship: Autonomous robot A => B


1. presentation of the Arduino board
2. specifications
3. the electrical and mechanical components of the robot

4. the programs and tests conducted


5. Conclusion

GENERAL CONCLUSION

End

Georges Daher 5
B. AUTONOMOUS ROBOT

Georges Daher 6
Arduino introduction

The autonomous robot is equipped with an Arduino board (its brain).

What is Arduino?
In a few words:

Arduino = 1 microcontroller board + 1 development tool + 1

Active community.

The software and hardware are open-source.

The 'philosophy'
The idea is to use the Arduino board as a macro-component in applications.
of
Electronic prototyping. The designer just needs to develop interfaces and
Program the macro-component to create its application!

Georges Daher 7
The advantages
Cheap!
Clear and simple programming environment.
•Multiplatform: runs on Windows, Macintosh, and Linux.
Many libraries available with various functions
implemented.
Open source and extensible software and hardware.
Numerous tips, tutorials, and examples online (forums, personal website
etc...)
Existence of 'shield': these are cards
additional
who connect to the Arduino module to increase possibilities
as by
example: color graphic display, Ethernet interface, GPS, etc...

Georges Daher 8
Due to its ease of use, Arduino is used in many
applications like
industrial and embedded electronics, modeling, home automation but
also in some
different fields such as contemporary art or performance!

The Arduino Uno board

There are several types of boards, I started with an Arduino board.


one (cards
basic, with dimensions similar to that of a credit card.

Georges Daher 9
Characteristics of the Arduino Uno board:

Microcontroller: ATmega328
Internal power supply voltage = 5V
Power supply voltage (recommended) = 7 to 12V, limits = 6 to 20V
Digital I/O: 14 including 6 PWM outputs
Entrées analogiques = 6
Max current per I/O pins = 40 mA
Max current on 3.3V output = 50mA
32 KB Flash memory of which 0.5 KB is used by the bootloader
SRAM Memory 2 KB
1 KB EEPROM memory
Clock frequency = 16 MHz
Dimensions = 68.6mm x 53.3mm

The card interfaces with the PC via its USB port.


The board is powered by the power jack (standalone use) but
maybe
powered by USB (in development phase, for example).
Louis

Georges Daher 10
The 'shields'
There are many shields that are sometimes translated in the documentation as
«boucliers ». Personnellement, le terme « extension » me paraitrait plus approprié. Un
"Shield" Arduino is a small board that connects to an Arduino board to
enhance its functionalities. Some examples of 'shields':
Graphic display
Ethernet and SD card
GPS
Prototyping board (labdec type)
etc...
Louis

Georges Daher 11
Development of a project
Development on Arduino is very simple:
•we code the application: The Arduino language is based on the languages
C/C++, with some
functions and specific libraries for Arduino (input/output management).
We connect the Arduino board to the PC and transfer the program to the board.
We can use the circuit!
The programming software for Arduino modules is an application
Cross-platform Java
(working on all operating systems), serving as a code editor and
of
compiler, and which can transfer the firmware (and the program) through
of the connection
series (RS232, Bluetooth or USB depending on the module).
The software is very easy to use, there are very good tutorials available.
very well made
with even explanations in French. Very many examples are
provided.
The example files are really well documented and allow for
code things
very complicated without too much effort. The provided libraries allow
to use some
very simple complex components in just a few very clear lines
(display or
liaison SPI etc..).

button bar detail

Georges Daher 12
Links
The Arduino site:http://www.arduino.cc
Translate into French (partially):http://www.arduino.cc/fr

Georges Daher 13
2) Technical Specifications
The contest rules state that the robot must traverse the diagonal of a
square track of 8m by 8m, the robot heads towards its destination
of a compass located on it.
The track will also be sprinkled with obstacles, so the robot will have to avoid them.
then reach its destination.

Georges Daher 14
3) THE COMPONENTS OF THE ROBOT

Georges Daher 15
The chopper (dual h- bridge)

Georges Daher 16
The compass (CMPS10)
Presentation

The CMPS10 module is a compensated tilt compass. Using


a 3-axis magnetometer and a 3-axis accelerometer and a powerful
16-bit processor, the CMPS10 was designed to eliminate errors
caused by the tilt of the map. The CMPS10 produces a result of 0-
3599 representing 0 to 359.9 or from 0 to 255. The output of the three sensors of
measure of components z of the magnetic field X, Y and, at the same time
that pitch and roll are used to calculate the level, each of
these components are also available in raw form. The
The CMPS10 module requires a power supply of 3.3 - 5 V and draws a
25mA nominal current. There are three ways to achieve the rolling of the
module. A serial interface, an I2C interface, or a PWM output.

The I2C interface is the interface that must be used to connect it to the board.
Arduino.

Georges daher 17
4) THE PROGRAMS AND TESTS PERFORMED
4.1) POSITION SENSOR TEST
The position sensor is an infrared sensor that detects
the existence and the distance of an object.

The test below consists of turning on a LED if the


the distance of the Object from the sensor is less than 20cm

Georges Daher 18
Georges Daher 19
4.2) ENGINE TESTS
In order to operate the 2 motors (changing their
directions and their speeds) we need a chopper 4
quadrants.

Georges Daher 20
Georges Daher 21
4.3) COMPASS TEST

Georges daher 22
PROGRAMME

#include <Wire.h> // Use I2C library


#define ADDRESS 0x60 // Address of CMPS10

void setup() {
Serial.begin(9600);
Wire.begin(); // Connect to I2C
}

void loop(){
byte byteHigh, byteLow, fine; // byteHigh/byteLow store high and low bytes of
the bearing
fine stores decimal place of bearing
char pitch, roll; // Stores pitch and roll (signed values)
int bearing; // Full bearing

Wire.beginTransmission(ADDRESS); // begin communication with CMPS10


Wire.write(2); // Start read
Wire.endTransmission();
Wire.requestFrom(ADDRESS, 4); // Request 4 bytes from CMPS10
while(Wire.available() < 4); // Wait for the bytes to arrive
byteHigh = Wire.read(); // Store values
byteLow = Wire.read();
pitch = Wire.read();
roll = Wire.read();
bearing = ((byteHigh<<8) + byteLow) / 10; // Calculate full bearing
fine = ((byteHigh<<8) + byteLow) % 10; // Calculate bearing decimal
print_data(bearing, fine, pitch, roll); // Print data

delay(500);
}

Georges Daher 23
void print_data(int bearing, int fine, int pitch, int roll) {
// Print data to Serial Monitor window
Serial.print("Bearing=");
Serial.print(bearing, DEC);
Serial.print(".");
Serial.print(fine, DEC);

Pitch=
Serial.print(pitch, DEC);

Roll=
Serial.print(roll, DEC);
Serial.println("");
}

Georges Daher 24
4.4) TEST " SQUARE "
Dans ce test le robot doit faire un carre grâce à la boussole !!!!

The robot must add 90 degrees to its direction every 2 seconds.


desired, initial direction = direction of the compass.

Georges Daher 25
The connections:

Georges Daher 26
CODE "PROGRAM"
#include <Wire.h> Use I2C library
#define ADDRESS 0x60 // Address of CMPS10
int E1=6;
int M1=7;
int E2=5;
int M2=4;
float speedLeft=(245/2); pass 255 because there is a difference between
float speedRight=(255/2); // les deux moteurs >>
int x = LOW;
int direc;
unsigned long timerA; We initialize the timer

void setup(){
Serial.begin(9600); //serial to simulate on the screen
Wire.begin(); // Connect to I2C
pinMode(M1, OUTPUT);
pinMode(M2, OUTPUT);
}

void loop(){

digitalWrite(M1, HIGH);
digitalWrite(M2, HIGH);
analogWrite(E1, speedRight);
analogWrite(E2, speedLeft);

George Daher 27
if(x==HIGH)
if(millis()-timerA >= 2000) every 2 seconds adds 90 degrees
direction=direction+90;
if(direc > 360)
{ direc= direc-360;}
timerA=millis(); Reset the timer again
} reset the timer
}
else
{ timerA=millis(); //set the timer

byte byteHigh, byteLow, fine; // byteHigh/byteLow store high and low


bytes of the bearing
fine stores decimal place of bearing
char pitch, roll; // Stores pitch and roll (signed values)
int bearing; // Full bearing

Wire.beginTransmission(ADDRESS); // begin communication with


CMPS09
Wire.write(2); // Start read
Wire.endTransmission();
Wire.requestFrom(ADDRESS, 4); // Request 4 bytes from CMPS10
while(Wire.available() < 4); // Wait for the bytes to arrive
byteHigh = Wire.read(); // Store values
byteLow = Wire.read();
pitch = Wire.read(); not necessary in this program
roll = Wire.read(); not necessary in this program

Georges Daher 28
bearing = ((byteHigh<<8) + byteLow) / 10; // Calculate full bearing
fine = ((byteHigh<<8) + byteLow) % 10; Calculate bearing decimal
print_data(bearing, fine, pitch, roll); // Print data

if(x == LOW)
//delay(500);
direc = bearing;
x = HIGH;
}

int diff = bearing - direc;


// modify degrees
if(diff > 180)
diff = -360 + diff;
else if(diff < -180)
diff = 360+diff;

Make the robot turn to its proper orientation


// diff = map(diff, --,-- ,--,--);

if(diff > 0) {
keep the right wheel spinning,
Change the speed of the left wheel
speedLeft = ((245-diff)/2);
speedRight = (255/2);
} else {
keep the right left spinning,
// change the speed of the left wheel
speedLeft = (245/2);

Georges Daher 29
speedRight = ((255+diff)/2);

}
}
void print_data(int bearing, int fine, int pitch, int roll) {
// Print data to Serial Monitor window for the simulation
Serial.print("Bearing="); print the bearing
Serial.print(bearing, DEC);
Serial.print(".");
Serial.print(fine, DEC);

Pitch=
Serial.print(pitch, DEC);

Roll=
Serial.print(roll, DEC);
Serial.println("");

Serial.print("direc="); print direction


Serial.print(direc, DEC);
Serial.println("");
Serial.print("\t");
Serial.print("speedLeft="); //print the value of the speed (left)
Serial.print(speedLeft, DEC);
Serial.println("");

Serial.print("speedRight="); //print the value of the speed (right)


Serial.print(speedRight, DEC);
Serial.println("");
}

Georges Daher 30
Problems and solutions:

The 2 DC motors are not 100% reliable and there are


a shift between them, for that it's better
uses a servo motor (because it is more precise than a
DC motor, lighter, and easier to install
work.
Definition: a servomotor is a motor designed to produce
precise movements of a mechanical element according to a command
external.
In other words, it is a motor that goes to a precise position in
function of the input signal.

the compass is very sensitive.


If the compass is in position 1:
The compass is getting close to the
Engines create a field
magnetic, the compass is then
influencing by this field, which
trouble the robot.
For this, one of the solutions that
has reduced this influence is
put the compass on a bar
Far from the engines (position2), to have a
More accurate precision.

Georges Daher 31
THE FINAL TEST
We now need to join the programs (test) to have
The final program.

Note: I did not use a (black and white) sensor.


Carje didn't have time to create the track.

Georges Daher 32
THE PROGRAM
//georges daher
The engine values are not accurate.

#include <Wire.h> // Use I2C library


#define ADDRESS 0x60 // Address of CMPS10
int E1=6;
int M1=7;
int E2=5;
int M2=4;
int sens1=0;
int sens2=1;
int sens3=2;
float speedLeft=(245);
float speedRight=(255);
int x = LOW;
int direc;
unsigned long timerA;

void setup(){
Serial.begin(9600);
Wire.begin(); Connect to I2C
pinMode(M1, OUTPUT);
setPinMode(M2, OUTPUT);
}
void loop()
{
digitalWrite(M1, HIGH);
digitalWrite(M2, HIGH);
analogWrite(E1, speedRight);
analogWrite(E2, speedLeft);
int s1=analogRead(sens1);
int s2=analogRead(sens2);
int s3=analogRead(sens3);

Georges Daher 33
byte byteHigh, byteLow, fine; // byteHigh/byteLow store high and low bytes of
the bearing
fine stores decimal place of bearing
char pitch, roll; // Stores pitch and roll (signed values)
int bearing; // Full bearing
Wire.beginTransmission(ADDRESS); // begin communication with CMPS09
Wire.write(2); // Start read
Wire.endTransmission();
Wire.requestFrom(ADDRESS, 4); // Request 4 bytes from CMPS10
while(Wire.available() < 4); // Wait for the bytes to arrive
byteHigh = Wire.read(); // Store values
byteLow = Wire.read();
pitch = Wire.read();
roll = Wire.read();
bearing = ((byteHigh<<8) + byteLow) / 10; // Calculate full bearing
fine = ((byteHigh<<8) + byteLow) % 10; // Calculate bearing decimal
print_data(bearing, fine, pitch, roll); // Print data
if(x== LOW)
//delay(500);
direc = bearing;
x = HIGH;
}
int diff = bearing - direc;
modify degrees
if(diff > 180)
diff = -360 + diff;
else if(diff < -180)
diff = 360 + diff;
if(diff > 0) {
keep the right wheel spinning,
change the speed of the left wheel

Georges Daher 34
speedLeft = (245-diff);
speedRight = (255);
}
Otherwise
{
keep the right left spinning,
change the speed of the left wheel
speedLeft = (245);
speedRight = (255+diff);

if( s1>100 && s2>s3)


{
//analogWrite(E1, 255);
// analogWrite(E2, 0);
speedLeft=0; The values are not exact.
speedRight=255; the values change from one
delay(300); the values change from a
DC motors
we need to do a lot of experiments
to be able to adapt in the end
best values

}
else if (s1 > 100 && s2 < s3)
{
// analogWrite(E1, 0);
// analogWrite(E2, 255);

speedLeft=255;
speedRight=0;

Georges Daher 35
delay(300);

else if(s1<100 && s2>150)


// analogWrite(E1, 255);
// analogWrite(E2, 0);

speedLeft=0;
speedRight=255;
delay(200);

else if(s1<100 && s3>150)


// analogWrite(E1, 0);
//analogWrite(E2, 255);
speedLeft=255;
speedRight=0;
delay(200);
}
}
void print_data(int bearing, int fine, int pitch, int roll) {
// Print data to Serial Monitor window
Serial.print("Bearing=");
Serial.print(bearing, DEC);
Serial.print(".");
Serial.print(fine, DEC);

Pitch=
Serial.print(pitch, DEC);

Georges Daher 36
Roll=
Serial.print(roll, DEC);
Serial.println("");

Serial.print("direc=");
Serial.print(direction, DEC);
Serial.println("");

speedLeft=
Serial.print(speedLeft, DEC);
Serial.println("");

Serial.print("speedRight=");
Serial.print(speedRight, DEC);
Serial.println("");
}

Georges Daher 37
Conclusion: of the autonomous robot
The autonomous robot allowed me to understand well what is happening and
how to manage problems.
But one of the proposals is to use servomotors (more precisely
and precise) To avoid wasting time on trying out (on a dc
motor and without encoder

Note: the simulation on serial is accurate. But in reality, several


problems arise (many attempts need to be made to achieve a
solution). But to avoid wasting time, it’s better to use some
servos instead of DC motors, even if the servos are
a little less fast but more accurate. In any case, it's very difficult to
drive the robot at high speed because the compass will be disturbed
and then the robot.

Georges Daher 38
Conclusion
In conclusion, from a professional point of view, this internship
brought me experience regarding the uncertainties that I
can meet, from adaptation to new ones
materials.
From a more personal perspective, traveling has made me
brought much whether through the discovery of a
culture, but also by the lifestyle of the French who
different from that of a Lebanese. This experience I
considered very positive, it taught me to
navigate in professional life and even
personal, in the life of a responsible man, I have
learned a lot of things through people and our
responsible here, and improve many others like
communication methods and time management.
In conclusion, this internship has been very beneficial from the point of view of

vue personnel et restera une bonne expérience et


professional.

Georges Daher 39

You might also like