Ci-dessous, les différences entre deux révisions de la page.
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/18 00:02] 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) | >remplir probleme rencontré (fixation moteur + code) | ||
- | >partie sur le PID et les réglages | + | |
===I - Présentation de l’équipe === | ===I - Présentation de l’équipe === | ||
Ligne 61: | 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 108: | 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 € | ||
- | === V - 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 115: | Ligne 115: | ||
- | === L’informatique du drone === | + | === V - L’informatique du drone === |
La programmation se fera sur la carte Arduino grâce à l' | La programmation se fera sur la carte Arduino grâce à l' | ||
- | <file c myexample.php> | + | <file c notToday.ino> |
#include " | #include " | ||
Ligne 143: | Ligne 142: | ||
const int pinCh5 = A4; | const int pinCh5 = A4; | ||
- | // | + | // |
volatile unsigned long timer_start1; | volatile unsigned long timer_start1; | ||
volatile unsigned long timer_start2; | volatile unsigned long timer_start2; | ||
Ligne 150: | Ligne 149: | ||
volatile unsigned long timer_start5; | volatile unsigned long timer_start5; | ||
- | // | + | // |
- | //was HIGH - the PWM pulse length. | + | |
volatile int pulse_time1; | volatile int pulse_time1; | ||
volatile int pulse_time2; | volatile int pulse_time2; | ||
Ligne 182: | Ligne 180: | ||
volatile int last_interrupt_time4; | volatile int last_interrupt_time4; | ||
volatile int last_interrupt_time5; | volatile int last_interrupt_time5; | ||
+ | |||
+ | |||
/ | / | ||
Ligne 218: | Ligne 218: | ||
// | // | ||
- | PID pidPitch(& | + | PID pidPitch(& |
- | PID pidRoll(& | + | PID pidRoll(& |
PID pidYaw(& | PID pidYaw(& | ||
Ligne 252: | Ligne 252: | ||
int speedM2M4 = 0; | int speedM2M4 = 0; | ||
- | int pinKill | + | const int |
- | volatile | + | const int motorSpeedMax |
Ligne 266: | Ligne 266: | ||
initInterrupt(); | initInterrupt(); | ||
initPID(); | initPID(); | ||
- | initMotors(); | + | initMotors(); |
- | pinMode(pinKill, | + | |
- | attachInterrupt(pinKill, | + | |
- | pinMode(13, OUTPUT); | + | |
} | } | ||
Ligne 275: | Ligne 272: | ||
void loop() | void loop() | ||
{ | { | ||
- | | + | |
- | | + | getRadio();// |
- | + | calcSpeed();// | |
- | digitalWrite(13, | + | updateMotors();// |
- | delay(500); | + | |
- | digitalWrite(13, | + | /// TEST_affichagePitch(); |
- | delay(500); | + | // TEST_affichageCanaux(); |
- | } | + | TEST_affichageMoteur(); |
- | else { | + | |
- | getSensor(); | + | |
- | | + | |
- | calcSpeed();// | + | |
- | updateMotors();// | + | |
- | /// TEST_affichagePitch(); | ||
- | // TEST_affichageCanaux(); | ||
- | TEST_affichageMoteur(); | ||
- | } | ||
} | } | ||
Ligne 301: | 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 | + | // |
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 423: | Ligne 411: | ||
/ | / | ||
/ | / | ||
+ | /* Code fourni par AdaFruit */ | ||
void initSensors() { | void initSensors() { | ||
if (!accel.begin()) { | if (!accel.begin()) { | ||
Ligne 448: | Ligne 436: | ||
accel.getEvent(& | accel.getEvent(& | ||
if (dof.accelGetOrientation(& | if (dof.accelGetOrientation(& | ||
- | /* ' | + | |
- | // Serial.print(F(" | + | rollIN = map(orientation.roll, |
- | // Serial.print(orientation.roll); | + | pitchIN = map(orientation.pitch, |
- | // Serial.print(F("; | + | |
- | // Serial.print(F(" | + | |
- | // Serial.print(orientation.pitch); | + | |
- | // Serial.print(F("; | + | |
- | rollIN = map(orientation.roll, | + | |
- | pitchIN = map(orientation.pitch, | + | |
} | } | ||
/* Calculate the heading using the magnetometer */ | /* Calculate the heading using the magnetometer */ | ||
mag.getEvent(& | mag.getEvent(& | ||
if (dof.magGetOrientation(SENSOR_AXIS_Z, | if (dof.magGetOrientation(SENSOR_AXIS_Z, | ||
- | | + | |
- | // Serial.print(F(" | + | yawIN = map(orientation.heading, |
- | // Serial.print(orientation.heading); | + | |
- | // Serial.print(F("; | + | |
- | yawIN = map(orientation.heading, | + | |
} | } | ||
/* Calculate the altitude using the barometric pressure sensor */ | /* Calculate the altitude using the barometric pressure sensor */ | ||
Ligne 473: | Ligne 452: | ||
float temperature; | float temperature; | ||
bmp.getTemperature(& | bmp.getTemperature(& | ||
- | | + | } |
- | // Serial.print(F(" | + | |
- | // Serial.print(bmp.pressureToAltitude(seaLevelPressure, | + | |
- | // bmp_event.pressure, | + | |
- | // temperature)); | + | |
- | // Serial.print(F(" | + | |
- | /* Display the temperature */ | + | |
- | // Serial.print(F(" | + | |
- | // Serial.print(temperature); | + | |
- | // Serial.print(F(" | + | |
- | | + | |
- | // Serial.println(F("" | + | |
- | // delay(250); | + | |
} | } | ||
Ligne 539: | Ligne 506: | ||
interrupts(); | interrupts(); | ||
- | speedM1M3 | + | |
- | | + | |
- | speedM1 = ((100 + rollOUT) / 100) * speedM1M3; | + | |
- | speedM2 = ((100 + pitchOUT) / 100) * speedM2M4; | + | speedM4 = map(constrain(ch3 - rollOUT, 0, 100), 0, 100, motorSpeedMin, |
- | speedM3 = (((-100 + rollOUT) / 100)) * speedM1M3; | + | |
- | speedM4 = (((-100 + pitchOUT) / 100)) * speedM2M4; | + | //>>> |
- | /*.....calcul des valeurs ci dessous avec les ch et le PID......*/ | + | |
} | } | ||
Ligne 563: | Ligne 529: | ||
/ | / | ||
- | // | + | // |
void initMotors() { | void initMotors() { | ||
- | | + | Serial.println(" |
- | | + | |
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); |
- | // | + | motor2.write(170); |
- | // | + | motor3.write(170); |
- | // | + | motor4.write(170); |
- | // | + | Serial.println(" |
- | // | + | delay(5000); |
motor1.write(0); | motor1.write(0); | ||
motor2.write(0); | motor2.write(0); | ||
Ligne 595: | Ligne 561: | ||
} | } | ||
- | void kill() { | ||
- | Serial.println(" | ||
- | stopAll++; | ||
- | motor1.write(0); | ||
- | motor2.write(0); | ||
- | motor3.write(0); | ||
- | motor4.write(0); | ||
- | } | ||
</ | </ | ||
- | === Les problèmes rencontré | + | === VI - Les réglages |
- | === III - Évolution possible du drone === | + | 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:// | ||
+ | |||
+ | |||
+ | === 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 615: | 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 623: | Ligne 591: | ||
* DiyDrones | * DiyDrones | ||
| | ||
- | === VII - Conclusion === | ||
- | |||
- | On va gagner! | ||