Outils pour utilisateurs

Outils du site


wiki:god:not_today:home

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
wiki:god:not_today:home [2015/03/17 23:56]
julien.g
wiki:god:not_today:home [2016/09/11 11:14] (Version actuelle)
Ligne 1: Ligne 1:
 ==== Not Today ==== ==== Not Today ====
 +
 +
 +>remplir probleme rencontré (fixation moteur + code)
 +
  
 ===I - Présentation de l’équipe === ===I - Présentation de l’équipe ===
Ligne 57: Ligne 61:
  
  
-=== IV - Choix et prix des composants ===+=== III - Choix et prix des composants ===
  
 Hélice (10 pouces) + Moteur (15 A max / 935KV) : 11.96*5 = 60 € Hélice (10 pouces) + Moteur (15 A max / 935KV) : 11.96*5 = 60 €
Ligne 104: Ligne 108:
 Total : 60 + 64 + 4 + 36 + 42 + 28.8 + 44.36 + 1.59 + 18.39 + 4.70 + 2 + 34.9 + 11.24 + 2.2 + 30 = 384 € Total : 60 + 64 + 4 + 36 + 42 + 28.8 + 44.36 + 1.59 + 18.39 + 4.70 + 2 + 34.9 + 11.24 + 2.2 + 30 = 384 €
  
-=== - Machines-outils ===+=== IV - Machines-outils ===
 Nous avons utilisé la découpeuse laser pour usiner les 2 plaques de fibre de verre qui servent de “corps” pour le drone. Nous avons utilisé la découpeuse laser pour usiner les 2 plaques de fibre de verre qui servent de “corps” pour le drone.
 L’imprimante 3D nous as servi pour réaliser nos éléments d’assemblage :  L’imprimante 3D nous as servi pour réaliser nos éléments d’assemblage : 
Ligne 111: Ligne 115:
  
  
-=== L’informatique du drone ===+=== V - L’informatique du drone ===
 La programmation se fera sur la carte Arduino grâce à l'environnement de développement Ar-duino. La programmation se fera sur la carte Arduino grâce à l'environnement de développement Ar-duino.
  
 +<file c notToday.ino>
  
 #include "Wire.h" #include "Wire.h"
Ligne 137: Ligne 142:
 const int pinCh5 = A4; const int pinCh5 = A4;
  
-//micros when the pin goes HIGH+//micros lors du HIGH
 volatile unsigned long timer_start1; volatile unsigned long timer_start1;
 volatile unsigned long timer_start2; volatile unsigned long timer_start2;
Ligne 144: Ligne 149:
 volatile unsigned long timer_start5; volatile unsigned long timer_start5;
  
-//difference between timer_start and micros() is the length of time that the pin +//difference entre les périodes
-//was HIGH - the PWM pulse length.+
 volatile int pulse_time1; volatile int pulse_time1;
 volatile int pulse_time2; volatile int pulse_time2;
Ligne 176: Ligne 180:
 volatile int last_interrupt_time4; volatile int last_interrupt_time4;
 volatile int last_interrupt_time5; volatile int last_interrupt_time5;
 +
 +
  
 /************************************************************************/ /************************************************************************/
Ligne 212: Ligne 218:
  
 //IN,OUT,SETPOINT //IN,OUT,SETPOINT
-PID pidPitch(&pitchIN, &pitchOUT, &ch2, pitchKp, pitchKi, pitchKd, REVERSE); +PID pidPitch(&pitchIN, &pitchOUT, &ch2, pitchKp, pitchKi, pitchKd, DIRECT); 
-PID pidRoll(&rollIN, &rollOUT, &ch1, rollKp, rollKi, rollKd, REVERSE);+PID pidRoll(&rollIN, &rollOUT, &ch1, rollKp, rollKi, rollKd, DIRECT);
 PID pidYaw(&yawIN, &yawOUT, &ch4, yawKp, yawKi, yawKd, DIRECT); PID pidYaw(&yawIN, &yawOUT, &ch4, yawKp, yawKi, yawKd, DIRECT);
  
Ligne 246: Ligne 252:
 int speedM2M4 = 0; int speedM2M4 = 0;
  
-int pinKill 3+const int  motorSpeedMin 0
-volatile int stopAll 0;+const int motorSpeedMax 170;
  
  
Ligne 260: Ligne 266:
   initInterrupt();   initInterrupt();
   initPID();   initPID();
-  initMotors(); // 15 SECONDES +  initMotors(); // 10 SECONDES
-  pinMode(pinKill, INPUT_PULLUP); +
-  attachInterrupt(pinKill, kill, CHANGE); +
-  pinMode(13, OUTPUT);+
  
 } }
