PX4 / PX4-Autopilot

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

PWM does not ramp during arming #11800

Open nathanmcferrin opened 5 years ago

nathanmcferrin commented 5 years ago

Summary: With v1.8.2 stable, pwm does not ramp during arming, but rather transitions abruptly from the disarmed value (900 in my case) to the minimum value (1100 in my case). The lack of ramp causes certain motors I'm using to stall on arming roughly 5-10% of the time.

Steps used to produce the behavior: --Using Cube (ProfiCNC v2.1) Pixhawk. --Loaded v1.8.2 stable release via QGC. Note that I've also seen the same behavior when using a version built from the stable 1.8.2 built with make px4fmu-v3_default --Using quad x configuration (sys_autostart = 4001) Calibrated sensors, set circuit breakers as necessary to enable px4 to pass arm checks. --Set logger to log from power-up to power-down. Logging default and high rate data, although you can see it in either. --Armed via command line (commander arm) --Waited several seconds --Disarmed via command line (commander disarm)

Expected Behavior: Based on a brief look through pwm_limit.c, I expected a 0.5 second ramp from disarmed to min value. This value appears to be coded as a hard definition in pwm_limit.h (RAMP_TIME_US 500000).

Log file available at: https://review.px4.io/plot_app?log=9f75b199-eb52-436a-ab92-b45447e77624

Screenshots of PWM commanded from this log:

snip 1 snip 2

Note that the log/screenshots were from an arm/disarm cycle done on my desk via console. This was not an actual flight.

LorenzMeier commented 5 years ago

What is the result with current master / the development version?

nathanmcferrin commented 5 years ago

Just tried with the current master / development version, with the same result.

dagar commented 5 years ago

@nathanmcferrin could you share the output of pwm info?

nathanmcferrin commented 5 years ago

With the current master / development firmware:

pwm info snip
dagar commented 5 years ago

@nathanmcferrin where is the 2nd plot from?

image

nathanmcferrin commented 5 years ago

Second plot is same data as the first plot, just zoomed in to more accurately show the rise time.

nathanmcferrin commented 5 years ago

@LorenzMeier does the output of "pwm-info" indicate anything that may be disabling the PWM ramping?

julianoes commented 5 years ago

FYI @MaEtUgR

stale[bot] commented 5 years ago

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

MaEtUgR commented 5 years ago

Just to give some related higher level info: The position controller by default waits on any altitude control mode for the so called spoolup time (parameter MPC_SPOOLUP_TIME) by default one second for the motors to reach idle speed. The ramping of the motor output is not possible to do on that level since the idle speed is forced to the motors by the motor output driver.

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.

parakhm95 commented 3 years ago

So, for me, I was able to avoid this ramp skipping by setting COM_PREARM_MODE variable to disabled. Then, the MIN to ARM value ramp works as expected when using IO board for PWM output. Have to verify for SBUS as well. Hope this helps someone out.

This also relates to : https://github.com/PX4/PX4-Autopilot/issues/15364 also