-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Implement MAIN and AUX pwm output on MindPX #7208
Conversation
fcf84dc
to
b2c8165
Compare
b2c8165
to
36dcc01
Compare
This is a different arch than FMU-V2/V3 or FMU-V4, as it implements full AUX + Main support in a single FMU. Not a perfect implementation yet, but a realistic one in limited time frame that can make it working. Specially, in MindPX hardware, this PR can enable up to 8 AUX outputs. This is even more than original Pixhawk (6 AUX), allowing more comprehensive VTOL config and more fine control. You are welcome to test it out. To distinguish, perhaps can give it a different arch name, like FMU-V4S or FMU-V4EXTREM, something like that? |
I did cold test (no flying), and I am able to set RC channel from QGC to passthrough to AUX1/2, to control gimbal from RC. I have not tested this in flight to confirm everything is working fine., but will do this soon. |
Is there any update on this. Is it working on latest stable version ? |
@iZhangHui what's the status of this? |
@mzahana We have merged this PR to latest stable release v1.6.5 in Airmind github repository. @TSC21 |
Difficult in what aspects? I suppose this is merged to the stable release already. So what's missing? |
@TSC21 We only merged this PR to stable release in AirMind git repository. The src/drivers/px4pwm/px4pwm.cpp codes are mostly copied from src/drivers/px4fmu/px4fmu.cpp, and we cut off all unnecessary function, only keep pwm relative function. From perspective of codes reuse and maintenance, it's a bad practice. Maybe this is also the reason why this PR is not accepted. |
@iZhangHui so there's no way you can make this compatible with the upstream master? Cause that way for developers like me (which actually have a MindPX), we will never be able to have a proper sync between the devopment branch and the the stable of MindPX, having always to be stuck to it. Would be good if you could take some effort for having this in a clean way merged into upstream. |
I need to review what you've done higher level, but I'd like to see the main fmu module become much simpler. It was a catch all for many unrelated pieces. |
Thanks @dagar that will be more than great. From functional point of view pilots can now fully utilize all MindPX's 8 AUXs by using current Airmind's stable release. However @iZhangHui has his standing ground in terms of future evolution. As this part of code affects and is affected by many other parts of PX4 components, so seems a better way is to take this idea into consideration under the framework of new PX4 common architecture, including V5, needs to be planned and coordinated with the dev activities of other parts. In my view it is actually a bigger issue than just a MindPX-specific issue, as it can benefit all single FMU flight controllers, including the emerging V5 hardware. BTW, the new MindRacer hardware revision will have total 12 PWM outputs than previous 6, which is a benefit to many VTOL builders. |
I think to mainline this it would require more modularity and not code duplication. I think there are 2 aspects that need to be improved in the mainline as it is now:
|
Splitting the existing fmu module into a seperate task for pwm output (and GPIO) handling and separate work queue module for RC input would be a good start. Then make fmu a little more generic so you can start multiple instances (MAIN & AUX) corresponding to different outputs. |
Thanks for your good suggestion. @davids5 @dagar @davids5 For the 2nd aspect, will it lead to modify the current existed air frames configs? @dagar |
@iZhangHui it needs work, but here's a branch where I split the px4fmu into fmu + RC input + safety button (+ i2c + spi). https://github.com/dagar/Firmware/tree/pr-fmu_split With some testing and review we can get that in master, then strip it down even more. Then making it possible to run multiple instances shouldn't be as daunting. |
@iZhangHui As you may know that PX4 1.7 is released, can AUX work on MindPX using 1.7 version? |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
@iZhangHui is this still ongoing or should we close it for the time being? |
Close it as this work is terminated. |
This PR is a rough experimental prototype for implement both main and aux pwm output on px4 fmu side for autopilot without IO SOC.
The goal here is to reuse the PX4 airframe and mix files for plane, VOTL and some multicopter,
and make px4fmu v4 family be as powerful as Pixhawk.
TODO:
Split px4fmu.cpp into pwm, safety_stick, rc etc device class, then it can be easily reuse and maintain pwm function codes.
Rewrite drv_io_time and drv_pwm_servo to support 2 groups of timers, one is for main pwm and the other for aux pwm. Currently, I have no idea how to do this.
@LorenzMeier @bkueng @davids5 @dagar
Any suggestions and opinions are welcome.
#7140