@Alex-Kushleyev @modaltb
Hi, Thanks for your help. The following is my update:
(1) The ModalAI is using DShoot600 ESC protocal. This can be verified by DSHOT_CONFIG parameter in QGC. Also, by checking the Dshot.h source code, I can find the following information.
https://github.com/PX4/PX4-Autopilot/blob/main/src/drivers/dshot/DShot.h
/** Dshot PWM frequency, Hz */
static constexpr unsigned int DSHOT150 = 150000u;
static constexpr unsigned int DSHOT300 = 300000u;
static constexpr unsigned int DSHOT600 = 600000u;
static constexpr unsigned int DSHOT1200 = 1200000u;
static constexpr int DSHOT_DISARM_VALUE = 0;
static constexpr int DSHOT_MIN_THROTTLE = 1;
static constexpr int DSHOT_MAX_THROTTLE = 1999;
The Dshot frequency is f= 6*10^5Hz, so the time period is 1/f=1.6 us, and 1.6 us matches the time period of signal which is form my oscilloscope. Again, this verifies the Dshot600 is the right one.
For the the logged data from acturator_outputs, the value is around 800-1000 when quadcopter is hovering, which is makes sense to me since I guess the value range for acturator_outputs is [1,1999] according to DSHOT_MIN_THROTTLE = 1 and DSHOT_MAX_THROTTLE = 1999. According to acturator_outputs commands, right now I can verify my own thrust models.
Although right now I didn't fully understand how mixer works, however there are a few things that I can make sure is: The modalAI airframe type is quadcopter x, the vehicle is generic Quadcopter, therefore I go there https://github.com/modalai/px4-firmware/tree/1.11.3/ROMFS/px4fmu_common/init.d/airframes and trying to find the airframe source file, but I didn't find a file named xxxx_generic_quadcopter. I found this file which is called: 4001_quad_x, https://github.com/modalai/px4-firmware/blob/1.11.3/ROMFS/px4fmu_common/init.d/airframes/4001_quad_x, is this the airframe file that ModalAI using?
I assume it is, since it mentioned that @name Generic Quadcopter @type Quadrotor x, which matches the airframe type in QGC.
#!/bin/sh
#
# @name Generic Quadcopter
#
# @type Quadrotor x
# @class Copter
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output MAIN5 feed-through of RC AUX1 channel
# @output MAIN6 feed-through of RC AUX2 channel
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
# @output AUX4 feed-through of RC FLAPS channel
#
# @maintainer Lorenz Meier <lorenz@px4.io>
#
. ${R}etc/init.d/rc.mc_defaults
set MIXER quad_x
set PWM_OUT 1234
In above file, it set MIXER =quad_x, so I go there https://github.com/modalai/px4-firmware/tree/1.11.3/ROMFS/px4fmu_common, and find quad_x.main.mix(https://github.com/modalai/px4-firmware/blob/1.11.3/ROMFS/px4fmu_common/mixers/quad_x.main.mix). According to the mixer file, is there anyone who can help to explain it?(I tried to syntax of mixer file in https://docs.px4.io/master/en/concept/mixing.html, but it is still confusing.) And also why it is only defines the AUX1 and AUX2 mixer instead of Main mixer?
R: 4x
AUX1 Passthrough
M: 1
S: 3 5 10000 10000 0 -10000 10000
AUX2 Passthrough
M: 1
S: 3 6 10000 10000 0 -10000 10000
Failsafe outputs
The following outputs are set to their disarmed value
during normal operation and to their failsafe falue in case
of flight termination.
Z:
Z:
Will keep update once I know more about mixer~