ppm (sum) in to servo output, possible timer issue

Hi,
There is a function that will tell you if you are getting bad signals -

uint8_t CRCArduinoPPMChannels::getSynchErrorCounter()
{
  uint8_t sErrors = m_sOutOfSynchErrorCounter;
 
  m_sOutOfSynchErrorCounter = 0;
 
  return sErrors;
}

Its already in the library, so you can just add it to your loop. Its 0 if there were no errors since it was last called or > 0 if there were errors.

You should expect to see the occasional non zero value from general radio interference, if you see errors consistently, you transmitter/receiver might be outputting more or less channels that indicated which is what I suspect from what you have described.

The other possibility is interference from having signal wires passing too close to power lines within your project - I have had this problem once or twice and its solved by moving ariels and other sensitive lines away from batter, ESC and motor wires.

Duane B

I think this time I have the issue nailed down. fingers crossed.
I tried running multiwii - differnt 328p - differnt code - same hardware - same issue
This is extremely weird as I use ppm in on my multicopters and it has run fine for years, so deff a hardware issue.
I grabbed the wing from the plane this will be going in (4 9g digital servos) and tested both yours and the multiwii code, both work flawlessly.
To confirm what on my test bed was causing issues I swapped one servo on the wing for first the esc on the test bed. Work like gold, then swapped the esc for the servo (as the test bed is a rock crawler it is a full size all metal gear beast of a servo, but it is analog....) once that was in the system all hell broke lose once again.
This is confirmed both by visually seeing the servos twitch and from the multiwii gui/prints in your code

So as far as time goes it was that servo causing all the issues, somehow creating a bucketload of noise in the system. A ferrite ring may weed out the issue, or giving it its own power.

This brings me to another scenario, my original code that used servo timer 2 may have never been broken in the first place. When I removed the esc from that setup it worked fine - possibility that specific pieces of hardware (or combination of) cause can cause issues.

If I get the time I may try to sort that issue, it would be nice to have a solution now that I know the problem.

Thankyou for your help and I hope this discovery of mine can shed light on any future problems you may run into.

Will post back with ether A)sucses story of project or B)another issue