diff --git a/README.md b/README.md index b4db2ef5..0e698510 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ +Flight controller for the Minion + +![minion](https://raw.githubusercontent.com/hoffmannmatheus/dRehmFlight/main/minion.jpg) + +First Flight: https://youtu.be/dd2HGMvTOR4 + +--- +Original readme: + ![dRehmFlight Logo](https://github.com/nickrehm/dRehmFlight/blob/master/dRehmFlight%20Logo.png) [Intro Video](https://www.youtube.com/watch?v=tlD0C5CrWcA&lc=Ugx6m02xjHk8QH19vd94AaABAg) diff --git a/Versions/dRehmFlight_Teensy_BETA_1.3/dRehmFlight_Teensy_BETA_1.3.ino b/Versions/dRehmFlight_Teensy_BETA_1.3/dRehmFlight_Teensy_BETA_1.3.ino index 448706f0..36612a57 100644 --- a/Versions/dRehmFlight_Teensy_BETA_1.3/dRehmFlight_Teensy_BETA_1.3.ino +++ b/Versions/dRehmFlight_Teensy_BETA_1.3/dRehmFlight_Teensy_BETA_1.3.ino @@ -417,10 +417,24 @@ void loop() { getDesState(); //Convert raw commands to normalized values based on saturated control limits //PID Controller - SELECT ONE: - controlANGLE(); //Stabilize on angle setpoint + //controlANGLE(); //Stabilize on angle setpoint //controlANGLE2(); //Stabilize on angle setpoint using cascaded method. Rate controller must be tuned well first! //controlRATE(); //Stabilize on rate setpoint + if (channel_6_pwm > 1800) { + maxRoll = 15.0; + maxPitch = 15.0; + maxYaw = 190.0; + controlANGLE(); + } else { + maxRoll = 220.0; + maxPitch = 220.0; + maxYaw = 190.0; + controlRATE(); + } + + + //Actuator mixing and scaling to PWM values controlMixer(); //Mixes PID outputs to scaled actuator commands -- custom mixing assignments done here scaleCommands(); //Scales motor commands to 125 to 250 range (oneshot125 protocol) and servo PWM commands to 0 to 180 (for servo library) @@ -1573,17 +1587,17 @@ void setupBlink(int numBlinks,int upTime, int downTime) { void printRadioData() { if (current_time - print_counter > 10000) { print_counter = micros(); - Serial.print(F(" CH1: ")); + Serial.print(F(" CH1:")); Serial.print(channel_1_pwm); - Serial.print(F(" CH2: ")); + Serial.print(F(" CH2:")); Serial.print(channel_2_pwm); - Serial.print(F(" CH3: ")); + Serial.print(F(" CH3:")); Serial.print(channel_3_pwm); - Serial.print(F(" CH4: ")); + Serial.print(F(" CH4:")); Serial.print(channel_4_pwm); - Serial.print(F(" CH5: ")); + Serial.print(F(" CH5:")); Serial.print(channel_5_pwm); - Serial.print(F(" CH6: ")); + Serial.print(F(" CH6:")); Serial.println(channel_6_pwm); } } @@ -1591,13 +1605,13 @@ void printRadioData() { void printDesiredState() { if (current_time - print_counter > 10000) { print_counter = micros(); - Serial.print(F("thro_des: ")); + Serial.print(F("thro_des:")); Serial.print(thro_des); - Serial.print(F(" roll_des: ")); + Serial.print(F(" roll_des:")); Serial.print(roll_des); - Serial.print(F(" pitch_des: ")); + Serial.print(F(" pitch_des:")); Serial.print(pitch_des); - Serial.print(F(" yaw_des: ")); + Serial.print(F(" yaw_des:")); Serial.println(yaw_des); } } @@ -1605,11 +1619,11 @@ void printDesiredState() { void printGyroData() { if (current_time - print_counter > 10000) { print_counter = micros(); - Serial.print(F("GyroX: ")); + Serial.print(F("GyroX:")); Serial.print(GyroX); - Serial.print(F(" GyroY: ")); + Serial.print(F(" GyroY:")); Serial.print(GyroY); - Serial.print(F(" GyroZ: ")); + Serial.print(F(" GyroZ:")); Serial.println(GyroZ); } } @@ -1617,11 +1631,11 @@ void printGyroData() { void printAccelData() { if (current_time - print_counter > 10000) { print_counter = micros(); - Serial.print(F("AccX: ")); + Serial.print(F("AccX:")); Serial.print(AccX); - Serial.print(F(" AccY: ")); + Serial.print(F(" AccY:")); Serial.print(AccY); - Serial.print(F(" AccZ: ")); + Serial.print(F(" AccZ:")); Serial.println(AccZ); } } @@ -1629,11 +1643,11 @@ void printAccelData() { void printMagData() { if (current_time - print_counter > 10000) { print_counter = micros(); - Serial.print(F("MagX: ")); + Serial.print(F("MagX:")); Serial.print(MagX); - Serial.print(F(" MagY: ")); + Serial.print(F(" MagY:")); Serial.print(MagY); - Serial.print(F(" MagZ: ")); + Serial.print(F(" MagZ:")); Serial.println(MagZ); } } @@ -1641,11 +1655,11 @@ void printMagData() { void printRollPitchYaw() { if (current_time - print_counter > 10000) { print_counter = micros(); - Serial.print(F("roll: ")); + Serial.print(F("roll:")); Serial.print(roll_IMU); - Serial.print(F(" pitch: ")); + Serial.print(F(" pitch:")); Serial.print(pitch_IMU); - Serial.print(F(" yaw: ")); + Serial.print(F(" yaw:")); Serial.println(yaw_IMU); } } @@ -1653,11 +1667,11 @@ void printRollPitchYaw() { void printPIDoutput() { if (current_time - print_counter > 10000) { print_counter = micros(); - Serial.print(F("roll_PID: ")); + Serial.print(F("roll_PID:")); Serial.print(roll_PID); - Serial.print(F(" pitch_PID: ")); + Serial.print(F(" pitch_PID:")); Serial.print(pitch_PID); - Serial.print(F(" yaw_PID: ")); + Serial.print(F(" yaw_PID:")); Serial.println(yaw_PID); } } @@ -1665,17 +1679,17 @@ void printPIDoutput() { void printMotorCommands() { if (current_time - print_counter > 10000) { print_counter = micros(); - Serial.print(F("m1_command: ")); + Serial.print(F("m1_command:")); Serial.print(m1_command_PWM); - Serial.print(F(" m2_command: ")); + Serial.print(F(" m2_command:")); Serial.print(m2_command_PWM); - Serial.print(F(" m3_command: ")); + Serial.print(F(" m3_command:")); Serial.print(m3_command_PWM); - Serial.print(F(" m4_command: ")); + Serial.print(F(" m4_command:")); Serial.print(m4_command_PWM); - Serial.print(F(" m5_command: ")); + Serial.print(F(" m5_command:")); Serial.print(m5_command_PWM); - Serial.print(F(" m6_command: ")); + Serial.print(F(" m6_command:")); Serial.println(m6_command_PWM); } } @@ -1683,19 +1697,19 @@ void printMotorCommands() { void printServoCommands() { if (current_time - print_counter > 10000) { print_counter = micros(); - Serial.print(F("s1_command: ")); + Serial.print(F("s1_command:")); Serial.print(s1_command_PWM); - Serial.print(F(" s2_command: ")); + Serial.print(F(" s2_command:")); Serial.print(s2_command_PWM); - Serial.print(F(" s3_command: ")); + Serial.print(F(" s3_command:")); Serial.print(s3_command_PWM); - Serial.print(F(" s4_command: ")); + Serial.print(F(" s4_command:")); Serial.print(s4_command_PWM); - Serial.print(F(" s5_command: ")); + Serial.print(F(" s5_command:")); Serial.print(s5_command_PWM); - Serial.print(F(" s6_command: ")); + Serial.print(F(" s6_command:")); Serial.print(s6_command_PWM); - Serial.print(F(" s7_command: ")); + Serial.print(F(" s7_command:")); Serial.println(s7_command_PWM); } } @@ -1703,7 +1717,7 @@ void printServoCommands() { void printLoopRate() { if (current_time - print_counter > 10000) { print_counter = micros(); - Serial.print(F("dt = ")); + Serial.print(F("dt:")); Serial.println(dt*1000000.0); } } diff --git a/minion.jpg b/minion.jpg new file mode 100644 index 00000000..4d10f850 Binary files /dev/null and b/minion.jpg differ