So to be as simple as possible, I don't have any experience in the RC world. I have read on wikipedia that the basis is a 1.5ms pulse being neutral with anything between 1.5 and 2.0 being forward and below that is reverse.
I have a BLDC controller which appears to have been programmed, such that 1730 uS is neutral instead. Ok fine, no problem. So what I want to do is ramp this thing up and down smoothly as though I'm turning the POT on one of those cheapo RC control modules you can buy, but simulated using the arduino.
Now up until now, I have been successful using this library in the following way:
- I attach the servo library to the pin going to the BLDC controller
- I "park" the BLDC at 1500 and wait 1000mS for the controller to beep at me that it's locked on, which it does
- After that, I increment the signal by 1 every 5 mS until it increments to 1730
- After this, I REQUIRE that any subsequent signal achieves the corresponding motor speed very quickly (ie. in < 100mS or thereabouts).
Here's my problem.
If I were to increment the signal from 1730 to 1850, which just happens to be the first number I need it to achieve, that's 150 increments. If I wait 5mS between each increment, that's 3/4 of a second I have to wait which is too long.
I could remove the delay but since the signal itself is 1730 uS (1.73mS), updating at Arduino clock speed means the signal will in fact flat-line because it's changing way faster than the pulse itself can update. I have read that if the controller doesn't see a pulse in 20mS it will de-sync and believe the signal is lost.
What is the correct or best way to ramp a signal quickly without losing sync with the controller? Do I even need to ramp through each step as I'm doing or can I just jump from 1730 to 1850 with no ramp at all?