Bi-copter Tilt-rotor programming help

Hey everyone
I am working on a bi-copter design with tilt-rotors without using cyclic pitch. The thing is that there seems to be no stable Ardupilot firmware support for such a design. So I have to use the tail-sitter code and build upon that. I had been following a similar thread(VTOL TIlt Rotor with 2 front rotors tilting). Peter did a great job building a custom code for Ardupilot by modifying the tailsitter code. I have been using the same code. However, the servos( and hence the motors) can only tilt in one direction(either only forward or only backward). So the autopilot is not able to make the auto-corrections that involves a tilt in the other direction. I just need to modify the code a little bit to get the motors tilting either way. I am attaching the servos.cpp and tiltrotors.cpp files
(servos.cpp (35.7 KB)
)
(Tilt_rotor.cpp (14.4 KB)
)
Can anyone please tell me which part of the code I need to modify or what functions I need to add into the code. I am using a Pixhawk Cube flight controller.

It looks like bicopter support is now in master: https://github.com/ArduPilot/ardupilot/pull/10793

Is this what you’re using?

1 Like

yeah, it made into into master a few weeks ago, I’m not sure I follow the issue your having the code does support tilting the motors both ways.

servo trim should be straight up, or to be more precice should put the motors at a angle such that there thrust vector passes through the CG.

Min / max is the forward flight position or the max back angle depending on reversing

1 Like

Hi Mark
Thanks for the response. Yes, I am using the version of master that you mentioned. The problem is that I cannot get the servos to tilt the rotors in either directions. i.e, either I can tilt only forward or I can tilt only backward from the vertical.

Hey Peter
Thanks for the reply and the code. I understand that the issue is hard to follow. The problem is that I cannot get the servos to tilt the rotors in either direction. i.e, either I can tilt only forward or I can tilt only backward from the vertical(I am able to choose which direction I want on Mission Planner). However, I will check the servo trim as you said and get back to you as soon as I can.