PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.44k stars 13.48k forks source link

Where to find quadrotor parameters and matrix allocation in the firmware ? #14149

Open islamdib opened 4 years ago

islamdib commented 4 years ago

Hello, Im new in this domaine. I want to modify the quadrotor PID parameters directly in hte firmware then to change the matrix allocation (control inputs U_i funtion of rotations speed Omega_i).

Please, enyone to tell me where to find this parameters ?

julianoes commented 4 years ago

Can you point to the place in code where you want to change it?

islamdib commented 4 years ago

I want to stabilize my quadrotor which is originaly in the X-morphology Ive four servomotors which allow to obtain an H-morphology (negociate in narrow space). so the inertia matrix have to be changed then the allocation matrix too. I dont know where to find this parameters ?

islamdib commented 4 years ago

Can you point to the place in code where you want to change it?

home/dib/Firmware/src/modules/mc_att_control/mc_att_control_params.c Im not sure, I think this is the corresponding folder

julianoes commented 4 years ago

The controls just output angular rates and thrust. This is then mixed in a mixer. I think you want to read about that first: https://dev.px4.io/master/en/concept/mixing.html

saengphet commented 4 years ago

I want to stabilize my quadrotor which is originaly in the X-morphology Ive four servomotors which allow to obtain an H-morphology (negociate in narrow space). so the inertia matrix have to be changed then the allocation matrix too. I dont know where to find this parameters ?

Are you looking for this part? https://github.com/PX4/Firmware/tree/master/src/lib/mixer/MultirotorMixer

islamdib commented 4 years ago

@saengphet
now Im working with simulink the problem is that rotors haven't the same speed so I think that I have to change PID parameters in the first part. In the second part , I didn't understand the command calculation formula: % Quad X M1 = uint16(((Roll + Pitch - Yaw) / 2 Thrust + Thrust) single(1000)) + idle_PWM; M2 = uint16(((-Roll + Pitch + Yaw) / 2 Thrust + Thrust) single(1000)) + idle_PWM; M3 = uint16(((-Roll - Pitch - Yaw) / 2 Thrust + Thrust) single(1000)) + idle_PWM; M4 = uint16(((Roll - Pitch + Yaw) / 2 Thrust + Thrust) single(1000)) + idle_PWM; M5 = uint16(1000); M6 = uint16(1000);

Capture

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.