Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/LocalSettings.php on line 193

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/LocalSettings.php on line 197

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338
[ Wikidébrouillard ] Bras robotisé

Bras robotisé

De Wikidebrouillard.

(L'expérience)
(L'expérience)
Ligne 23 : Ligne 23 :
==='''La réalisation'''===
==='''La réalisation'''===
Mettre le code suivant dans l'Arduino :
Mettre le code suivant dans l'Arduino :
-
<pre>sehbfvehgbv</pre>
+
<pre>// Contrôler la position de servo-moteurs avec des potentiomètres (résistance variable)
 +
 
 +
#include <Servo.h>
 +
 +
Servo myservo1;  // create servo object to control a servo
 +
Servo myservo2;  // create servo object to control a servo
 +
Servo myservo3;  // create servo object to control a servo
 +
 +
int potpin1 = 0;  // analog pin used to connect the potentiometer
 +
int potpin2 = 1;  // analog pin used to connect the potentiometer
 +
int potpin3 = 2;  // analog pin used to connect the potentiometer
 +
int val1;    // variable to read the value from the analog pin
 +
int val2;    // variable to read the value from the analog pin
 +
int val3;    // variable to read the value from the analog pin
 +
 +
void setup()
 +
{
 +
  myservo1.attach(9);  // attaches the servo on pin 9 to the servo object
 +
  myservo2.attach(10);  // attaches the servo on pin 9 to the servo object
 +
  myservo3.attach(11);  // attaches the servo on pin 9 to the servo object
 +
}
 +
 +
void loop()
 +
{
 +
//servo 1
 +
  val1 = analogRead(potpin1);            // reads the value of the potentiometer (value between 0 and 1023)
 +
  val1 = map(val1, 0, 1023, 0, 179);    // scale it to use it with the servo (value between 0 and 180)
 +
  val2 = analogRead(potpin2);            // reads the value of the potentiometer (value between 0 and 1023)
 +
  val2 = map(val2, 0, 1023, 0, 179);    // scale it to use it with the servo (value between 0 and 180)
 +
  val3 = analogRead(potpin3);            // reads the value of the potentiometer (value between 0 and 1023)
 +
  val3 = map(val3, 0, 1023, 0, 179);    // scale it to use it with the servo (value between 0 and 180)
 +
  myservo1.write(val1);                  // sets the servo position according to the scaled value
 +
  myservo2.write(val2);                  // sets the servo position according to the scaled value
 +
  myservo3.write(val3);                  // sets the servo position according to the scaled value
 +
  delay(5);                          // waits for the servo to get there
 +
} </pre>
==='''La manipulation'''===
==='''La manipulation'''===

Version du 15 janvier 2013 à 16:53

Article incomplet en cours de rédaction
Modèle:Vidéo


Sommaire

Présentation de l'expérience

Si vous aussi vous avez toujours eu envie de partir à la conquête du monde à la tête de votre propre armée de robots, il faut commencer par les bases. Voici comment fabriquer un bras robotisé simple à l'aide d'un Arduino !

Matériel

  • 1 Arduino avec son câble USB
  • 1 pile 9V
  • 1 ordinateur
  • plaque Labdec
  • Fichier:Potentiomètre.jpg 3 potentiomètres
  • 3 servo-moteurs de modélisme
  • fil électrique
  • une paire de ciseaux
  • des piques à brochette
  • des pailles
  • de la colle

L'expérience

La réalisation

Mettre le code suivant dans l'Arduino :

// Contrôler la position de servo-moteurs avec des potentiomètres (résistance variable)

#include <Servo.h> 
 
Servo myservo1;  // create servo object to control a servo
Servo myservo2;  // create servo object to control a servo 
Servo myservo3;  // create servo object to control a servo 
 
int potpin1 = 0;  // analog pin used to connect the potentiometer
int potpin2 = 1;  // analog pin used to connect the potentiometer
int potpin3 = 2;  // analog pin used to connect the potentiometer
int val1;    // variable to read the value from the analog pin
int val2;    // variable to read the value from the analog pin 
int val3;    // variable to read the value from the analog pin 
 
void setup() 
{ 
  myservo1.attach(9);  // attaches the servo on pin 9 to the servo object
  myservo2.attach(10);  // attaches the servo on pin 9 to the servo object 
  myservo3.attach(11);  // attaches the servo on pin 9 to the servo object 
} 
 
void loop() 
{
//servo 1
  val1 = analogRead(potpin1);            // reads the value of the potentiometer (value between 0 and 1023) 
  val1 = map(val1, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180)
  val2 = analogRead(potpin2);            // reads the value of the potentiometer (value between 0 and 1023) 
  val2 = map(val2, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180)
  val3 = analogRead(potpin3);            // reads the value of the potentiometer (value between 0 and 1023) 
  val3 = map(val3, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180) 
  myservo1.write(val1);                  // sets the servo position according to the scaled value
  myservo2.write(val2);                  // sets the servo position according to the scaled value
  myservo3.write(val3);                  // sets the servo position according to the scaled value
  delay(5);                           // waits for the servo to get there 
} 

La manipulation

1) tourner un des potentiomètre dans un sens, le servo-moteur correspondant fait bouger le bras ! 2) tourner le même potentiomètr dans l'autre sens, le servo-moteur correspondant fait bouger le bras dans l'autre sens !

Pour aller plus loin

Il est possible de rajouter autant de servo-moteurs que l'on veut en ajustant le code à mettre dans l'arduino. Il est également possible de piloter autre chose que des servo-moteurs, comme un moteur continu par exemple.

Que voit-on ?

On obtient un petit bras robotisé où chaque articulation est pilotée par un potentiomètre.

Explications

De manière simple

Quand on tourne un potentiomètre, on envoie une information à l'Arduino. Ce dernier utilise le code que l'on lui a envoyé via le câble USB pour traduire cette information en commande pour le servo-moteur. Le signal envoyé par le potentiomètre est un signal analogique (continu, c'est à dire constitué d'une infinité de valeurs). Le signal envoyé au servo-moteur est un signal numérique (discret, c'est à dire constitué d'un nombre limité de valeurs).

Questions sans réponses

Ici je mets les questions soulevées par l'expérience, qui n'ont pas trouvé de réponses !!

Allons plus loin dans l'explication

Développons les concepts scientifiques associés.
Ne pas hésiter à faire des liens avec Wikipédia.

Liens avec d'autres expériences

Expériences sur Wikidébrouillard

Indiquer ici les expériences de Wikidébrouillard.

Autres expériences

Autres expériences avec le même concept, recherche sur internet (indiquer les liens). 

Applications : liens avec le quotidien

Robotique industrielle, exploration spatiale

Lieux propices à sa réalisation

Indiquer ici des lieux où tout le matériel nécessaire pour réaliser cette expérience est disponible.

Catégories

Portail des ExplorateursWikidébrouillardLéon DitFLOGPhoto mystèreJ'ai FaitPortraits
AR
CO

Bras robotisé

Rechercher

Page Discussion Historique
Powered by MediaWiki
Creative Commons - Paternite Partage a l

© Graphisme : Les Petits Débrouillards Grand Ouest (Patrice Guinche - Jessica Romero) | Développement web : Libre Informatique