-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
base: master
Are you sure you want to change the base?
Conversation
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.
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) { |
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.
Should have k_throttleLeft
and k_throttleRight
here too.
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.
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; |
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.
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) { |
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.
This will conflict with the ECU mapping below: https://github.com/ArduPilot/ardupilot/pull/28466/files#diff-c699548ddb0422e17ef8a505c29a96e536c9a3867856f18b0d82290c907cd129R367
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.