Disable of selected PWM outputs in disarmed

Hi,
our aircraft have several actuators that are relatively dangerous if it spins. (In our case it is prerotator that spins up the large rotor). This output is connected to AUX input by the mixer.

And if we need to restart the autopilot, it will start spin when IO boots, which is very dangerous.

Is there any ‘systematic’ way to prevent this problem? It would be best to turn off PWM output when it is disarmed, just as it is done with the motor (throttle).

For our use, I have modified the autopilot code (code of IO processor). But these edits are unmergeable with master.

Would it be possible to create some parameters where it would be possible to set off (no signal) any aux input when it is disarmed?

How do you trigger this? What exactly is the order of events that makes this happen?

And why are this actuators connected to Aux? Aux is usually just passthrough from RC, so not something that PX4 controls.

Thank you for replay,

today we control it directly from the RC because we don’t yet have a PX4 application for automatic rotor spinning. Therefore this channel is mapped as AUX input and in main mixer it is mixed to some (main) PWM output.

In future, this should be solved by PX4 application which will very slowly increase the RPM to the operating speed. And than it will hold target speed.

This happens when we had the rotor spinning and then we need to restart the autopilot using the SW (due to another error - “accel inconsistent”, “high avionic voltage” (avionic voltage was OK), … ). So click the restart button and after restarting the rotor motor starts to spin. It’s dangerous. In that time autopilot was disarmed and safety-safety.

As I read from code, this feature is fixed (hard-coded) for the motor (throttle). I would extend this feature for selectable actuators. What is the best way to do this?

Can you check what the _DISx and _FAILSAFE params for these channels are set at? Maybe that would fix it.
See e.g.:
https://dev.px4.io/en/advanced/parameter_reference.html#PWM_AUX_DIS5
https://dev.px4.io/en/advanced/parameter_reference.html#PWM_AUX_FAIL5

We have it connected to MAIN outputs (from IO processor)

Our related parameters are:

PWM_AUX_DISx, -1
PWM_AUX_FAILx, -1
PWM_AUX_DISARMED, 1500
PWM_AUX_MAX, 2000
PWM_AUX_MIN, 2000

But we use MAIN port

PWM_MAIN_DIS6, -1
PWM_MAIN_FAIL6, -1
PWM_MAIN_MAX6, -1
PWM_MAIN_MIN6, -1
PWM_MAIN_REV6, -1
PWM_MAIN_TRIM6, 0.0

In parameter list (from log) I can’t see parameter ‘PWM_DISARM’, ‘PWM_MIN’ and ’ and ‘PWM_MAX’. Is possible that these parameters are missing in our configuration? I assume that the default values are used?

I don’t have autopilot with me. So when I get to it, I’ll try to set up port-related parameters (PWM_MAIN_xxx6) or I’ll try to use AUX outputs.

But I still don’t understand why this feature for the throttle is hardcoded?
Why there is this code, PX4/Firmware/…/px4iofirmware/mixer.cpp#L490-L499, when it should be possible to set it with parameters.

I’m not sure I follow but I would suggest to set the params for disarmed and failsafe for what you need and test that.

After many attempts of setting up parameters, there has always been an option to get motor spinning. Which is very dangerous in our case of spinning rotor on full (or half) of power.

It start to spin in cases - SW restart of autopilot (ESC is without any spin protection), pressing safety button in ARMed state, … It was a little vary depends on parameters and main/aux port.

I suggest to do it more systematically. After looking into code, I have found part where is ‘safety-safety’ mode solved for use with the throttle. And this precaution is based, if mixer input contains throttle mixer input…

The suggested solution is to add new parameters. Something like PWM_MAIN_DANGER1 = 1, which will set NAN to the corresponding output. After this adjustment, it should be as safe as the throttle output. (where it works reliably)

Is it acceptable?

Today I noticed, that something similar is mentioned in the PX4 documentation.

  • Disarmed: There is no power to motors or actuators.
  • Pre-armed: Motors/propellers are locked but actuators for non-dangerous electronics are powered (e.g. ailerons, flaps etc.).
  • Armed: Vehicle is fully powered. Motors/propellers may be turning (dangerous!)

https://docs.px4.io/master/en/advanced_config/prearm_arm_disarm.html

But there is any option to set output manually as (non)dangerous actuator. Therefore, I propose a solution from the last post.

Outputs that are defined (correctly) as motors should not lead to motors spinning up, otherwise that’s a bug!

Could you describe how this can be reproduced: PX4 version, airframe chosen/mixer loaded, other param configuration, and which output is not working correctly?

Hi Julian,

Yes, outputs were defined as the output of AUX input. And I suppose that it was not marked as motor output. Is there some way how to mark mixer with aux input it as motor output?

In code, I can see, that motor output is defined as mixer output with input from group 0 input 3 or group 1 input 1.

Our setup: GitHub master (around 1 month old), tested with multiple older master versions.
Airframe: Standard airplane, our AutoG2 airframe.

The mixer of problematic output is a simple thought-pass mixer from aux input. On this output is standard ESC.

Related params:

PWM_MAIN_DIS5 1000
PWM_MAIN_FAIL5 1000
PWM_MAIN_TRIM5 0
PWM_MAIN_REV5 0

It is sufficient informations?

I think there is no conceptual support for disabling dangerous ‘outputs’. Not only motors.

How do you restart the autopilot?

Autopilot was restarted trough QGC (Parameters->tools->reboot). Same behaviour is on restart trough mavlink console with ‘reboot’ command.

Ok, that’s what I suspected. And are you armed at that moment or do you disarm before doing that?

It was disarmed. But in safety-off mode (it means it was in Pre-armed state accordind to the documentation)

Hm ok, in that case that is concerning!

Can you tell me the SYS_AUTOSTART and which channel it happens?

I was thinking you are using 2100 standard plane but it has flaps on MAIN channel 5, so that doesn’t seem right.

With standard airplane (2100) it was connected to AUX2 port. And the same behaviour.

At output MAIN5 it was connected at our autogyro. The new mixer is not yet merged. And it stayed on the SD card. So I will able to send full mixer after the end of this coronavirus session…

So, then I will be able to send more information… Thanks.