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

Encoder origin jump filter looks not working correctly #16

Closed
at-wat opened this issue Jan 28, 2019 · 2 comments · Fixed by #18
Closed

Encoder origin jump filter looks not working correctly #16

at-wat opened this issue Jan 28, 2019 · 2 comments · Fixed by #18
Assignees

Comments

@at-wat
Copy link
Member

at-wat commented Jan 28, 2019

int diff;
diff = motor_param[j].enc0tran - motor_param[j].enc0;
normalize( &diff, -motor_param[j].enc_rev_h, motor_param[j].enc_rev_h, motor_param[j].enc_rev );

@at-wat at-wat self-assigned this Jan 28, 2019
@at-wat
Copy link
Member Author

at-wat commented Jan 28, 2019

example data of enc0:
image
There are 1 rev jumps which should be normalized to 0 by normalize().
These jumps seems causing non continuous control result.

@at-wat
Copy link
Member Author

at-wat commented Jan 28, 2019

phase[2] = (uint64_t)(phase[2] + motor_param[j].phase_offset )
* motor_param[j].enc_mul / 0x40000 + SinTB_2PI + SinTB_2PI/4;

uint64_t should be int64_t

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 a pull request may close this issue.

1 participant