Custom Airframe

Hi, my goal is to create a custom air-frame, of a unique configuration (non planner quad-copter) and then test controller etc.
A similar config was done by Jaeyoung Lim at DIYdrones
http://diydrones.com/profiles/blogs/non-planar-quadrotor-layout-flight-test

Q1. How does one add this airframe configuration to PX4? Does it ONLY require adding a mixer file?

Q2. Any Ideas on how to change the mixer file for a config. like this? Quad_x with motors at an offset

Thanks!

@Arjuna.Mendis Did you figure out the answer yet?

My way is,
in multi_tables.py, add your own airframe referred to other airframes, i.g. ABC.
Then in your esc driver, assign the MultirotorGeometry object with ABC.
The mixer is generated automatically, and apply with the selected airframe.
Not clear to add it in QGC or other UI.

@langxm1223 Hi Langxm1123, thanks so much for your reply.
Can you elaborate this step, since I am not sure how to do this:

Then in your esc driver, assign the MultirotorGeometry object with ABC.

What is the file of ‘esc driver’ should I edit ?

The mixer is generated automatically, and apply with the selected airframe.

Do I need just run the function multi_tables.py, and the file will be created in the folder:
/home/chuong/src/Firmware/ROMFS/px4fmu_common/mixers

Thanks in advance.

OK. I think the whole story is this.
The esc driver is dependent on your setup.
The generated file is in build folder, mixer_multirotor.generated.h, not in mixers folder.
There should be a new MultirotorMixer if your drone is multicopter.
When this mixer is initializing, it will search in mixers folder for the airframe predefined, i.g. in quad_x.main.mix, 4x means a specific airframe type.
This 4x corresponds to the key in multi_tables.py, so that the mixer could find the correct geometry.
If there is no such mixer existed, it will try to use default mixer, i.e. quad_x if in multicopter.
So if for your own geometry, you can either add it in mixers folders+add new geometry in multi_tables.py+change load mixer command in config, or add new geometry in multi_tables.py + change in esc driver to load it directly.
This is my understanding. if anything goes wrong, please let me know.

1 Like

Thanks Langxm1223, I get it, but there are other questions, such as:

  1. How to specify the position of motors, arm length, tilt angle of motor, …?
  2. To me, the following definition, which only specifies the arm angle and motor direction, is not enough for my configuration :

quad_x = [
[ 45, CCW],
[-135, CCW],
[-45, CW],
[135, CW],
]

So I take a look of the mixer_multirotor.generated.h file, which is generated by the multi_table.py.
I found that besides the configuration defined in the multi_table.py, there are other configs, such as

const MultirotorMixer::Rotor _config_quad_vtail[] = {
	{ -2.331288,  1.111111, -0.674847,  0.277778 },
	{  0.057841, -1.571348, -0.231364,  0.314270 },
	{  2.331288,  1.111111,  0.674847,  0.277778 },
	{ -0.057841, -1.571348,  0.231364,  0.314270 },
};

I further found that, in /Firmware/src/lib/mixer/geometries, there are files quad_vtail, etc. This toml file is actually specify all the geometry info. However, here are my next questions:

  1. Why does not multi_table.py mention about these quad_vtail.toml file, but it is still generated in the mixer_multirotor.generated.h?
  2. @mhkabir, I see you pull the request for the documents of this topic, but I can not find it from anywhere?
    Thanks for your help.
  1. There is no need to put arm length in the mixer, only angle matters.
    The different length effect could be adjusted by different PID. Mixer only determines the ratio of each motor.
  2. I think what I said is a little bit deprecated. px_generate_mixers.py would import toml file to generate mixer_multirotor_normalized.generated.h instead of multi_table.py and mixer_multirotor.generated.h file.
    Hope current developers would clarify this.