8000 Fix graph for Arduino IDE serial plotter by hoffmannmatheus · Pull Request #12 · nickrehm/dRehmFlight · GitHub
[go: up one dir, main page]

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1573,137 +1587,137 @@ 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);
}
}

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);
}
}

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);
}
}

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);
}
}

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);
}
}

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);
}
}

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);
}
}

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);
}
}

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);
}
}

void printLoopRate() {
if (current_time - print_counter > 10000) {
print_counter = micros();
Serial.print(F("dt = "));
Serial.print(F("dt:"));
Serial.println(dt*1000000.0);
}
}
Expand Down
Binary file added minion.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
0