New airframe implementation

Well, following the thread on google group: Redirecting to Google Groups

I added

sh /etc/init.d/rc.mc_defaults

which set VEHICLE_TYPE to mc into my rc file.
The PX4 board still doesn’t boot.
I added some logging output to rc files with this kind of commands :

echo “INFO [init] setting Mixer” $MAV_TYPE >> $LOG_FILE

That show me that the boot process stops when reaching the pwm rate command
Currently I have defined PWM_OUT to 12345.
If I change the PWM OUT to 1234, boot process exits correctly.
Can someone explain me why this command fail with this parameter?

Here is the guide to add a new airframe:
http://dev.px4.io/airframes-adding-a-new-frame.html

Hi Lorenz, thanks for your feedback.
Currently I managed to add mixers and code to deal with the new airframe, mostly following the work from Trent Lukaczyk / aerialhedgehog
So far I miss information on the behaviour of the pwm command.
Via the USB serial Pixhawk console I tried to run the command
nsh> pwm rate -c 12345 -r 400
which give me the following output:
ERROR [pwm] PWM_SERVO_SET_SELECT_UPDATE_RATE ERROR [pwm] Task exited with errno=22
Errno value meaning EINVAL / “Invalid argument” as defined in errno-base.h
Looking at the PWM_OUT values used so far, I can find 4, 3, 5, 34, 1234, 12345678, none.
Are there some forbidden values? And why?

Nelson.

So I managed to make my airframe configuration work with PWM_OUT set to 12345678.
It would be nice if someone can explain the valid values for this system variable.

Nelson.

Following is the copy of an old document. It may answer your question.

Output Groups
The hardware generating the PWM signal is grouped into different timers, and each timer outputs on one or multiple pins. These pins can change their output rate only together. The three groups for IO (MAIN output on Pixhawk) are:

  • channel group 0: channels 1 2
  • channel group 1: channels 5 6 7 8
  • channel group 2: channels 3 4
    Attempting to set only a part of the channels of an output group to a different rate will fail, as the whole group has to be set at once

Yes thanks @NJG, it’s the answer to my question!
Based on your answer I found a pixhawk link explaining that:
https://pixhawk.org/firmware/apps/pwm
But no way to find a link to this page in the px4 documentation…
Nelson.