In the last week I generated a custom mixing file for a fixed wing airplane. It is somewhat comparable with the Bormatec Maja, but I got some extra features/control surfaces which I wanna control. Thus, I extended the mixing file a little bit. Generally, the mixing file is working exactly how I want it to work. However, when a change the CBRK_IO_SAFETY check (I want to disable this), the Pixhawk 2 only lets me control channel 1 till 5 of the main channels. When I change the CBRK_IO_SAFETY check back to zero, and power cycle the pixhawk it works again. Only when I just reboot the pixhawk via Qgroundcontrol it still doesnt work.
I did some more digging and I could isolate the line of code, which causes the problem. So in the file px4io.cpp on line 866-869 there is a check and the following function is called.
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_FORCE_SAFETY_OFF, PX4IO_FORCE_SAFETY_MAGIC);
This seems affect my mixing and disable main 6-7-8 channels. I check the status of the channels with the “pwm info” command. So my definition of not working is when the channels shows a pwm of 0 us, while working means anywhere between 1000 and 2000 us (depending on the configuration). I have uploaded to graphs in the attachement, which prove this output.
So my question is: Is this a small mistake in the code? Because in my opinion this should not happen. How can I resolve this problem? Since I kind of want to disable the IO safety. And why does it need a power cycle when changing the parameter back to the default value.
Moreover, I did try increasing the following value:
line 42: #define PX4IO_MAX_MIXER_LENGHT 230
However, this had no success. And the px4io status and pwm info behaviour is exactly the same. Also the mixing file is super simple. Just having a single mixer for a single channel, but I do use every channel (main and aux).
Also when I try and oversimplify the problem by just changing some mapping in the Bormatec Maja, while leaving everything else exactly the same, it still does not work. Right now I am only changing the last three mixers in the AAERTWF mixing file. Basically, adding an extra elevator and a wheel steerring (thus rudder). In principle, the maja airframe uses 8 main channels, thus I should be able to do that too.
If someone needs anymore information regarding this problem feel free to ask.
Any help is much appreciated!