I'm working on altering some elements of the Arducopter code to add support for 4-servo, 90 degree CCPM and could use some help from developers with experience with the code base.
It seems that the only files that need changing are in AP_MotorsHeli (.cpp and the header file) but perhaps I'm wrong in that assumption. I've tried some preliminary changes but upon uploading it to the APM through the Arduino IDE I noticed no alteration in the behavior of the system.
I suppose the problem can be broken down into two parts: re-purposing one of the auxiliary channels (presumably either channel 6 or 7) to drive the fourth servo, and altering the CCPM to apply roll and pitch discretely to the two pairs of servos.
You can view the alterations I've made over at my Github repository. Please bear in mind that these changes don't preserve the regular 3-servo CCPM setup; I wasn't expecting to have this work integrated into the official release.
Replies
Wondering if the 4-servo setup ever got added? Sorry to revive an old thread, but I'm working on retrofitting a Sniper A800 for pixhawk, and am struggling with servo setup.
Thanks
Chris
We have a large helicopter with a 4 servo 90 degree squashplate setup and would like to use Arducopter with it, does anyone know if there has been any progress on supporting this, either in 2.x or 3.x?
If it is not supported out of the box we will likely try to add support ourselves using ChristopherBonner's code so would be interested to hear what the best way of doing this is.
As far as I know, 4-servo support hasn't been added.
did anyone get any further with his ?
Hi Christopher,
What is the project you're working on? Seems it's for an Airstar AT-6100 helicopter? That's a big heli! Care to share any more about the project?
Couple things:
On Issue #4, you should change the metadata for Servo 4. Minor problem here, probably no effect.
Did you set the swashplate type to CCPM instead of H1? I notice that you didn't do the roll, pitch and collective factors for the H1 swashplate, so if you left that parameter as H1, then you probably won't get the output on Ch6. (look at the ELSE on lines 375 and 451).
It's also possible that somewhere else in the code, Ch6 is being reset to something else. This could be happening in Mount, for example. Unfortunately, the output channel handling on APM is not very robust. It's entirely possible for a function somewhere else to clobber your flight control output. I don't mean this would happen in a random fashion. But if you set it up that way using parameters or code hacking, it could happen.
Also, I just noticed that line 458 of Arducopter.pde, you have not modified the call to AP_MotorsHeli to include the pointer for the parameters for the new servo. Then I also noticed, that you also have not created the new servo parameter objects in Parameters.h (line 105ish and 357). Or Parameters.pde line 450ish.
I'm surprised it even compiles... Also, be aware that if you are compiling using Arduino IDE, you're probably going to run out of RAM. It says maximum of 256k, but it won't actually take more than 241k, it won't upload properly. So you're going to have to turn off some functions (Optflow, Mount, maybe CLI).
This issue with 4-servo CCPM swashplates has come up before, and I'd like to support it in the main code, but I'm not sure which is the best way to go about it. Do we make it a special feature of the existing motorsheli code file? Or should we make AP_MotorsHeli3Servo and AP_MotorsHeli4Servo files?
Christopher,
You're very close. I think the only thing you've missed is updating the new servo in the move_swash call. Considering all the other changes you've made which look good, I don't think you'll have any problems with this last bit. nice!