bcflight icon indicating copy to clipboard operation
bcflight copied to clipboard

What is your resolution of the oneshot125?

Open Pluscrafter opened this issue 6 years ago • 5 comments

What's the resolution of the oneshot125 ? Is it 1us -> Resoution of 125(ca.7bit)? And is this accruate enought to control the motors?

Pluscrafter avatar May 10 '18 10:05 Pluscrafter

It has indeed a resolution of 125. But there is currently a problem caused by the raspberry pi itself (and I'm afraid that it cannot be solved) that only one motor can run at a time in oneshot (or smaller timing protocol), using more than one will produce very unstable signal and the drone just cannot fly. I'm starting to think that using I²C ESCs can be a solution, or running motors control (and probably stabilization to reduce lag) on an STM32 besides of the rPi

dridri avatar May 11 '18 08:05 dridri

Have you tried HardwarePwm like the in the pigpio library (not hardware timed pwm) then you have a greater resolution but unfortunally the raspi has only 2 hardware PWM channels with 4 output pins.

Pluscrafter avatar May 12 '18 00:05 Pluscrafter

I already though about that, and the only solution I found is to use fast-switching transistors to alternatively send signals to motors. I will take a try on it on the next weeks

dridri avatar May 12 '18 08:05 dridri

You could use a pwm/servo driver like the PCA968. It has a resolution of 4096 with 1khz. Then you have a resolution of 512. And what did you mean with the fast switching transistors(I'm a newbie in electronics :))

Pluscrafter avatar May 12 '18 11:05 Pluscrafter

hmm actually using something like this http://www.ti.com/lit/ds/symlink/cd4066b-q1.pdf would be much easier. All the IN pins would be connected to Raspberry Pi's PWM output, CONTROL pins connected to 4 different GPIOs (one for each motor), then all OUT pins connected to the ESCs inputs.

Then we consecutively activate the switches to send different PWM signals to each motor

dridri avatar May 12 '18 19:05 dridri