Flight control for tiltrotor


I have this new airframe and the following controls
Main outputs: 8 VTOL motors
Aux outputs:
1 elevator
2 aileron
1 rudder
1 aux for 4 tilt motors

Because the motors will tilt the leading edge rotors, Iā€™m wondering how to modify pixhawk software flight control so that it is aware of tilt motors and takes care of transition from VTOL to cruise and back.
On my RC, I have one toggle switch to signal transition. What Iā€™m struggling with is how to correctly modify pixhawk flight control software?
Iā€™m using pixhaw 2.4.8.
Any help on flight control is appreciated.
@LorenzMeier @bresch Could you please share your expert opinion?

Thanks for all your help.

Let me share the way, I think I will implement it. Please correct me if Iā€™m wrong.

When the transition switch is toggled, the aircraft starts to transition from MC to fixed wing flight. I know the airspeed at which the tilt motor should be powered to tilt the leading edge rotors for forward flight. Using an airspeed data, software can send a command to tilt motors and switch of trailing edge rotors off. This can happen for both VTOL transitions
mode::TRANSITION_TO_FW and mode::TRANSITION_TO_MC in the VtolAttitudeControl::Run() method.

My doubt is about the mixer generated based on geometry because it is generated for one position of rotors when they are vertical. How will the thrust components be resolved and handled during forward and reverse transition? What Iā€™d like to see is a smooth transition without pitch up or down during transitions.
Please help!
Thanks,
Kashyap

Hi, @gkashyap I think your airframe isnā€™t really different from a standard tiltrotor (such as the Convergence). Isnā€™t it working using the usual tiltrotor airframe config + mapping the outputs properly?

Just in case, @sfuhrer is more up-to-date with the current tiltrotor code.

Hi @gkashyap, as @bresch mentions your setup doesnā€™t strongly differ from other tiltrotor systems that are officially supported by PX4 - like the Convergence. The mixing problem you mention (roll/yaw coupling) is absolutely correct - though normally it doesnā€™t prevent the vehicle from doing stable transitions.

  • Front-transitions: Due to the nature of tiltrotors, you have a lot of possible forward thrust that accelerates the vehicle quite fast to an airspeed region that starts providing aerodynamic stability, such that actually little control actuation is needed to keep it stable (make sure that your vehicle is aerodynamically well designed)
  • Back-transitions: motors are immediately tilted upwards, without tilt - thus no problem here.

While the static mixer doesnā€™t really prevent stable transitions on most vehicles, we still are currently working on adapting the control pipeline to replace the mixers with a dynamic control allocation. Any contributions/flights testing there would be highly appreciated! https://github.com/PX4/Firmware/pull/13351. With that in, we could also e.g. support a hybrid flight mode where the user can fly the vehicle with any motor tilt.

Thanks for pitching in @bresch @sfuhrer. I agree with you. I was a concerned because I didnā€™t want to lose my aircraft again.
I did some digging into the code last night and I saw that there is a Tiltrotor class. Iā€™ll start my work from there and adapt the code to my needs.
Sure, Iā€™ll be happy to contribute to the control allocation development. Let me first go through and analyze the code and will start when I develop a good understanding.
Thanks for your time. :smiley:

Kind regards,
Kashyap

Hi Kashyap, I want to change airframe wrt my airframe , I donā€™t want to reinvent the wheel but I donā€™t know where and which folders or files can be changable , I know your post is old but I donā€™t find anything about changing existing airframe with clear explanation maybe they were easiy but I am beginner of beginner. :expressionless:

Hi Tugbakara,
Sorry for the late response. Iā€™m not active on the forum these days.
If the directory structure has changed slightly, you should still be able to find these files and make changes. It is not described anywhere and I understand your frustration. It took a bit of digging and detective work to determine everything.

Here are the steps, Iā€™ve used ā€˜_trā€™ suffix to differentiate the new file.

