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

Adaptive Hover not working with PWM Actuators #156

Closed
ljb2208 opened this issue Mar 13, 2012 · 7 comments
Closed

Adaptive Hover not working with PWM Actuators #156

ljb2208 opened this issue Mar 13, 2012 · 7 comments
Milestone

Comments

@ljb2208
Copy link

ljb2208 commented Mar 13, 2012

When using a rotorcraft with PWM actuators, the thrust_applied value passed to the gv_adapt_run function is not correct.

For PWM Actuators the following is defined in the airframe config:

SUPERVISION_MIN_MOTOR 1030
SUPERVISION_MAX_MOTOR 2000

In guidance_v.c is the following code

int32_t cmd_hack = Chop(stabilization_cmd[COMMAND_THRUST], SUPERVISION_MIN_MOTOR, SUPERVISION_MAX_MOTOR); gv_adapt_run(ins_ltp_accel.z, cmd_hack);

This results in cmd_hack not being calculated correctly.

Temporary fix was to add new defines in guidance_v.c and use these to bound the stabilization_cmd[COMMAND_THRUST] to between 3 and 200.

@flixr
Copy link
Member

flixr commented Mar 13, 2012

I think the GV_ADAPT_[MIN|MAX]_CMD and GV_ADAPT_HOVER_[MIN|MAX]_CMD should rather be scaled relative to the SUPERVISION_[MIN|MAX]_MOTOR instead of setting them to explicit values...

@gautierhattenberger
Copy link
Member

Fixed in dev branch 2509dc1

@flixr
Copy link
Member

flixr commented Mar 14, 2012

Please test and also check if the rc throttle limit is working as expected or if
guidance_v_rc_delta_t = (int32_t)radio_control.values[RADIO_THROTTLE] * (SUPERVISION_MAX_MOTOR - SUPERVISION_MIN_MOTOR) / MAX_PPRZ;
should really be
guidance_v_rc_delta_t = SUPERVISION_MIN_MOTOR + (int32_t)radio_control.values[RADIO_THROTTLE] * (SUPERVISION_MAX_MOTOR - SUPERVISION_MIN_MOTOR) / MAX_PPRZ;

@flixr
Copy link
Member

flixr commented Mar 21, 2012

@ljb2208
Luke, did you have a change to test the fixes?

@ljb2208
Copy link
Author

ljb2208 commented Mar 21, 2012

Hi Felix, no not as yet. Hopefully I will this weekend. Will let you know

On Wed, Mar 21, 2012 at 7:04 PM, Felix Ruess <
reply@reply.github.com

wrote:

@ljb2208
Luke, did you have a change to test the fixes?


Reply to this email directly or view it on GitHub:
#156 (comment)

@ljb2208
Copy link
Author

ljb2208 commented Mar 24, 2012

Still not working as per issue #166.

Also guidance_v_delta_t is being set to the negative of the feedforward and feedback commands, however the feedforward command is still calculated as a positive number. Feedback command also looks to be positive as well, although I haven't checked that each of the terms are positive.

@flixr
Copy link
Member

flixr commented Mar 26, 2012

thx, somehow missed that in the merge...
should be fixed in dev...

@flixr flixr closed this as completed Mar 28, 2012
@flixr flixr reopened this Mar 31, 2012
@flixr flixr closed this as completed Apr 6, 2012
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

No branches or pull requests

3 participants