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

Jitter #2

Open
ardianet opened this issue Dec 4, 2020 · 3 comments
Open

Jitter #2

ardianet opened this issue Dec 4, 2020 · 3 comments

Comments

@ardianet
Copy link

ardianet commented Dec 4, 2020

Hi, any updates for the jitter problem?

:)

@wdcossey
Copy link
Owner

wdcossey commented Dec 5, 2020

@ardianet

Seems I forgot to implement that and then forgot that I added a comment to implement it 😄

I'll see what I can do for you in the next couple of days.

@ardianet
Copy link
Author

ardianet commented Dec 8, 2020

@ardianet

Seems I forgot to implement that and then forgot that I added a comment to implement it

I'll see what I can do for you in the next couple of days.

lol.. can't wait for the update. :)

@wdcossey
Copy link
Owner

wdcossey commented Dec 8, 2020

lol, I need to dig out my controller to test if it's going to work, this is purely a guess but you can try it.

https://github.com/wdcossey/ppm-to-ibus-serial/blob/master/ppm-to-ibus-serial.ino

Replace the lines (160-166) in the file with the ones below.

uint16_t next_width = ppm_pulse_data[ppm_pulse_index] - ppm_pulse_data[ppm_pulse_index - 1];
uint16_t prev_width = ppm_channel_data[ppm_pulse_index - 1];

//Fix the jitter
if (next_width > (prev_width + PPM_JITTER_THRESHOLD) || next_width < (prev_width - PPM_JITTER_THRESHOLD)) {
	next_width = ppm_channel_data[ppm_pulse_index - 1];
}

You can also tweak the PPM_JITTER_THRESHOLD value to try narrow down the jitter extremes.

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

2 participants