-
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
PWM driver: pca9685_pwm_out improvement #14269
PWM driver: pca9685_pwm_out improvement #14269
Conversation
6f7471b
to
66f350d
Compare
Ready. |
BTW, I have figured out how we can purge |
bebfa46
to
4292d34
Compare
Generally looks good, but I'm hesitating on the parameter change. Doesn't it make the simple case (only output is pca9685) more complicated from a user perspective? I was considering extending the mixer module lib for the PWM case. In terms of the pca9685 as an additional output (or having multiple) aren't we just missing visibility into the mapping (MAIN, AUX, etc)? |
It will. But currently no board depends on it as the only output. Those parameters are already defined here. I just implemented them. Of course, users can simply ignore those parameters if they don't need them. PWM channel mapping is done though mixer files, as it always be. Simply bind the mixer to this driver with How MAIN and AUX are defined? I don't think we should split them up, as they both are common PWM output interfaces. |
@SalimTerryLi Couldn't we just use the PWM_MAIN parameters for this? All the user documentation explains how to use them and the ground station software knows how to set them. That is a lot better for an end user than having a new set of parameters. Why did you introduce new ones and what problem are you trying to solve? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because these new parameters make it very hard to set up the system through a GCS and they are not documented, I'm not convinced this is an improvement. I would retain the PWM_MAIN parameter mapping instead.
This driver may have two use case:
It is OK to reuse old parameters if I try to use it on my own board. but definitely can not if someone want to extend PWM channels because of conflicts. There is already a person who want to use PCA9685 on Pixhawk Cube to extend max PWM channels to control a complex VTOL. |
I'm willing to update those document, although there may be not too much people will use this driver. |
You can't update the GCS source code and it doesn't make sense for us to carry documentation that a low number of users are actually using. Back to the question you haven't answered: Why can't you just use the existing PWM_MAIN parameters and read those? Why do you need your own? |
That will lead to conflicts if I want to use this driver on standard Pixhawk which has its own outputting driver. |
Are you using the driver on a Pixhawk? Because the better solution would be to go straight to UAVCAN (albeit not instant). |
I propose these changes on behalf of at least two people. For myself, it is ok to just read old parameters. as I use PCA9685 as the primary PWM out. Moreover, a badly designed pca9685 driver already exists in PX4, named |
86d0409
to
b829b7c
Compare
b829b7c
to
2f0d42d
Compare
0f1383c
to
753585d
Compare
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
98d0dee
to
1a25c74
Compare
Switch back to original parameter names. Please review it. |
97abc97
to
70b624d
Compare
bug fix: not change to default value after reset to -1
This reverts commit 83ac67dcca0bf363b3ea80b8cc10070899f5278d.
70b624d
to
a0da314
Compare
Describe problem solved by this pull request
Fixed some bugs about that driver. Listed here:
-1
.Added new features:
Some critical changes:
-New parameters are defined. this will make PCA9685 able to run together with other PWM output devices.
Note this driver allows parameters to be changed run-time without reboot, which will lead to some performance issue. But it is not critical on embed Linux.
Test data / coverage
This driver still works properly on my RPi.
Additional context
This driver has a "wrapper" layer which is abstracted from the real driver. Those code can be easily picked up and quickly be deployed with other pwm drivers, such as Navio2, BBB and OCPOC. I mean, we are able to purge
linux_pwm_out
by setting up board specific pwm drivers in their board folder. This driver can be the template.