Add a new config file as defined here: Adding a New Airframe Ā· PX4 Developer Guide
It is best to start by reusing and modifying a config file which most closely resembles the aircraft that we have. In this case it was ā€œ13010_claireā€.
a. The first airframe file is defined to be 13020_tr and is added to src/Firmware/ROMFS/px4fmu_common/init.d/airframes.
b. Update the CMakeLists.txt in /src/Firmware/ROMFS/px4fmu_common/init.d/airframes to include 13020_tr in the build.
c. Define the mixers: main and aux files here: /src/Firmware/ROMFS/px4fmu_common/mixers (tr.main.mix and tr.aux.mix).
d. Update the CMakeLists.txt in /src/Firmware/ROMFS/px4fmu_common/mixers where the mixers were defined.
e. For SITL configuration define the mixer in /src/Firmware/ROMFS/px4fmu_common/mixers-sitl and update the CMakeList.txt file.
f. Update the toml file in /src/Firmware/src/lib/mixer/MultirotorMixer/geometries. This file is tr.toml.
g. Update the CMakeLists.txt in /src/Firmware/src/lib/mixer/MultirotorMixer for the new toml file added for mixer.
h. In the file ā€œFirmware/src/modules/simulator/simulator_mavlink.cppā€ modify the case statement ā€œcase MAV_TYPE_VTOL_TILTROTORā€ to update ā€œn = 8ā€ for 8 motors. Adjust as per your case.
i. Run the ā€œmake airframe_metadataā€ command from /src/Firmware to build the metadata used by QGroundControl for new airframe.
j. Build px4.
k. Build
j. Launch QGroundControl and connect with pixhawk board to check that new airframe is displayed in the group to which airframe was added. The airframe can be seen only after flashing the firmware. It should appear in VTOL tiltrotors group.

Thanks,
Kashyap

In addition you have the following examples:

Hi gkashyap, thanks for reply Ichanged this airframe a little and I added its aux.mix file into sd card of the fc with the same name on ~/PX4-Autopilot/ROMFS/px4fmu_common/mixers ,and then I replug the sd and I opened QGC but nothing happened, I donā€™t know when I changed existing airframe aux file something has to happen or shown me in QGC?
And this is the changes in my aux file because I just want to eliminate 2 tilt servos which are in the back for two motors, and the elevator and rudder I wan to make them as one for vtail. Here is my changes what I made, but I donā€™t get it itā€™s working or not:
I summirize the steps as mentioned in doc forum:

  1. I create etc/mixers folder in SD card of fc.

  2. In the mixer folder I create which its name is vtol_TTTTAAER.aux.mix ( same as in folder ~/PX4-Autopilot/ROMFS/px4fmu_common/mixers.

  3. Thatā€™s is the changes that I made:

# Generic quadplane tiltrotor servo mixer

# @board px4_fmu-v2 exclude

# Tilt mechanism servo mixer
---------------------------
# front left up:2000 down:1000
M: 1
S: 1 4      0 -20000  10000 -10000  10000

# front right up:1000 down:2000
M: 1
S: 1 4      0  20000 -10000 -10000  10000

Z:

Z:


# Aileron mixer
# ---------------------------------
M: 1
S: 1 0  10000  10000      0 -10000  10000

M: 1
S: 1 0  10000  10000      0 -10000  10000


# Vtail mixer
#-------------
M: 1
S: 1 1  10000  10000      0 -10000  10000
S: 1 2 -10000 -10000      0 -10000  10000

M: 1
S: 1 1  10000  10000      0 -10000  10000
S: 1 2  10000  10000      0 -10000  10000

Then I added in sd card /etc/mixers folder config.txt as:

set MIXER_AUX vtol_TTTTAAER
set PWM_AUX_OUT 1234
set PWM_AUX_DISARMED 1500
set PWM_AUX_MIN 1000
set PWM_AUX_MAX 2000
set PWM_AUX_RATE 50

I repluged my SD card to my fc , then I open it in QGC nothing happened.