Author Topic: any idea to build a throttle control that limit battery voltage drop to 41V ?  (Read 27903 times)

Offline mitch_781

  • Confirmed
  • New Member
  • *
  • Posts: 24
Hello,
I just finished to build my ebike it is 48V hub motor and I use a small battery 48V 4,2Ah NiMH because I don't go very far. The motor and controller are working very well but the battery is to small and when I go full throttle the battery voltage goes under 40v and the controller cut the power. It is going worst after a few kilometers.

The throttle control work with a hall effect sensor (see the picture) , is it possible to make an electrical system that limit/control the throttle to have only for example 41v at the battery and avoid cutting the power all the time ? If anyone has an idea to build the system it could be interesting for people who are using small batteries (or batteries with a big internal resistance like nimh).

See the throttle control with the hall sensor in the attached picture.

Thank you
Have a nive day
48v 1000W rear motor / 2*24v 4,2Ah NiMH

Offline ahend

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 58
I have been contemplating a rework of the electronic throttle hold that I built for some time. Others were musing over the possibility of locking the controller into a mode that would not allow it to draw amperage over a certain level. This would help to get you home if your pack was dying, or could serve to extend the usable range of your pack.

This could be done using a PID loop, or some variation thereof. You could sample the pack voltage, or circuit current, as the process value and the output would be a pulse width modulated voltage signal to the controller’s throttle input. All this functionality would reside on a microcontroller.

I do have some PID code that I have not messed around with yet. That would be the only technical hurdle to jump in making such a system. The throttle lock code running in my cruise control, including the PWM output has been working great.

Offline andre

  • New Member
  • *
  • Posts: 10
Hello,

Did you think about the cycle analyst from www.ebike.ca instead?
This allow to have a control loop in the controller, and limt the speed (for me I use it to control the max allowed speed... by a connector that is deconnectable, in case of control...but I've never been stopped for that time) , max amp (i.e max power send to engine = you can that way respect the max power setting required by regulation like 250w in france by just putting the max amount of amp that is required by Pin=U*I, like ~5 amp for a 48v battery..., even on a 48v 1000w engine!), and also min voltage , to decrease current drawn from the battery  when it is reached and protect the packs...
you can program whatever the number you want by a single button.
You just have to solder a wire in the controller.
I did it on a 36v regen controller (max speed without pedaling =30km/h)and now on a 48v regen controler (max speed w/o pedalling = 42km/h, >50 km range on dowtown commuting trips, but I use a 48v 15ah lifepo4) and it work pretty well. On top of providing lot of very useful info to plan your trips and follow the battery drain....This is worth the money!

Hoping that helps

Andre.

Offline Lanchon

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 99
it's easy to do it without microcontrollers if you want a really simple solution. assumptions: throttle supply is stable at about 3-5V (call it Vdd), throttle output is zero for no power, controller throttle input is relatively high impedance.

use Vdd to power an open drain (or open collector) rail to rail 3-5V single supply comparator. use a 2 resistor divider to bring the batt voltage down to the 0-Vdd range (under all circumstances) and hook the middle tap to the positive comparator input. divide Vdd using a 15-25 turn trimpot (best if impedance at the tap is similar to the tap of the other divider when trimmed to the right cutoff point) and hook it to the neg input.

insert a series resistor Ro between the throttle output and the controller input and tie the comparator output to the controller side of Ro. the comparator grounds the controller input when the batt voltage sags, Ro limits the grounding current affecting the throttle and the comparator. you may add a second resistor between the comparator output and the controller to protect the comparator from ESD. and add supply decoupling according to comparator datasheet.

IMPORTANT: before starting test that the series impedance in the throttle line will not affect controller performance (ie: verify the assumption).


here's a list of apparently suitable comparators from TI in easy to solder packages:
http://focus.ti.com/paramsearch/docs/parametricsearch.tsp?&showAllResults=true&totalCount=12&showAllResultStatus=true&familyId=81&uiTemplateId=NODE_STRY_PGE_T&techFamId=null&sectionId=null&tabId=null&appId=null&viewDeviceCallingPage=null&totalCount=12&showAdditionalParameters=yes&parameter=2479504385&parameter=2479504386&parameter=2480904669&parameter=2480904467&parameter=2480904532&parameter=2480904429&parameter=2581304386&parameter=2443104386&parameter=2443104390&rpc=D_PARAMETER_2101261|LTEQ|3.3|0&rpc=D_PARAMETER_2201261|GTEQ|5|0&lc=2000078&lc=2000480&lc=2000494&lc=2000916&lc=2001163&lc=2100217&lc=2200001&lc=2200002&lc=2000083&lc=2001192&lc=2001498&lc=2301166&compare=yes&download=yes&sort=yes&customize=yes&paramResults=yes&paramCriteria=yes&familyTree=yes&military=no&baSystem=yes&paramTable=no&sortOption=PA_SUB_FAMILY_NAME&sortMode=ASC&searchPaths=1000081&pageId=undefined&templateId=0&navigationId=0&family=analog&paramTable=no&military=no&ul=LM2903&ul=LM2903V&ul=LM293&ul=LM293A&ul=LM393&ul=LMV393&ul=TLC352&ul=TLC372&ul=TLV2302&ul=TLV2352&&uiTemplateId=NODE_STRY_PGE_T&techFamId=null&sectionId=null&tabId=null&appId=null&viewDeviceCallingPage=null#rt

this is a single comparator:
http://focus.ti.com/docs/prod/folders/print/tlv3401.html
keep output current below 0.4-0.5 mA (requires Ro of about 10K).

this dual has a higher output current:
http://focus.ti.com/docs/prod/folders/print/tlv2352.html
but common mode range is 0 to Vdd-1.25V, so scale the dividers down.

(this one's cheaper if you have to buy it:
http://focus.ti.com/docs/prod/folders/print/tlc372.html
common mode 0 to Vdd-1.5V.)

TI offers an excellent sample service, they'll send you samples of all these for free if you qualify. you'll probably want them in PDIP packages. please don't abuse TI's sample service.

Offline Lanchon

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 99
I wouldn't really recommend using an Ro above 1K, but you could test.

Offline ahend

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 58

Lanchon,
I’m not to too fluent in electronics, more study than application I’m afraid, but I think an analog approach to this problem would be pretty interesting. Help me to understand a couple points regarding your circuit.

If the comparator output is discrete, grounded or open, this would act as an effective LVC. What would “throttle” the controller output down as the battery voltage approached the comparator’s reference?

The output resistor, Ro, will attenuate the normal throttle response so it would need to be minimized. As I recall, my throttling current was about 50 micro amps, so a 1k resistor should have a small enough footprint.

Thanks

Offline Lanchon

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 99
hi andy,

> The output resistor, Ro, will attenuate the normal throttle response

that depends on the controller input. since you asked, I dug the schematic of the old golden controller: that controller has a 100K to ground (to handle disconnections) so a 1K series will form a divider that'll let through 99% of the voltage.

note that this won't limit max speed, it just means that you have to turn the throttle 1% more (it has dead-turning at both ends). also note that resistors in the circuit are already 5% tolerance and the sensor probably has wider variance, so there's really no concern *with that particular controller*.

more importantly, the same controller has an RC filter in the throttle input. the R is 3.3K, so adding 1K (and assuming zero impedance on sensor output) means lowering the cutoff frequency about 25%. but I suspect the C is 0.1uF, so cutoff would be 480Hz. lowering it to 370Hz would be no problem; you can't turn the throttle that fast!

anyway, it might be ok to short the sensor output to ground (it might have a pullup instead of an active high drive), and short current could be below what the comparator handles; in that case Ro could be zero. (you can measure short current if you want.)

> If the comparator output is discrete, grounded or open, this would act as an effective LVC. What would “throttle” the controller output down as the battery voltage approached the comparator’s reference?

negative feedback. when the comparator triggers it'll cut the throttle; this will lower the current from the battery and voltage will rise, and that will open the throttle again.

keep in mind that:
1) there's a time-discreet loop that samples the throttle signal,
and 2) current in the motor windings take many sample cycles to build up with the full battery voltage applied (it's inductive).

so there's 1-bit time sampling (instant comparator feeding 0 or 1 to the periodic A/D) with negative feedback over an integrator (the windings). this is in effect a sigma-delta modulator: output will alternate between 0 and 1 as fast as possible, but all the while making the mean value of the bit stream such that the mean batt voltage remains at the comparator trip-point. you may think that this isn't nice, but it'd probably work very smoothly.

but we're forgetting:
3) there's probably a low-pass filter before the A/D in your controller that dominates the frequency response of the loop. so the filter sort of reconstructs an analog signal from the sigma-delta stream and feeds the A/D a constant voltage, behaving more like you'd expect. (but I say sort of because a reconstructing filter should really be placed after the time-sampling, so this is only an approximation.)

in reality the dynamic response would depend on the relative values of various parameters such as winding current slope, throttle sampling frequency, PWM update frequency, throttle signal bandwidth, etc. but whatever the values, this simple circuit will probably work well enough. and you could always add a filter capacitor or two to tune performance. you could even do a full PID in analog form but I'd go with a microcontroller if a PID is needed; however I don't think that's the case.

Offline mitch_781

  • Confirmed
  • New Member
  • *
  • Posts: 24
Hello,

Thank you for your answers and the big interest you show on this topic. I am not sure to understand everything because I am not fluent in electronic as well and in english also.

I found a schemtic that may help us, it is called : amplificator differential

if you look the formula :

Vs=(R2/R1)(V2-V1)
so
Vs could be the input power of the hall effect throttle going for 5V(full charge) to 0V(low bat) depending on the level of the battery
V2 = battery voltage from 60V to 40V
V1 = reference voltage 40 or 41V built with a few zener diodes and a resistor.
R2/R1 = used to reduce voltage 60V -> 40V to 5V -> 0V


The thing I am not sure is  : will the hall effet throttle work well with an input voltage that is from 0V to 5V, or is it only working with 5V ?
I also don't know how to choose the right resistances and zener diodes to have a good working of the system.

Do you know if this could work ?

Thank you have a nice day
48v 1000W rear motor / 2*24v 4,2Ah NiMH

Offline Lanchon

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 99
> Do you know if this could work ?
the design you propose has problems. I've already gave you an ok circuit and on my own I don't see the point of going with an inferior design. unfortunately I don't have a scanner so I can't post a schematic; the text description will have to do.

Offline mitch_781

  • Confirmed
  • New Member
  • *
  • Posts: 24
Hello,
I tried to do the shematic with your explanations , is it OK ?

I think it can work but I don't understand when the comparator output is 0V, the controller input is 0V even with R0 so the throttle is cut ?

And also it seems to be a on-off control, maybe it could be possible to improve it and have a small regulation, the more the battery sag the more the throttle is reduce (that was the objective of my shematic before).

Thank you for your help.
@+
48v 1000W rear motor / 2*24v 4,2Ah NiMH

Offline Lanchon

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 99
> I tried to do the shematic with your explanations , is it OK ?
yes, it's fine. don't include an "R?". you have to add a decoupling capacitance between Vdd and ground, near the comparator: a 0.1uF capacitor (or better 0.1uF capacitor in parallel with a 10uF) will be fine.

IMPORTANT: do NOT connect the battery ground to the circuit, only the positive wire. the battery negative must NOT be connected a) to the sensor ground, nor b) to the lower part of the battery divider. all grounds must come from the sensor ground.

> I think it can work but I don't understand when the comparator output is 0V, the controller input is 0V even with R0 so the throttle is cut ?
correct, it's cut when comparator is grounding the output. otherwise it's whatever the sensor outputs. (please clarify your question.)

> And also it seems to be a on-off control, maybe it could be possible to improve it and have a small regulation
it *will* regulate, don't worry abut that.

next you got to:

1) measure the Vdd voltage.
2) select an appropriate comparator THAT YOU CAN GET YOUR HANDS ON. I suggest using a DIP package and a socket; if you fry it, you can easily change it.
3) then I'll help you select the rest of the components accordingly.
4) in particular, you have to test that adding an Ro won't affect controller performance before building the whole thing. or you can try it now, by adding a 1K resistor.

you can add a voltage reference (or just a regulator) feeding the trimpot from Vdd  for extra accuracy (I don't know how constant is your Vdd, variations in Vdd will provoke variations in the Vbat trip-point). where are you buying or getting your comparator? where are you located?

also, if you use a dual comparator you just can't leave the unused comparator unconnected, I'll tell you what to do when you get your hands on a specific part.

Offline mitch_781

  • Confirmed
  • New Member
  • *
  • Posts: 24
Hello,

Thank you for your answer and your help again,

> I think it can work but I don't understand when the comparator output is 0V, the controller input is 0V even with R0 so the throttle is cut ?
>correct, it's cut when comparator is grounding the output. otherwise it's whatever the sensor outputs. (please clarify your question.)

Maybe there was a misunderstanding, the target for me is to build a circuit to avoid the controller to cut the power when the battery goes under 40V by controlling the throttle. I have a quite small battery and even with the battery full charged when I go full throttle the voltage goes under 40V and the controller cut the power so I must release the throttle wait a bit and go medium throttle. Also the limit is very difficult to feel when you climb a hill.

I think your circuit is cutting the throttle when the battery is to low (my controller is already doing this) I would like to prevent the cut of the battery and control the throttle to be always upper than 40V.

I know there is a cycle analyst that is sold to limit the down voltage but I don't know if it works on GM controller and I don't know if there is a regulation (and also it is 150$ and I don't need all the other fonctions, Wh, speed ...).

I think with a small circuit it could be possible to have a good solution but I am not sure if it is ok because I don't know how is working the controller input and I did not practice electronic after school.

I took a part of your previous schematic and modified it :
1st AOP (=comparator) is to follow battery voltage
2nd AOP make the comparison battery voltage  / minimum limit allowed + amplification result is 5V =R*(60V-41V) = full power allowed for example.
transistor regulate the throttle.
3rd maybe necessary : AOP to follow the output voltage of R6 (throttle input to the controller)

1) measure the Vdd voltage.
Ok I'll do this as soon I will be back after my holidays.

2) select an appropriate comparator THAT YOU CAN GET YOUR HANDS ON. I suggest using a DIP package and a socket; if you fry it, you can easily change it.
I have already an idea on which socket I'll do it. (I don't know the translation)

3) then I'll help you select the rest of the components accordingly.
thank you, if everything works well I'll post the final solution to allow everyone to use it. I know this problem of cutting voltage is frequent with the 1000W motor.

4) in particular, you have to test that adding an Ro won't affect controller performance before building the whole thing. or you can try it now, by adding a 1K resistor.
That is the reason why I would prefer to command the controller with a voltage output.

>you can add a voltage reference (or just a regulator) feeding the trimpot from Vdd  for extra accuracy (I don't know how constant is your Vdd, variations in Vdd will provoke variations in the Vbat trip-point). where are you buying or getting your comparator? where are you located?
That is why I wanted to use zener diodes to fix the voltage but maybe just just with a trim pot it will be ok, I live near Paris so I think I can find a local dealer for all the electronic.

Find attached a schematic I made with TINA, it is free download on www.telecharger.com

there is also diptrace it is free and english + french software, it seems to be powerfull.
http://www.01net.com/telecharger/windows/Loisirs/electronique/fiches/37752.html

So, I hope to be able to build a first circuit soon but I prefer to be sure beacause I don't want to fry my controller.

Have a nice day

48v 1000W rear motor / 2*24v 4,2Ah NiMH

Offline Lanchon

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 99
look, no offense intended, but I'm gonna help you only if you want to be helped. there's no point in me telling you what to do if you're going to do something else. it's entirely your decision to trust me or not to do it. and your decision may be complicated by the fact that I have no desire to win your trust and won't do anything to that effect.

so, in case you do choose to trust me:
-there's no misunderstanding on what you want to do.
-my circuit does it; it's not a LVC, it'll function as a regulator.
-your circuit has problems.

>> 4) in particular, you have to test that adding an Ro won't affect controller performance before building the whole thing. or you can try it now, by adding a 1K resistor.
>That is the reason why I would prefer to command the controller with a voltage output.

there's no reason to complicate a simple circuit that's very probably appropriate. if it isn't, according to testing, it can be made appropriate by adding a buffer or choosing a comparator that can sink more current.

> That is why I wanted to use zener diodes to fix the voltage but maybe just just with a trim pot it will be ok

I'll know if a regulator is needed with some certainty as soon as you measure Vdd, and not before.

so you have to:
a) measure Vdd,
b) choose a retailer in your area with online presence so that I can select the most appropriate components,
c) and sooner or later you'll have to test the series impedance (if done before "b)", use a 1K resistor).

thanks for the pointers but I won't install any software; I don't use windows or proprietary software. don't waste your time and money routing a board: the easiest way to build this very simple circuit is using a small perf-board. or it could be done dead-bug style (wikipedia).

and one more important thing: you have to check the assumption that battery ground and sensor ground are approximately at the same potential.

could you post a pic of your controller?

Offline mitch_781

  • Confirmed
  • New Member
  • *
  • Posts: 24
Sure I want to be helped but I 'd like to understand what I do. It is maybe easy for you to say the circuit has problems but it is not for me to understand why.  ::)

Concerning your circuit, I think I understood how it works the regulation is done by puting to throttle to zero every time the battery is under a level, the input of the controller will be 5V-0V-5V-0V and the mean value will correspond to the maximum throttle allowed to keep the battery at the level. (I hope it will be fast enought)

I will follow your circuit, sure it is more simple and it must work.

a) measure Vdd,
I will do this after my holidays in 3 weeks, no problem.

b) choose a retailer in your area with online presence so that I can select the most appropriate components,
I will order to radiospares, all componants are here for the AOP :

http://radiospares-fr.rs-online.com/web/search/searchBrowseAction.html?method=browseSuperSection&Ne=4294958156+4294965516&N=4294963037#

c) and sooner or later you'll have to test the series impedance (if done before "b)", use a 1K resistor).
I will do it also no problem.

I put the updated circuit below.

Thanks
« Last Edit: August 25, 2008, 04:33:45 PM by mitch_781 »
48v 1000W rear motor / 2*24v 4,2Ah NiMH

Offline Lanchon

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 99
ok, when you measure Vdd (and the voltage between grounds) we'll continue.

> I will order to radiospares

they seem adequately stocked.

> It is maybe easy for you to say the circuit has problems but it is not for me to understand why.

please understand it's much more effort for me to explain these things than to design an ok circuit.

the most important thing: even if your circuit did what you want (it doesn't), it wouldn't work; it would oscillate between 0 and Vdd just like mine. the reason is loop instability induced by the group delay between throttle input and battery sag.

no doubt it could be turned into a compensated (say, a PID) controller, but are you willing to ride with a portable oscilloscope analyzing responses and tuning the PID while you negotiate traffic? I'm giving you a simple solution that you'll probably find quite acceptable and that doesn't need complex calibration, just the desired trip-point.

one more thing: with 2 or 3 small components you could add a LED to show when limiting is occurring. if you'll mount the circuit in a visible place, it could be worth the effort. (routing two long wires to a visible led is probable overkill...)