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

AP_PiccoloCAN: Allow ESCs to listen to fixed wing throttle channel #28466

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lbullard-c2
Copy link
Contributor

Probably not the best way of implementing it, but seems Currawong/Piccolocan ESCs can only be driven by servo outputs with motor functions, i.e. copter and quadplane motors. This patch allows the typical fixed wing forward throttle channel to be used as well.

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

Please state what testing this has had.

@@ -670,7 +678,7 @@ bool AP_PiccoloCAN::is_esc_channel_active(uint8_t chan)
// Check if a motor function is assigned for this motor channel
SRV_Channel::Aux_servo_function_t motor_function = SRV_Channels::get_motor_function(chan);

if (SRV_Channels::function_assigned(motor_function)) {
if (SRV_Channels::function_assigned(motor_function) || SRV_Channels::channel_function(chan) == SRV_Channel::k_throttle) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should have k_throttleLeft and k_throttleRight here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been run up on an aircraft with a Currawong velocity ESC, but not yet flown. I'll make changes to include the left and right throttle functions as well

SRV_Channels::get_output_pwm(SRV_Channel::k_throttle, output);
_escs[ii].command = output;
_escs[ii].newCommand = true;
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
break;
continue;

@@ -344,6 +344,14 @@ void AP_PiccoloCAN::update()
if (is_esc_channel_active(ii)) {

uint16_t output = 0;

if (SRV_Channels::channel_function(ii) == SRV_Channel::k_throttle) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants