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

Pitch and roll angle should be max 25 degrees. Yaw angle might be max 180 #22

Open
rlindsberg opened this issue Dec 9, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@rlindsberg
Copy link
Member

rlindsberg commented Dec 9, 2018

In the file below, angles are limited from -25 to 25.

/** ****************************************************************************
* @brief PID control for Roll
*
* @param pointer to struct containing filter variables.
*
* @return none
******************************************************************************/
void PID_Roll(FILTER_complement_struct *filter_pointer)
{
/* Roll control */
if(desired_roll_angle > 25)
desired_roll_angle = 25;
else if(desired_roll_angle < -25)
desired_roll_angle = -25;

One may want to change this lines also in order to fully take the benefit of remote control's full range.

/*
Values are shifted to fit. Input values are between 4000 - 8000.
Right shift by 2 to get values between 1000-2000 (what the
pwm-out wants), and right shift by 5 and subtract 187
to get values between -63 and +62. This is interpreted
as degrees by the control system.
*/
float pitch_value = (float) ((pitch>>5)-187.0);
float roll_value = (float) ((roll>>5)-187.0);
float yaw_value = (float) ((yaw>>5)-187.0);

@rlindsberg rlindsberg added enhancement New feature or request question Further information is requested labels Dec 9, 2018
@rlindsberg rlindsberg self-assigned this Dec 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant