Solving the Variable Ebrake-Throttle Problem

Electric Motors and Controllers

Re: Solving the Variable Ebrake-Throttle Problem

Postby amberwolf » Mon Aug 20, 2012 11:50 pm

Kingfish wrote:My only negative about the design is perhaps that we have an unused OpAmp. I spent a little time trying to see if one could be had with one circuit instead of two… and I did find one that worked… but the price was way too expensive. Is there a single OpAmp solution that is inexpensive?


Not sure what your parameter limits are, but:

LM741, less than a buck each (some google "shopping" searches turned up medium qty orders 10-50 that ended up <40cents each):
http://www.mouser.com/ProductDetail/Nat ... HO7fKRQ%3d

UA741 30 cents each qty 1:
http://www.mouser.com/ProductDetail/STM ... S4tJ1UE%3d

Dunno if this link will correclty bring up the filtered search, but:
http://www.mouser.com/Semiconductors/Am ... =Pricing|0
Lots of 8pin DIP/etc single opamps there.
House Fire Updates Thread


Got a question that isn't personal or private? Post it in the forums, don't PM it. ;)

Wiki your techy info so it doesn't get old, lost and icky:
http://endless-sphere.com/w


Full-Suspension Semi Recumbent Cargo Bike - NuVinci MidDrive
Semi-Recumbent Recycled-Parts Cargo eBike: "CrazyBike2"
DayGlo Avenger, MkII
User avatar
amberwolf
100 GW
100 GW
 
Posts: 13689
Joined: Mon Aug 17, 2009 6:43 am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group

Re: Solving the Variable Ebrake-Throttle Problem

Postby Njay » Tue Aug 21, 2012 1:37 am

Kingfish wrote:We don't need R12; this circuit is the bypass for it. Let me evaluate without it. :)

Keeping R12 (either inside or outside the controller) would be more like a safety feature, ensuring UV will never see a high voltage (the pack's voltage). Although there's a high series resistance (17.5K), that still allows a few mA flowing to GND, enough to fry the controller's microprocessor UV input pin. With R12 in place, the current flow from the pack through 17.5K and R12 will set a low voltage at UV "by default".

Kingfish wrote:Buffering: So how could I buffer SP with an OpAmp? I don't see it. :(

See U2 as is now? This is called "unit gain" or "buffer" amplifier. Gain is 1 (so no change to input voltage) but the ampop can provide more current at the output while keeping it at the same potential as the input and not drawing current from the input. U2's positive input would come from SP and the output would go to R106.

Kingfish wrote:Although I understand swapping to +12V. On that note, why not just power it all with +12V?

Go ahead! You'll have to re-adjust some parts, the voltage reference, the resistor for the opto's diode, ...

Kingfish wrote:BTW - this brings up a slightly OT question: I was looking at the 6FET controller schematic and spec for the LM317. I think the device outputs up to 1.5A. Using LTSpice, I modeled the circuit although I get an output of 24V – not 12V. Maybe I have something wrong.

It needs a minimum load of 3.5mA. 1.5A is kind of a theoretical limit. In practice the power dissipated in the chip is usually too much to achieve that kind of output current.

Kingfish wrote:The potential cause of the sag is when the controllers are asking for power, drawing max current and momentarily pulling the battery main below what the LM317 can handle, (...)

That would mean the battery voltage going below some 20V or so (assuming the control part of the controller draws some 200mA).
There's a trick which is to have a series diode on the positive rail to the 317 and then a beefy capacitor. Current will go in but not out, and the capacitor will hold the voltage while it sags (momentarily) at the pack. Actually there's already a capacitor there, you could add the diode (1N4007) on the input voltage VCC_L (I'm assuming the 6FET schematics).

amberwolf, the 741 needs symmetric power supply, meaning GND, a +V and a -V to work, and is still the same package size of the LM358. I actually buy LM358 around here for $0.27 single unit or $0.21 for 6 or more. Can't be more expensive than this in the US!
Njay
10 kW
10 kW
 
Posts: 554
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

Re: Solving the Variable Ebrake-Throttle Problem

Postby Kingfish » Tue Aug 21, 2012 11:34 am

Lots to comment on…

Alan B:
I am unsure how to employ this device; certainly it appears to have a lot of value, though I don’t know where it would plug in as the examples of use are numerous. Perhaps with a bit of your help I could understand and learn? :? :)

Njay:
With R12 between U2-A OUT/UV and GND, I did note that as Throttle rises, Current through R12 drops about 1mA – from about 2.8mA to 1.8mA, and that UV changes range from 3.388-2.255 (w/o) to 3.338-2.256 (with); it was tiresome to reign it back in as R104 went from 2.5K to 2.31K & R107 from 2.6K to 2.89K. <phooey>. But the real problem is that R12 is not 1.2K, not on my boards cos I’ve already modified them for high-regen-braking -> it’s something like 835 or 935 ohms depending on which of my two controllers were talking about. (It’s at this point I begin ripping my hair out like Larry-Stooge and barking around in a circle on the floor like Curly). What I’m trying to say is that R12 is all relative. Why don’t we just replace it with a nice high-turn 2K POT and have a beer? :wink:

U2: Sorry for being dense, but I need you to explain it to me in terms of U2-A and U2-B because I can’t follow it. Or write over the image with the proposed correction, or reference a previous schematic where we may have had it drawn correctly :)

