EBike Throttle Control of an RC Motor ECS

Written by: roboguru

Picture of EBike Throttle Control of an RC Motor ECS

Some ebike builders are experimenting with using RC motors and electronic speed controllers (ESC) (Check out the forums on endless-sphere.com for more information about these ebike builds). The problem with using an RC motor and ESC for an ebike is that the ESC is not designed to connect to the Hall-effect type throttle that is used on most ebikes. The solution most of these builders use is to hack a servo-tester circuit to interface the ebike throttle with the ESC. This instructable describes an adapter circuit that is purpose-built to accomplish that same task.

Note1: For demo purposes I used a small RC motor/ESC but the same circuit should work for larger RC motor/ESC that could be used in ebike applications.

Note2: Please ignore the small circuit board at the upper left of the breadboard in this picture. It is not part of this build.

Step 1: Theory of Operation

Picture of Theory of Operation

Motor controllers for ebike applications are designed to connect to a Hall-effect throttle which varies from about .8V for no throttle to about 4.2V for full throttle. Motor controllers for RC applications (called electronic speed controllers or ESC in the RC community) are designed to connect to RC receiver modules which output a 1ms pulse for no throttle and a 2ms pulse for full throttle.

So the adapter circuit needs to read the Hall-effect throttle voltage at an ADC input pin and it use that value to modulate a PWM output pin which can then be connected to the ESC. This can easily be accomplished using a small micro-controller.

Step 2: Schematic

Picture of Schematic

The Atmel ATmega8 micro-controller reads the Hall-effect throttle voltage at ADC input pin 23 and that value is used to modulate the PWM output on pin 15.

Step 3: Firmware

Picture of Firmware

The AVR C code listed here is the main loop which reads the throttle voltage, does some bound checking and scaling and then sets the PWM duty cycle proportional to the throttle voltage.

The latest AVR Studio version can be downloaded for free from the Atmel site:http://www.atmel.com/tools/atmelstudio.aspx



Step 4: Circuit Demonstration Video

A short demo of the circuit in operation.

Step 5: Circuit Board Layout

Picture of Circuit Board Layout

This version uses through-hole components for ease of construction.