I’ve been working on a way to support mixing for a dual/tandem helicopter configuration that uses two standard swash plates to give me pitch/yaw and differential collective to give me roll.
I have approached the problem three different ways with limited success
- Generate a custom mixer file with 6 summing mixers with outputs for main channels 1-6
- Result: No PWM output, RC Inputs were often not recognized until rebooting with safety switch held down
- Attempted fix: Enlarging the buffer size in mixer.h and rebuilding - didn’t help
- Generate two custom mix files (main and aux) with 3 summing mixers each, outputs split across main channels 1-3 and aux 1-3
- Result: Correct mixing for the dual-swash, but without the ability to set the throttle/pitch curve
- Generate new mixer type (dual helicopter), based on the helicopter mixer, as well as corresponding mix file. Adjusted the pruning script as well to allow the new tag for Dual Heli mix (D)
- Result: Code compiles and can be flashed but Mixer fails and causes other IO failures
To-date, I have only had success with my 2nd approach (Summer mixers split across Main/Aux). Long-term this will not work because I need to be able to adjust the throttle/pitch curves much like is possible with the traditional helicopter mixer.
In my attempts to debug the issues, I have not been able to get very far. What I can tell from the console output (accessed through QGroundControl) is that when I choose the Vehicle that I have set up for this project (what I call Tandem Heli) and reboot, The RC_IN and MIXER read FAILED. If I try to manually load another mixer in at that point from the console, I see an error message and the mixer fails to load. The only way I seem to regain any control over the I/O is by choosing a standard vehicle type and holding the safety switch during boot-up.
The following issues have been conspiring against me as well:
- The Cube autopilots I have do not have a debug USB port- the location identified in all the documentation is empty
- When I remove the casing, there are two hidden connectors on the opposite side of the board, but they have a connector type that I have not been able to identify a compatible cable for yet
- It appears that I am also unable to load the Blade130 vehicle configuration on the Cube either. When I do, I get similar behavior that I described above (RC_IN and MIXER fail).
- The 2 Cube APs I have do not have the same console options. In one of them, I can get PX4io status- the other I can not
I’m more than happy to share the mixer files I have made, share the dual helicopter mixer code, and try to re-create some of the errors I am seeing. Whatever would be most helpful.
If folks have some general tips to help debug through the console (commands that might help me track down mixer issues, log locations, etc) or know the right cable for the tiny connector that is hidden away on this Cube autopilot (purchased recently from ProfiCNC), I appreciate any and all help people have to give. Also if there is an easy way to turn off all the arming checks, I would love to be able to test if the mixer is working with some servos without having to re-calibrate sensors every time I re-flash.
Thanks in advance for any help/advice!
I too have the same problem with my mixer. I have not tried the hold the button down during power up. I will try that, but I too cannot get the RC inputs to work. I even tried it as an AUX mixer with the same result. I had my mixer code working in v1.5.9. Hasn’t worked since upgrading to 1.8.0 or 1.10.x
In regards to the Cube - which version of the carrier board are you using? If it has ADSB built-in, that takes the place of the NuttX console port. If it does not have ADSB, you can then use the CONS pins to access the console. These are the pins next to SBUS output pins - see this page for pinout: https://discuss.ardupilot.org/t/pixhawk-2-1-pinout-doc-need-to-be-on-the-pixhawk-2-1-page/23604. I believe GND is is the pin nearest the Cube. Connect a TTL/USB converter and use any terminal emulator at a baud of 57600.
You also can use the tiny debug ports you found inside the carrier board’s enclosure, but you have to create a harness with the standard DroneCode-Small connector (DCD-M) on one end and a JST-SUR on the other end: https://www.digikey.com/products/en?mpart=A06SUR06SUR32W152B&v=455
Oh, and I should point out that the tiny carrier board debug ports are available regardless of ADSB inclusion. One is for the FMU processor, and the other is for the IO processor. It’s the JTAG port that can be used for in-circuit debugging, flashing firmware, serial console, etc.
Using a Cube Black (http://www.proficnc.com/all-products/31-pixhawk2-suite.html) So, not the ADSB. Thanks for the link on the CONS pins. I had attempted to to use those pins at some point but did not have any success. I used a FTDI Cable and TeraTerm, but did not have success getting anything to print out. Do you know if there is any configuration I have to do with serial ports for it to print out there? Thanks for the note on the cable connector as well- I will track that down as a backup.
Just to follow up on my previous post, I have done a number of “experiments” to try and isolate where I am going wrong with my approach. I still have not succeeded, but have attached my notes if anyone has some feedback.
At a very basic level, I now know that the Cube can handle 2 Helicopter mixers, but just not the way I need to implement them (mixing for swash movement and differential collective).
I am still having no luck getting a system console interface up and running, but I have ordered the cable @Jacob_Crabill mentioned.
Any help or suggestions are appreciatedNotes for PX4 Mixing Struggles.pdf (375.7 KB)
Are you using Linux, Mac, or Windows?
On Linux or Mac, you should be able to use simple tools like “screen” or “minicom” to open the serial connection. On Windows, once you figure out which COM port it is at any given time, PuTTY should do the trick.
So long as you have the TX, RX, and GND pins connected to an FTDI USB converter, it should work and give you console access. You do have to hit “enter” a few times for the shell prompt to appear.
I’m working in both Windows and Linux (Dual Boot) - been working more on the Linux side lately and tried screen last night with no luck. I’m going to try and hook the output lines up to a scope today to make sure I am not going crazy. Interesting note about hitting enter a few times- I did expect to see serial traffic streaming, so I don’t know if I have really tried to hit enter with both Tx and Rx connected. I’ll give that a shot today.
Update on previous posts:
I finally had success with the system console, hooked up to the CONS pins with an FTDI as described by @Jacob_Crabill in his previous note. The issue was a combination of QGroundcontrol blocking the serial connection and me not having both the tx/rx lines both hooked up at the same time.
On the mixer front, I never fully succeeded getting a mixer file option to work for me that would specify the configuration for a dual/tandem helicopter. My current solution is a hack/work-around that takes in the input from a traditional helicopter mix file, overrides the number of swash actuators to 6 instead of 3, and does the dual helicopter mixing math in mixer_helicopter.cpp. The second set of swash servos is just defined by the inputs of the first set, with an additional angle rotation of 180 degrees. This will work for my current configuration, but it isn’t a good final solution.
Now I am trying to figure out which parameters need to be adjusted to fly in stabilize with hardware.I think this issue can be resolved and I will post again with questions about controllers.
I’m currently working on a similar issue as you have been working on. I would really like to get in touch with you. Would you be up for exchanging contact information and maybe having a chat sometime?
I work with Christian and we’ve made some progress. We replaced the HelicopterMixer library with one that can accept two
H:T:P:S spec sets (or just one) in its
from_text() method. The rest of the code in that file now handles two swash plate side-by-side rotors. The code would not yet be acceptable for a PX4 PR, but I should be able to get to that point.
We have proven the approach on 1.10.3 & Black Cube and integrated with
master + the px4io PR #16444, which is required for heli mixers since 1.11. We intend to test this config using cubeorange, soon.
If you questions are about the controls part, @clopez is the expert. If about code changes, I can try to help.
Hey @Danduril !
Sorry for the late answer, I kind of missed this.
Would you mind, sharing your code with me? I’d be really interested in seeing how you implemented it.
I’ll have to get an OK to share the exact code, but it’s nothing fancy. The
mix() method just applies trigonometry to translate the roll & yaw to the side-by-side rotors.