Switching devices from 5 to +12V: R104 will have to become a 10K POT as it falls right in between stock values for R106 (which was 14K & now 62K), and R101 went from 300 ohms to 1K. All good.

Vcc_L & Diode: Ha! I can do that now right after the keyswitch. My only sad thought was that both controllers would have the same 12-volt supply, but I will try this solution and see if it solves the problem. The C2 cap on my modified controllers is 100V 100uf. There’s not much room to stuff a bigger one, however for my DC-DC converter I placed a retired 63V 470uf cap on the +12V line which is why the voltage barely dips 0.05V when the Left-Right indicators are flashing. :) (It always cracked me up to watch the ampmeter on a car dashboard walk left-right when the flashers were going on/off while sitting at a stoplight, poor ol’ alternator struggling at idle to keep up with those lossy incandescent lamps… what’s with that?)

I’d show you Version 12, but it only has the changes discussed above which ain’t much. Gimme a proper U2 layout like you spoke of and I’ll do it pronto <nods>.


Cheerios or Fruit-Loops for breakfast?
No, make it Cap'n Crunch's Crunch Berries, KF :wink:
<gosh no wonder I went to the dentist so often…>
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9624 miles-to-date, 4134 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1 GW
1 GW
 
Posts: 3489
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: Solving the Variable Ebrake-Throttle Problem

Postby Njay » Tue Aug 21, 2012 12:55 pm

Kingfish wrote:With R12 between U2-A OUT/UV and GND, I did note that as Throttle rises, Current through R12 drops about 1mA – from about 2.8mA to 1.8mA, and that UV changes range from 3.388-2.255 (w/o) to 3.338-2.256 (with); it was tiresome to reign it back in as R104 went from 2.5K to 2.31K & R107 from 2.6K to 2.89K. <phooey>. But the real problem is that R12 is not 1.2K, not on my boards cos I’ve already modified them for high-regen-braking -> it’s something like 835 or 935 ohms depending on which of my two controllers were talking about.

R12 has an influence on UV yes, but from a certain value up the ampop should rule. R12's maximum value should be one that puts UV at 5V under the highest pack voltage. You're free to go without it of course; all I can say is that If I did it for me, I would have an R12 (or a 4V7 - 5V1 zener diode, which would provide similar protection although a little more expensive but with the advantage of being independent of pack's voltage). The thing is that in certain situations, like at startup, things come up at different points in time in a "random" (although deterministic) order, and this is not easy to control.

Kingfish wrote:Why don’t we just replace it with a nice high-turn 2K POT and have a beer? :wink:

You can take the beer, but should avoid pots as much as possible :), for several reasons, including but not limited to:
1) more expensive
2) bigger, which means more expensive again in terms of PCB size, weight, ...
3) mechanical moving parts, each means less reliable
4) an extra calibration parameter, each means more difficult to make it work
5) if the adjustment is needed, higher probability of design not being sound