Ligne 269: Ligne 272:
 void loop() void loop()
 { {
-  Serial.println(stopAll); +  getSensor(); 
-  if (stopAll>2) { +  getRadio();//map les cannaux de 0 � 100 
-     +  calcSpeed();//calcul en fontion des commandes et du PID la vitesse � appliquer aux moteurs 
-    digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level) +  updateMotors();//met � jour la vitesse des moteurs 
-    delay(500);              // wait for a second + 
-    digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW +  /// TEST_affichagePitch(); 
-    delay(500); +  // TEST_affichageCanaux(); 
-  } +  TEST_affichageMoteur();
-  else { +
-    getSensor(); +
-    getRadio();//map les cannaux de 0 � 100 +
-    calcSpeed();//calcul en fontion des commandes et du PID la vitesse � appliquer aux moteurs +
-    updateMotors();//met � jour la vitesse des moteurs+
  
-    /// TEST_affichagePitch(); 
-    // TEST_affichageCanaux(); 
-    TEST_affichageMoteur(); 
-  } 
 } }
  
Ligne 295: Ligne 289:
 void isr1() void isr1()
 { {
-  //record the interrupt time so that we can tell if the receiver has a signal from the transmitter+  //Enregistre la dernière interruption
   last_interrupt_time1 = micros();   last_interrupt_time1 = micros();
  
-  //if the pin has gone HIGH, record the microseconds since the Arduino started up+  //Si high
   if (digitalRead(pinCh1) == HIGH)   if (digitalRead(pinCh1) == HIGH)
   {   {
     timer_start1 = micros();     timer_start1 = micros();
   }   }
-  //otherwise, the pin has gone LOW+  //Si low
   else   else
   {   {
-    //only worry about this if the timer has actually started+    //timer déclenché?
     if (timer_start1 > 0)     if (timer_start1 > 0)
     {     {
-      //record the pulse time+      //Enregristre le temps
       pulse_time1 = ((volatile int)micros() - timer_start1);       pulse_time1 = ((volatile int)micros() - timer_start1);
-      //restart the timer+      //redémarre le timer
       timer_start1 = 0;       timer_start1 = 0;
     }     }
Ligne 417: Ligne 411:
 /***************************FONCTIONS IMU********************************/ /***************************FONCTIONS IMU********************************/
 /************************************************************************/ /************************************************************************/
 +/* Code fourni par AdaFruit */
 void initSensors() { void initSensors() {
   if (!accel.begin()) {   if (!accel.begin()) {
Ligne 442: Ligne 436:
   accel.getEvent(&accel_event);   accel.getEvent(&accel_event);
   if (dof.accelGetOrientation(&accel_event, &orientation)) {   if (dof.accelGetOrientation(&accel_event, &orientation)) {
-    /* 'orientation' should have valid .roll and .pitch fields */ +  
-    //    Serial.print(F("Roll: ")); +    rollIN = map(orientation.roll, -180, 180, -3030); 
-    //    Serial.print(orientation.roll); +    pitchIN = map(orientation.pitch, -180, 180, -3030);
-    //    Serial.print(F("; ")); +
-    //    Serial.print(F("Pitch: ")); +
-    //    Serial.print(orientation.pitch); +
-    //    Serial.print(F("; ")); +
-    rollIN = map(orientation.roll, -180, 180, -100100); +
-    pitchIN = map(orientation.pitch, -180, 180, -100100);+
   }   }
   /* Calculate the heading using the magnetometer */   /* Calculate the heading using the magnetometer */
   mag.getEvent(&mag_event);   mag.getEvent(&mag_event);
   if (dof.magGetOrientation(SENSOR_AXIS_Z, &mag_event, &orientation)) {   if (dof.magGetOrientation(SENSOR_AXIS_Z, &mag_event, &orientation)) {
-    /* 'orientation' should have valid .heading data now */ +     
-    //    Serial.print(F("Heading: ")); +    yawIN = map(orientation.heading, -180, 180, -3030);
-    //    Serial.print(orientation.heading); +
-    //    Serial.print(F("; ")); +
-    yawIN = map(orientation.heading, -180, 180, -100100);+
   }   }
   /* Calculate the altitude using the barometric pressure sensor */   /* Calculate the altitude using the barometric pressure sensor */
Ligne 467: Ligne 452:
     float temperature;     float temperature;
     bmp.getTemperature(&temperature);     bmp.getTemperature(&temperature);
-    /* Convert atmospheric pressure, SLP and temp to altitude */ +    }
-    //    Serial.print(F("Alt: ")); +
-    //    Serial.print(bmp.pressureToAltitude(seaLevelPressure, +
-    //    bmp_event.pressure, +
-    //    temperature)); +
-    //    Serial.print(F(" m; ")); +
-    /* Display the temperature */ +
-    //    Serial.print(F("Temp: ")); +
-    //    Serial.print(temperature); +
-    //    Serial.print(F(" C")); +
-  } +
-  //  Serial.println(F("")); +
-  //  delay(250);+
 } }
  
Ligne 533: Ligne 506:
   interrupts();   interrupts();
  
-  speedM1M3 = ((-100 + yawOUT100) * ch3+   speedM1 map(constrain(ch3 + pitchOUT, 0, 100), 0, 100, motorSpeedMin, motorSpeedMax); 
-  speedM2M4 = ((100 + yawOUT) / 100) * ch3+    speedM3 map(constrain(ch3 - pitchOUT, 0, 100), 0, 100, motorSpeedMin, motorSpeedMax); 
-  speedM1 = ((100 + rollOUT100) * speedM1M3+     speedM2 = map(constrain(ch3 rollOUT, 0, 100), 0, 100, motorSpeedMin, motorSpeedMax); 
-  speedM2 = ((100 pitchOUT) / 100) * speedM2M4; +    speedM4 = map(constrain(ch3 rollOUT, 0, 100), 0, 100, motorSpeedMin, motorSpeedMax); 
-  speedM3 = (((-100 + rollOUT/ 100)) * speedM1M3+ 
-  speedM4 = (((-100 + pitchOUT100)) * speedM2M4+  //>>>Appliquer le YAW
-  /*.....calcul des valeurs ci dessous avec les ch et le PID......*/+
 } }
  
Ligne 557: Ligne 529:
 /************************************************************************/ /************************************************************************/
  
-//Initialisation des moteurs : SECONDES+//Initialisation des moteurs : 10 SECONDES
 void initMotors() { void initMotors() {
-  //Serial.println("InitMotors"); +  Serial.println("InitMotors"); 
-  delay(5000);+
   motor1.attach(pinM1);   motor1.attach(pinM1);
   motor2.attach(pinM2);   motor2.attach(pinM2);
   motor3.attach(pinM3);   motor3.attach(pinM3);
   motor4.attach(pinM4);   motor4.attach(pinM4);
-  //  motor1.write(170); +  motor1.write(170); 
-  //  motor2.write(170); +  motor2.write(170); 
-  //  motor3.write(170); +  motor3.write(170); 
-  //  motor4.write(170); +  motor4.write(170); 
-  //  Serial.println("Brancher ALIM!!"); +  Serial.println("Brancher ALIM!!"); 
-  //  delay(5000);  //BRANCHER ALIM+  delay(5000);
   motor1.write(0);   motor1.write(0);
   motor2.write(0);   motor2.write(0);
Ligne 589: Ligne 561:
 } }
  
-void kill() { +</file> 
-  Serial.println("Interrupt"); +=== VI - Les réglages ===
-  stopAll++; +
-  motor1.write(0); +
-  motor2.write(0); +
-  motor3.write(0); +
-  motor4.write(0); +
-}+
  
-=== Les problèmes rencontré ===+Les réglages important sur un drone sont les PID (Proportionnel-Integral-Derivé). Pour effectuer ces différents réglages, nous avons suivi les astuces de ce site :  
 +http://fr3d.kazeo.com/reglages-et-astuces/reglages-et-astuces,r409844.html
  
-=== III - Évolution possible du drone ===+ 
 +=== VII - Les problèmes rencontré === 
 +== Les fixations des moteurs == 
 + 
 +== Le code  
 + 
 + 
 +=== VIII - Évolution possible du drone ===
 Nous souhaitons faire évoluer notre drone s’il nous reste du temps (et de l’argent). Nous ajouterions un GPS et un Raspberry Pi au drone. Le but serait de :   Nous souhaitons faire évoluer notre drone s’il nous reste du temps (et de l’argent). Nous ajouterions un GPS et un Raspberry Pi au drone. Le but serait de :  
   - Faire voler le drone avec la manette en sauvegardant le chemin pris grâce aux coordonnées GPS   - Faire voler le drone avec la manette en sauvegardant le chemin pris grâce aux coordonnées GPS
Ligne 609: Ligne 583:
 Raspberry Pi : 40 € Raspberry Pi : 40 €
  
-=== VI - Sites de nos recherches ===+=== IX - Sites de nos recherches ===
   * Wiki de Game of Drone 2013-2014    * Wiki de Game of Drone 2013-2014 
   * Adafruit   * Adafruit
Ligne 617: Ligne 591:
   * DiyDrones   * DiyDrones
          
-=== VII - Conclusion === 
- 
-On va gagner!  
  
wiki/god/not_today/home.1426636599.txt.gz · Dernière modification: 2016/09/11 11:00 (modification externe)