The way I would approach this is not to modify the ESCs at all. That way leads to frustration.
You'll have much more luck by making an I2C -> PWM module. This is easier than is sounds. Firstly, a little about RC servo PWM
An RC servo expects to see a pulse about every 20 milliseconds (50 times per second). The length of this pulse tells it what angle to rotate to. A pulse of 0.9ms means +90º, while a pulse of 2.4ms means -90º.
The ESC input will expect the same type of input, but will interpret the pulses to mean something about motor power, rather than angle. Many ESCs allow you to calibrate them I.E. Explain to them which length pulses correspond to what motor power. Often you hold down a button to switch them into calibration mode, then move the joystick through a sequence of, pressing the button again after each movement.
All you need to find is a chip which can produce such a PWM signal, at the behest of I2C commands.
Well fancy that, such a chip exists: PCA9685. What's more, it actually has 16 output channels, so you can drive 16 of those ESCs! It can produce frequencies from 40Hz to 1000Hz, with a 12-bit resolution. That means you'll get at more than 8-bit resolution on the 0.9ms - 2.4ms range. With this chip, you'll be able to plug in servos, ESC, whatever into you 16 ports.
If you need help to get this working, just ask specific answerable questions on this forum, and we'll be happy to help.
Added:
Kevin mentioned that you could also do this with a microcontroller. Probably the easiest way to do this is with a PSoC3 from Cypress Semicondctor. The reason to choose these over most other microcontrollers out there are:
- You can easily have 4 PWM outputs. There aren't many MCUs with that many. In fact, I think you can have more than 50 PWM outputs if you want.
- Configuring it is insanely easy. Considerably easier than a PIC for example.
- The actual code would also be pretty simple.
Unlike most MCUs, you can basically choose whatever and however many peripherals you want from a huge list. You drag them into a schematic page, and wire them up however you want. In this case, the wiring is pretty simple:
Here I have created 8 PWM outputs. Configuring them is a breeze:
Here I am configuring one of them as follows:
- 16 bit resolution (this will give you more than 12-bits res for your application)
- Time period of 20ms
- An initial pulse width of 1.65ms
This setup means that as soon as the PSoC is powered on and the PWM modules are started, they will immediately produce the 0º signal.
What is the purpose of R2 in the first circuit? It's limiting the maximum current to the motor to 12V/220Ω = 54.5mA, which is probably not enough.
Just connect the motor directly to the collector of Q2.
You also need a couple of other changes: put a resistor (e.g., 4700Ω) between the MCU output and the base of Q1; otherwise, the B-E junction of Q1 looks pretty uch like a dead short to ground to the MCU. Similarly, you need a resistor (about 1200Ω) between the collector of Q1 and the base of Q2; without it, when Q1 switches on, it basically shorts the 12V supply to ground via the B-E junction of Q2. 1200Ω limits the base drive to Q2 to about 10mA, which should be plenty.
Best Answer
sounds like you want to use a PPM signal. Instead of modulating the pulse width, you're modulating the time between pulses.
Say you want to control six servos using a single channel: You'll build a 'packet' with seven pulses, the time between the pulses indicates to the receiver the desired servo position, nominally 1500uS. Let's say we want all six servos to be at dead center. In this case you'll send the seven pulses, each separated by 1500uS. On the receiver end, you'll map each gap between pulses to a servo where you can generate a continuous PWM signal with the desired period and duty. I'll throw up some code if you'd like.