Kingfish wrote:U2: Sorry for being dense, but I need you to explain it to me in terms of U2-A and U2-B because I can’t follow it. Or write over the image with the proposed correction, or reference a previous schematic where we may have had it drawn correctly :)

An image is worth a thousand words :)

buffer.jpg
buffer.jpg (8.24 KiB) Viewed 313 times
Njay
10 kW
10 kW
 
Posts: 554
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

Re: Solving the Variable Ebrake-Throttle Problem

Postby Kingfish » Tue Aug 21, 2012 2:15 pm

I like the Zener idea. Would this unit work: KDZ4.7B or 1N750 or the 1N5230?

U2-B: OK - I read you loud and clear :D

Here's the latest version...

Image

  • Was +5V, is now +12V
  • U2-B hooked up as SP-buffer
  • No R12, but instead a Zener (D2)
  • New values for R101, R104 & R107

Image
Voltage for SP & UV, and Current through anode of D2.

Image
PCB modified. Changes were a bugger to spoon in, but I got'r done Hoss :wink:

Where to next?
Lunchtime! KF
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9624 miles-to-date, 4134 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1 GW
1 GW
 
Posts: 3489
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: Solving the Variable Ebrake-Throttle Problem

Postby Njay » Tue Aug 21, 2012 3:26 pm

You need to check the zener's current at the highest possible pack voltage.

Then you can check how it behaves under temperature changes :). Add this to your schematics as a SPICE directive:

.temp 0 5 15 25 35 40

When you simulate, it will do one simulation for each of the mentioned temperatures (in deg Celcius) and draw the graphs on top of each other. Seeing a single graph (or roughly a single graph) is good news, means all the graphs are at the same places, meaning temperature doesn't affect the circuit in any relevant way.
Note: "Temperature" refers to the components' own temperature.

Ah, just noticed something. You're using 12V on U1's LED. This will make -EBS take 12V when the EBRAKE switch is open, and it probably isn't prepared for that, it's probably a microcontroller input, and therefore shouldn't take more than 5V.

You're still using resistor and pots with very weird values.
Njay
10 kW
10 kW
 
Posts: 554
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

Re: Solving the Variable Ebrake-Throttle Problem

Postby fechter » Tue Aug 21, 2012 4:36 pm

I'm still a little unclear on what you want the circuit to do.
From what I can gather:
Leave the throttle signal alone when the brakes are off, as well as the UV input.
When brake is applied, UVP gets fed a signal that varies from 2.25v to 3.38v depending on throttle signal and time.

Is this right?

Seems like the UV pad will have full pack voltage on it normally. If this pad is held down, won't it disable the controller? It would be possible to use a transistor to pull down the UV pin only when the brakes are applied.

You should measure the voltage on the EBS pin with the controller on. Is it really 12v? I'd guess 5v, but it could depend on the model of controller.
"One test is worth a thousand opinions"
User avatar
fechter
100 GW
100 GW
 
Posts: 9347
Joined: Sun Dec 31, 2006 3:23 pm
Location: California Bay Area, USA

Re: Solving the Variable Ebrake-Throttle Problem

Postby Kingfish » Tue Aug 21, 2012 5:01 pm

Njay wrote:You need to check the zener's current at the highest possible pack voltage.

Then you can check how it behaves under temperature changes :). Add this to your schematics as a SPICE directive:

.temp 0 5 15 25 35 40

When you simulate, it will do one simulation for each of the mentioned temperatures (in deg Celcius) and draw the graphs on top of each other. Seeing a single graph (or roughly a single graph) is good news, means all the graphs are at the same places, meaning temperature doesn't affect the circuit in any relevant way.
Note: "Temperature" refers to the components' own temperature.

Ah, just noticed something. You're using 12V on U1's LED. This will make -EBS take 12V when the EBRAKE switch is open, and it probably isn't prepared for that, it's probably a microcontroller input, and therefore shouldn't take more than 5V.

You're still using resistor and pots with very weird values.

  • Zener & Temp: @ 63V, when EBrake is applied, Zener varies between 1.8 to 4.7 uA from 0 to 2V. When EBrake is open (n/c) Zener varies 2 to 14.5nA from 0.3 to 4.5V. Should I take that as being good? When Ebrake is open (n/c), current through Zener ranges from ~10nA @ 24V to about 18nA @ 100V.
  • When Ebrake was applied, there was no change in SP or UV when Battery was at 24, 63, or 100V.
  • Reset +12V to +5V; Good catch & my bad. -EBS is no longer a problem. I just want one source for power coming to the PCB. 5-Volts will have to do. R101 is back to 300 ohms, R103, 104 and 107 are similar to V11, but the Zener must have had some slight influence cos I had to twiddle a bit with them.
  • Resistor & POTs: Why are they weird? What should they be?? :|

Richard:
  • I have measured -EBS in the past and its' range is +5V or GND. When pulled to GND,Throttle is cut and EBrake is applied.
  • I will go measure UV on a live controller; I'll go do it here in a tiny bit and report back.


I'm still hungry. Maybe I'm part-Hobbit...
~KF
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9624 miles-to-date, 4134 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1 GW
1 GW
 
Posts: 3489
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: Solving the Variable Ebrake-Throttle Problem

Postby Njay » Tue Aug 21, 2012 5:12 pm

Kingfish wrote:When Ebrake was applied, there was no change in SP or UV when Battery was at 24, 63, or 100V.

Sorry, I should have said that this is what matters that doesn't change with temperature nor voltage. The rest like the zener you just want it to be inside certain limits (mainly because of voltage, current or power). Up to a very few mA current through the zener is ok.

Resistor & POTs: Why are they weird? What should they be?? :|

Weird like 300, 62K and 3K. There are no such values in cheap common 5% tolerance resistors. You have either 270 or 330, 56K or 68K, 2.7K or 3.3K. As for the pots I get it, the values are just the adjusted point :)
Njay
10 kW
10 kW
 
Posts: 554
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

Re: Solving the Variable Ebrake-Throttle Problem

Postby Kingfish » Tue Aug 21, 2012 5:52 pm

EBrake: OK, so we're good then? :)

Resistors: I am picking values that are available and in stock from Digikey in either 1/10 or 1/8 W. Why not use what I can get? :)


MEASUREMENTS
Measurements were taken twice using two different multimeters.
The controller is my highly modified & retired/spare 6FET IRLB4030 Infineon XC846 from the 2010 Road Trip.

    Vbatt = 56.0/56.3 (15S LiPo; slightly below 50% charge)
    +12V Rail = 12.09/12.1
    +5V Rail = 4.97/4.9
    -EBS = 4.65/4.3
    UV = 2.946/2.9
    R12 = 837/844 Ohms
R12 is in agreement with the copy of Hyena's R12 Spreadsheet: The calulated R12-average is predicted to be 835 Ohms, providing an HVC of 76.23 Volts ...which sounds right to me for this particular controller.

What else do you want me to measure? I can't hook it up to a motor and spin cos I'm just one guy in a hidden urban bat cave up the side of the hill clandestinely hiding from interesting natives in Redmond, Washington, and I think it would take one to hold the throttle, the other to hold the bike steady, and my third arm holding the controller whilst the other two take the measurements.

Suddenly, I feel thirsty again :twisted:
~KF
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9624 miles-to-date, 4134 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1 GW
1 GW
 
Posts: 3489
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: Solving the Variable Ebrake-Throttle Problem

Postby Alan B » Tue Aug 21, 2012 6:04 pm

You might want to get a resistor assortment for your electronics toolbox, Radio Shack had some nice ones, probably eBay as well.
-- Alan W6AKB Cromotored FS GreyBorg, Novara MTB 9C, eBikeE Bent BMC, myEbikeWeb and Thanks to Justin at ebikes.ca for rescuing this forum!
User avatar
Alan B
1.21 GW
1.21 GW
 
Posts: 3871
Joined: Sat Sep 11, 2010 7:43 am
Location: San Francisco Bay Area, USA

Re: Solving the Variable Ebrake-Throttle Problem

Postby Kingfish » Tue Aug 21, 2012 6:15 pm

Alan B wrote:You might want to get a resistor assortment for your electronics toolbox, Radio Shack had some nice ones, probably eBay as well.

<sigh>
What I need to do is sell off my brewing equipment that's taking up valuable space in my back room so I can turn it into a proper Electronics Lab. Then I could fix my warp drive... er um, assemble The Mod :wink:

But yer correct, absolutely spot on: I need a kit.

Time to order parts?
:D KF
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9624 miles-to-date, 4134 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1 GW
1 GW
 
Posts: 3489
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: Solving the Variable Ebrake-Throttle Problem

Postby Njay » Tue Aug 21, 2012 6:28 pm

Kingfish wrote:Resistors: I am picking values that are available and in stock from Digikey in either 1/10 or 1/8 W. Why not use what I can get? :)

They are usually more expensive and harder to get... sorry I'm just to used to design for low cost.
If you're using 1/10W resistors, you should check if the power dissipated on R101 is within limits (in this case I would do no more than half resistor power rating).

You should do a final check on the current going in and out of U2-A in temperature and pack voltage extremes, since the zener was added and although UV's voltage hasn't changed, currents in and out of that node sure have.
Also, if you're going to use it with an R12 on the 800-ish Ohm, you should simulate that, it also may force too much current in/out of U2-A.

There's always one more thing, uh :)? No wonder you're always thirsty :)
Njay
10 kW
10 kW
 
Posts: 554
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

Re: Solving the Variable Ebrake-Throttle Problem

Postby Kingfish » Tue Aug 21, 2012 6:59 pm

Nearly all the components on the controller are SMD, including R12. I'm comfy with trying to stay with small low-power devices - except for prototype; discretes are easier to handle.

R101 looks like the biggest consumer at 10.5mA; want me to drop it some more? The next biggest is over by the Zener; @ 100V it becomes about 5.65mA at the OUT of U2-A, but R108 is still way below that at about 110uA. U1-E has about 133uA. I think we just need to worry about R101. :)

Pitcher empty. Time to roll in another barrel ;)
~KF
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9624 miles-to-date, 4134 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1 GW
1 GW
 
Posts: 3489
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: Solving the Variable Ebrake-Throttle Problem

Postby Njay » Tue Aug 21, 2012 7:20 pm

Ok, then at 300 Ohm and 10.5 ~ 11mA the dissipated power is 300 Ohm x 11^2mA ~ 37mW which is way smaller than 1/2 x 1/10 W (50mW).

5.65mA at the ampop's output is small enough not to worry about, especially since it's fed by only 5V.

So it's ok, you can proceed :)
Njay
10 kW
10 kW
 
Posts: 554
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

Re: Solving the Variable Ebrake-Throttle Problem

Postby Kingfish » Tue Aug 21, 2012 7:33 pm

Kingfish wrote:Scopes:
OK, lets say we try to compare two scopes together...
  • Owon definitely has a bigger and higher resolution screen, though on the down side only a 10 Mpt deep memory... plus slightly more expensive.
  • Rigol has smaller less impressive screen, though a better price and a 100 Mpt deep memory.
  • Both are 2-channel and 1 GS/s sample rate. Both have USB.
Beyond the obvious, I cannot make a proper decision – though I will say I’m not bent over $30 and I’d lean toward the Owon cos of twice the resolution for $30. But the bigger question is will I notice the difference between 10 and 100 Mpts of deep memory? I haven’t a clue. For my first scope, what should I do?

I placed the order for the Owon Scope. I couldn't tell if this comes with any parts or toys. It looks like it can run on a battery for portability. I don't need to worry about that, though I do hope it comes with an A/C supply. The manual is spare on what it comes with; no mention of probes or a packing list, though it does say it has a "super capacity lithium battery (optional)". :?

Anyways, it should be here by Monday.
Parts! We need parts I tell you, KF
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9624 miles-to-date, 4134 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1 GW
1 GW
 
Posts: 3489
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: Solving the Variable Ebrake-Throttle Problem

Postby fechter » Wed Aug 22, 2012 1:28 am

The EBS and UV connections seem to be direct inputs to the microprocessor, which runs on 5v. Exceeding 5v on these lines would be bad. My guess is the battery goes through a resistor divider to the UV point and triggers UVP when it gets down to around 2.5v.

I don't see the need for an optocoupler here. One may be a good idea to interface two controllers, but even then probably not necessary. A single transistor and some resistors can be used as an inverter/level shifter to do that job.

I'd suggest taking it one step further and use a FEEDBACK LOOP to drive the UV point, assuming that will actually modulate the level of regen. Signal would come from the existing shunt in the controller, which measures battery current. By implementing a loop, the control (throttle signal) would change the regen current, but be independent of motor speed over a very wide range. Ideally you'd want motor current to be the sensor, but that is quite complex to do. Battery current is much easier. For a fixed throttle signal, the regen would automatically hold a constant regen current to the batteries (constant power). At very high speeds, the braking force would be less, and steadily increase as the vehicle slows down until you get to practically a crawl, then drop off.

The loop compensates automatically for a lot of unknown variables.

A fixed level of regen power could be set such that the controller conditions never go into self-destruct range. Imagine only the brake lever and a manual pot that gets adjusted for the maximum allowable power.

The loop circuit may be simpler, depending on how fancy you want the throttle interface to be.
"One test is worth a thousand opinions"
User avatar
fechter
100 GW
100 GW
 
Posts: 9347
Joined: Sun Dec 31, 2006 3:23 pm
Location: California Bay Area, USA

Re: Solving the Variable Ebrake-Throttle Problem

Postby Lebowski » Wed Aug 22, 2012 1:37 am

Kingfish wrote:I placed the order for the Owon Scope. I couldn't tell if this comes with any parts or toys. It looks like it can run on a battery for portability. I don't need to worry about that, though I do hope it comes with an A/C supply. The manual is spare on what it comes with; no mention of probes or a packing list, though it does say it has a "super capacity lithium battery (optional)". :?

Anyways, it should be here by Monday.
Parts! We need parts I tell you, KF


Please let us know what you think of this scope when you've played around with it a little. I have about 4 scopes
but they're all old surplus from work (one of them a mint tds784c :D, the rest has something minor wrong with each of
them) and I'm very curious how the new generation $400 scopes performs...
User avatar
Lebowski
100 kW
100 kW
 
Posts: 1462
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Solving the Variable Ebrake-Throttle Problem

Postby Kingfish » Wed Aug 22, 2012 11:07 am

I came very close to ordering parts last night, but then a new thought arrived and I wanted to take one last breath and review what we know. My sleep was light with lots of business…

  1. It has occurred to me that in this present design, we are using Throttle (R or HE) to change the value of UV, however it can be adapted to another device such as an HE-enabled hand brake or foot pedal without changing the circuit: SP on this design is meant to intercept Throttle, but it could easily become just a simple input. Maybe it’s stating the obvious, though it hasn’t been explicitly expressed.
  2. Alan B posted on the 2WD (Two-Wheel Drive) FAQ his interpretation on how to employ a differential amplifier to re-reference Throttle. I would like to take a look and see how this would compare/contrast with using the present U2-B OpAmp to buffer SP. :)
  3. On Tue Aug 14, 2012 8:31 am, whatever posted:
    whatever wrote:dont the xie cheng controllers have variable ebrake as an option anyway?

    …and through oversight I did not reply. So I ask rhetorically if this is the case.
  4. At present the proposed Mod is effective for up to 100V with the goal of resolve progressive braking-regen for systems operating below this amount. If this works, I’d like to apply the solution to higher ranges.
  5. Richard, & using V12 schematic as a reference (except +12V has been replaced with +5V):
    1. I am keen to understand how to replace the optocoupler with a transistor. Could you elaborate please? :)
    2. On the Feedback Loop, I presume that is not accomplished by U2-A?
  6. Lebowski, I certainly plan to review it upon arrival. :) I am concerned that there is no information about what the product includes and does not.
  7. The next version will be 14; I already have a V12B, but it’s changing… that and I’m slightly superstitious :wink:
Onward with coffee, KF 8)
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9624 miles-to-date, 4134 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1 GW
1 GW
 
Posts: 3489
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: Solving the Variable Ebrake-Throttle Problem

Postby Kingfish » Wed Aug 22, 2012 6:24 pm

Greetings –
I am glad I took an extra day to think this through and do a bit more diligence about how the circuit should behave in theory. My understanding is a little clearer.

Depending on the Battery Pack voltage, UV voltage drifts at least 1 volt between the LVC and a full charge. The present circuit produces a fixed linear output between two settings and is not relative to pack voltage.

I’ve used the Circuit in a diagnostic mode to evaluate HVC based upon R12 values for voltages between 65 to 200V and sampled voltage of UV, as well as the current through R12. Both have a fairly even if not a very slight gain. Example: If HVC is set to 65V and we’re at 65V, Voltage at UV is about 3.56, whereas if we had HVC set to 200V and we’re at 200 the voltage measures 3.7V. This data is useful for setting the low-limit of HVC, and the circuit has been adjusted to provide that range.

Conversely when the pack is at LVC, UV drops accordingly. At this time the circuit does not compensate for this change, so we could be creating issues; it’s difficult to know without evaluation. On one hand braking force would slowly be reduced as the pack voltage decreased; that’s actually the worst of it. Now I can begin to appreciate Fechter’s view about a self-compensating FEEDBACK LOOP. :)

Two Graphs representing the voltage drift of UV relative to pack charge.

Image

  • HVC-L is the low limit where we want soft breaking start.
  • HVC-H is the high limit where we want the hardest braking to stop.
  • As the pack loses charge (read R to L) the values for Low and High braking change because UV is relative. More importantly, the values of high and low are divergent (or convergent if reading R -> L). The differences are subtle, although could become issues at the extreme limits.
Below is the unfinished Version 14. I removed the OptoCoupler and replaced it with Q1, a low-current PNP. When Ebrake is open Q1 will be held high by –EBS and disable U2-A. When Ebrake is closed, -EBS is closed to GND and Q1 opens. The cost savings is about $0.47 – quite significant actually if this was in production. The resistor values have been adjusted to allow for 63-84V operation.

R12 is placed for diagnostics.

Image

I’ve spent the entire day researching how to have the output of U2-A track with pack drift but I haven’t found a circuit that explains it plainly. Once again I ask for help.

Many thanks, KF
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9624 miles-to-date, 4134 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1 GW
1 GW
 
Posts: 3489
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: Solving the Variable Ebrake-Throttle Problem

Postby Njay » Wed Aug 22, 2012 9:38 pm

Ok, then, if I understood it correctly, UV is used by the controller to measure pack voltage (R0 and R12 are just scaling down the pack's voltage to fit the 0..5V input range of the controller's processor; scale factor is R12/(R0+R12) ~ 0.0642). Then what you should do is to leave UV alone when not e-breaking, right?

p.s. Q1's base current is quite high, you should bring it more to the 1mA or less whereabouts.
Njay
10 kW
10 kW
 
Posts: 554
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

Re: Solving the Variable Ebrake-Throttle Problem

Postby fechter » Wed Aug 22, 2012 10:27 pm

Good job on Q1. That's what I had in mind. Raise R101 to something like 1K or even 10K to reduce power consumption (yes this could matter). Alternately, Q1 could be a P channel MOSFET with logic level gate and you don't even need R101.

Njay has a point. You might consider a diode between U2A and the UV input so the circuit can only pull down on the UV. When the op amp output goes high, the diode prevents driving the UV upward. Of course the voltage drop of the diode needs to be compensated for.

I've been swamped with other activities and haven't had time to draw what I was talking about with the feedback loop. In words, use the voltage across the shunt in the controller to measure regen current. Use an op amp to drive the regen signal (UV) such that the current tracks an input signal coming from the throttle. For a fixed braking signal, the op amp loop will try to keep the regen current constant. The signal varies the current setting from zero to some maximum that will not destroy the controller or motor.

Somewhere on this forum there are pictures of a DIY hall effect brake lever. The hall chip from a throttle and some small Neodymium magnets can make a nice variable brake signal. This would be ideal to me, as a user input.
"One test is worth a thousand opinions"
User avatar
fechter
100 GW
100 GW
 
Posts: 9347
Joined: Sun Dec 31, 2006 3:23 pm
Location: California Bay Area, USA

Re: Solving the Variable Ebrake-Throttle Problem

Postby Kingfish » Wed Aug 22, 2012 10:30 pm

