Skip to content
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

Voxl2_io driver expand to 8 channel pwm output #52

Open
wants to merge 5 commits into
base: voxl-dev
Choose a base branch
from

Conversation

dirksavage88
Copy link

VOXL2_IO currently supports up to 4 actuator channels in the IO driver code

The 4 actuator channel limit is based on the serial packet structure. This PR modifies the packet structure to allow 8 channels instead of 4.

cmd.len = voxl2_io_create_pwm_packet4_fb(max_pwm[0], max_pwm[1], max_pwm[2], max_pwm[3],
led_cmd[0], led_cmd[1], led_cmd[2], led_cmd[3],
int16_t max_pwm[8]{VOXL2_IO_MIXER_MAX, VOXL2_IO_MIXER_MAX, VOXL2_IO_MIXER_MAX, VOXL2_IO_MIXER_MAX, VOXL2_IO_MIXER_MAX, VOXL2_IO_MIXER_MAX, VOXL2_IO_MIXER_MAX, VOXL2_IO_MIXER_MAX};
// if (_debug) PX4_INFO("%i %i %i %i %i %i %i %i", max_pwm[0], max_pwm[1], max_pwm[2], max_pwm[3], max_pwm[4], max_pwm[5], max_pwm[6], max_pwm[7]);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This debug statement had to be commented out due to compiler warning for formatting (too many format prints?)

cmd.len = voxl2_io_create_pwm_packet4_fb(min_pwm[0], min_pwm[1], min_pwm[2], min_pwm[3],
led_cmd[0], led_cmd[1], led_cmd[2], led_cmd[3],
int16_t min_pwm[8]{VOXL2_IO_MIXER_MIN, VOXL2_IO_MIXER_MIN, VOXL2_IO_MIXER_MIN, VOXL2_IO_MIXER_MIN, VOXL2_IO_MIXER_MIN, VOXL2_IO_MIXER_MIN, VOXL2_IO_MIXER_MIN, VOXL2_IO_MIXER_MIN};
// if (_debug) PX4_INFO("%i %i %i %i %i %i %i %i", min_pwm[0], min_pwm[1], min_pwm[2], min_pwm[3], min_pwm[4], min_pwm[4], min_pwm[5], min_pwm[6], min_pwm[7]);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Signed-off-by: dirksavage88 <[email protected]>
Signed-off-by: dirksavage88 <[email protected]>
@modaljc
Copy link

modaljc commented Jan 4, 2024

Hi, thanks for doing this! Have you been able to do any testing to validate the changes?

@dirksavage88
Copy link
Author

Hi, thanks for doing this! Have you been able to do any testing to validate the changes?

We have done some preliminary testing to show that the original 4 pwm channels work alongside the expanded channels. The channel expansion in this PR did not include changes to the LED states since I was not sure if these were necessary. Also the inline comments show that some debug statements did not take in all the formatting options with the expansion.

Much more testing is required but we were informed that there could be a refactor to this code in the near future, so if not merged it could be referenced.

@github-actions github-actions bot added the stale label Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants