New Ebike Digital Throttle Curve Managment

mystamo

10 mW
Joined
Mar 26, 2012
Messages
32
Hey Guys,

So I finished my Ebike Motor Control Throttle Management system but now I've been sitting on it for a couple of weeks.. I've lost my motivation doing a hundred other things. Tonight when I get home from work I'll start by putting up some pictures. I wanted to actually make you guys a video showing how it works but that will have to wait as I don't have someone to hold the camera for me.

Regardless of that I hope this page will help motivate me to put my project up so everyone can start to enjoy it.

Here is how it works.

I use 3 IC's

MCP3204
MCP4288
ATMEGA328

Input power for the 3 chips and throttle comes in using the Controller throttle plug. Through the same connector you also get GND and SIG. I pass the throttle signal through the MCP3204 a 4 channel 12-bit ADC and I process that using the ATMEGA328. I apply a curve to the value that is read from the 3204 using 3 piecewise 3rd order polynomials set at my choice of points to pass through. I then output this newly processed value to the MCP4288 a 12 But DAC. The signal is then passed to the controller via the SIG pin.


So all in all it's a straight through component that can be attached inline with the throttle. I also added a button to the controller that will allow you to switch between different curves based on preference. In the future I may add a screen and give the user the ability to create their own custom curve.

The code is all written in AVR and is dead simple. I already wrote the library files for the DAC and ADC so all you need to do is call ADCGET(ADCCHANNEL) and it outputs the ADC value on given channel. Or I use DACSET(DACVAL) to set the DAC value.

I have tested this out on a motor and controller (LYEN at 140v) and it took a jerky response and smoothed it out. I'm quite pleased.

Tonight I will submit some pictures. After that the video source code and schematics will follow. Please be patient with me. I have a full time job and a million hobbies on the go.

Mo
 
Back
Top