Njay wrote:Ok, then, if I understood it correctly, UV is used by the controller to measure pack voltage (R0 and R12 are just scaling down the pack's voltage to fit the 0..5V input range of the controller's processor; scale factor is R12/(R0+R12) ~ 0.0642). Then what you should do is to leave UV alone when not e-breaking, right?

p.s. Q1's base current is quite high, you should bring it more to the 1mA or less whereabouts.

Hi Njay

UV: Yes, LVC is all we care about during forward motion and that is set in the firmware. During ebrake we change HVC.

Q1: Got it; set Base to < 1mA, will do! :)

I finally hit on an idea for the Feedback Loop that used another LM358: Through a voltage divider ran Battery into +In, looped OUT back to –IN w/o a resistor and called it Vb, then clipped the segment between R104 & R105 (called Feed) that was heading into U2-A +IN, and instead that links as Vb. I had this nearly dialed in with Q1 as the enabler when the application suddenly began to really churn and bog down. For for about 5-10 minutes I had nearly perfect ramping of U2-A with Battery from 66 t0 84, and then also had Throttle overlaid on top of that! 8)

But after inserting Q1 it got all bogged down I decided to reboot (didn’t help) so I’ll try rebuilding the circuit fresh in the morning; pretty beat just now.

Tedious but we’re getting there.
No stone unturned, KF
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9624 miles-to-date, 4134 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1 GW
1 GW
 
Posts: 3489
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: Solving the Variable Ebrake-Throttle Problem

Postby Kingfish » Wed Aug 22, 2012 10:42 pm

fechter wrote:Good job on Q1. That's what I had in mind. Raise R101 to something like 1K or even 10K to reduce power consumption (yes this could matter). Alternately, Q1 could be a P channel MOSFET with logic level gate and you don't even need R101.

Njay has a point. You might consider a diode between U2A and the UV input so the circuit can only pull down on the UV. When the op amp output goes high, the diode prevents driving the UV upward. Of course the voltage drop of the diode needs to be compensated for.

I've been swamped with other activities and haven't had time to draw what I was talking about with the feedback loop. In words, use the voltage across the shunt in the controller to measure regen current. Use an op amp to drive the regen signal (UV) such that the current tracks an input signal coming from the throttle. For a fixed braking signal, the op amp loop will try to keep the regen current constant. The signal varies the current setting from zero to some maximum that will not destroy the controller or motor.

Somewhere on this forum there are pictures of a DIY hall effect brake lever. The hall chip from a throttle and some small Neodymium magnets can make a nice variable brake signal. This would be ideal to me, as a user input.

From the 10K-foot view that sounds similar to BigMoose's idea with current control; I need to re-read that and your shunt idea together. I was thrashing about today cos I'm not bright enough to know all of this. But I did consider using a component like you explained "P channel MOSFET with logic level gate"... I just wasn't quite there yet on the list of alternatives cos my brain was beginning to melt :roll:

I like that HE Brake Lever idea; I had one of those for a awhile although it ended up becoming a mechanical switch for ebrake, but I'm with you: The HE Brake would be ideal! I hope we get to that shortly if this circuit has us doing the Happy-Happy Joy-Joy dance :D

~KF
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9624 miles-to-date, 4134 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1 GW
1 GW
 
Posts: 3489
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: Solving the Variable Ebrake-Throttle Problem

Postby Njay » Thu Aug 23, 2012 5:31 am

fechter wrote:Njay has a point. You might consider a diode between U2A and the UV input so the circuit can only pull down on the UV. When the op amp output goes high, the diode prevents driving the UV upward. Of course the voltage drop of the diode needs to be compensated for.

The way I see to compensate it for is to connect the return not to the ampop's output but to UV (that is, after the diode), but it doesn't work too well in this case because UV is so high impedance that the resistors on the feedback loop itself are still able to change UV by some 0.1V.

KF, you can't run pack voltage directly into LM358 for 2 reasons:

1) Maximum LM358 supply is some 30-ishV
2) Maximum input is supply minus ~1.5V

Ah, as for the Owon, good choice. I'm sure it will come with a power cord and 2 probes.
Njay
10 kW
10 kW
 
Posts: 554
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

PreviousNext

Return to Motor Technology

Who is online

Users browsing this forum: No registered users and 3 guests