am building new quad copter in the toy drone category with my own controller,
i have a stability issue, due to motor vibration the gyro sensor value getting error percentage high. so kindly help anyone. i gave all details about my toy drone hardware and software in below.
Hardware Components Using;
● Gyro:MPU9250
● MCU: STM32F103
● Voltage regulator 3.7 to 3.3v stepdown
● Motors -720(RPM 39000)
● Propeller - 65mm
● Total weight - 50g
Software Details
Keil as compiler
MhonyQuapernionFilter (yaw ,pitch, roll Calculation)
PID Calculation
float pid_p_gain_pitch = 1.75;
float pid_i_gain_pitch = 0.00;
float pid_d_gain_pitch = 3.25;
int pid_max_pitch c = 400;
// pitch,roll yaw calculated by MahonyQuaternion filter(mpu9250)
pid_error_temp = pitch_sensor_value - pid_pitch_setpoint_from remote;
pid_i_mem_pitch += pid_i_gain_pitch * pid_error_temp;
if(pid_i_mem_pitch > pid_max_pitch)pid_i_mem_pitch = pid_max_pitch;
else if(pid_i_mem_pitch < pid_max_pitch * -1)pid_i_mem_pitch = pid_max_pitch * -1;
pid_output_pitch = pid_p_gain_pitch * pid_error_temp + pid_i_mem_pitch +
pid_d_gain_pitch * (pid_error_temp - pid_last_pitch_d_error);
if(pid_output_pitch > pid_max_pitch)pid_output_pitch = pid_max_pitch;
else if(pid_output_pitch < pid_max_pitch * -1)pid_output_pitch = pid_max_pitch * -1;
pid_last_pitch_d_error = pid_error_temp;
float pidcal =pid_error_temp;
m1pwm = throt + pid_output_pitch;
m2pwm = throt - pid_output_pitch;
m3pwm = throt - pid_output_pitch;
m4pwm = throt + pid_output_pitch;
//motor pwm value is 100 to 1000
Issues
PID tuning Issue
P,I,D values ?
Maximum and minimum value of PID calculation result ?
PWM value Range we are using 100 to 1000
Throttle value Range we are using 100 to 1000