Mosfet Precharge + ON, is this a bad Idea?

Kin

10 kW
Joined
Mar 5, 2011
Messages
867
Location
Near Boston, MA, U.S
Well, that was a flatlining experience. 1 post, from Amberwolf, has allowed me to discover http://endless-sphere.com/forums/viewtopic.php?t=32135, which is more or less what I wanted to do. Urp.



Hiya All,

I've not been around on ES for a while. I've tried to do my research, but maybe what I'm about to post about has been discussed and done a thousand times before, so please just point me in the direction of what I missed, and I'll slink over there.

I am hesitant suggesting this because I know it's been done in one form or another on ES, and certainly suggested before. But I am interested in involving some of my interests and (newb) experience with hardware to make a nifty on-switch for my bike. The preexisting information I've found about this topic has been limited to vague references (e.g, I think Jeremey (I forget rest of name- the mod) made an on switch in the method I'm going to suggest, for his light-weight folder.)


OK! Lets proceed:

Goal

The goal here is to have a low-cost momentary on-switch that turns on a MCU that, in turn, turns on some mosfets for power from the battery to the controller. A few additional functions and options emerge from the use of a digital MCU (as opposed to doing an analog system).

General Method

1) Press a momentary switch
(Momentary switch allows momentary Vcc to AVR 5V microcontroller running with minimal external parts)
>>>>>>2) Microcontroller (MCU) turns small transistor to maintain its input VCC.
>>>>>>>>>>>>3A) Microcontroller turns on either 1 mosfet dedicated to running Vbat to the controller through a resistor
OR
>>>>>>>>>>>>3B) Microcontroller does a gradual PWM duty cycle ramp to connect Vbat to controller in a soft-start over 3 seconds. This is easy & preferred, but depends on if I learn how to turn the mosfets on (my previous experience has only been with logic level mosfets...I am still trying to understand how a 5v MCU controls a >5V Vgs signal).
>>>>>>>>>>>>>>>>>>4) Maintain a bank of several 4110 Fets ON to allow power through the circuit.
>>>>>>>>>>>>>>>>>>>>>>>>5) Monitor the current. If the current goes above an emergency threshold (set in code) then, shutoff system.
>>>>>>>>>>>>>>>>>>>>>>>>*Problem*: I don't know what to expect. If I spec a system to 100V, assume RdsON is applicable (fullON), and 1.5W T-220 cooling, then how high can I allow a spike and for how long? This will probably be based on input/suggestion from an expert, or finding a value that makes us comfortable that the fault-condition function is working without being too low for false-alarms or too high for letting the mosfets burn before we shut things off.*
>>>>>>>>>>>>>>>>>>>>>>>>5A) methods of monitoring current:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>5A1) Hall Effect IC:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>These are widely available in a range of currents, with 5V operation. They' have some pros and cons. Biggest con I see is the complication to board layout and whether they're as easily variable for different current ranges (a shunt I can change shunt type or possibly rely on my lack of needing particularly precise resolution; I haven't looked into how to change hall effect current sensing sensitivity in a typical current IC)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>5A2) Shunt? I'm going to have a 10-bit ADC (10k sampling) available and can at best (lowest) set Vref to 1.1V. So if we want this to work for emergency registering of a current above 75A and up to 600A, then a 1.8mOhm shunt would work. At typical use, with a 1.8mOhm shunt, we could register things to resolution of roughly an AMP...which is enough, I think. A 30A signal would read a value of about 55, and and a 75A signal would read 138, so that gives a wide enough threshold to monitor emergency fault conditions.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>6) Monitor one of the pins with 20k internal pullup set HIGH, if this pin goes LOW, kill the power to controller. Brutal, but for emergency shutoff (for example, Celllog alarm)

7) and ##)
Plenty of other things could be added. For example, shutoff after 10 minutes of <5A current.

WHY?

I want a neat solution to the high costs and awkward bulk of contactors, I want to play with mosfets, and I want to do something based in C-code that I could present for any members even newer to hardware &code, for them to modify in minor ways that might suit their needs. It's not a BIG need for ebikes, but it might be useful for some people; if everything is laid out and available could lower the barrier so it's worth it for other people to add to their project. Summary: I'll learn a few things. Maybe someone else would like to repeat it, or tweak the code for their application. I can probably also sell some boards if it's worth it or I get that far; maybe even print out some cases in my 3D printer and do a few molds to practice moulding without losing as much money.

Things I'm still trying to learn about / Technical Roadblocks
1)
What's the cheapest way to keep a mosfet gate up? I am planning on working with 4110s, and hoping to be reasonably compatible with other similar Vgs options). I understand there are mosfet gate driver IC, some capacitor floating method, some charge pump circuits, and a few other methods. I could benefit from an expert opinion "your cheapest way would be : X" or some direction to learn more about driving mosfets. Most of my research on google has been theoretical and not functional, perhaps I've been looking in the wrong direction. None of my ECE friends know the in-use information for mosfets, but I feel like this is done so often there must be an ideal method for my application. It is my understanding a lot of the mosfet switching theory is not important for my case because it's basically hard ON the majority of the time.
2)
High side or low side? The easiest way for me to do this would be running the NPN on the low-side...But then I've reduced half of the minimal safety benefit of this system (hopefully it could react quickly enough to turn off a short). If only on the negative side of the battery, I guess the battery could still short to ground. I'm mostly simply bummed by this fact, because I suspect the marginal benefit of working HIGH-sde is not worth the complication, and the bike is not even grounded (rubber tires in the air, right?) so I am not sure what sticking with the high-side would gain. But, this is still a technical decision that needs to be made.
3) How to CHEAPLY power the 3.3-5V microcontroller over a wide range (36-100V) of input voltages, without being lame and using a linear regulator.
(A) My hope right now is that I can test out some of the terribly cheap low quality but low cost 5V ebay-apple-USB-chargers. If they work on a wide range of DC input voltages and don't go above 5.5V, then they should be a great product for a couple hundreed mA of 5V. I have several of them that I need to test. Nothing beats the fact they're <$2 including shipping. It doesnt make sense, but that's mass-production, I guess. Every switching regulator IC i've seen seems to have a <60V input range, and costs >$6. Of course they're better quality, but it seems like there's nothing that can even deal with a 36-100V input range.
4) ???? I'm working off memory from my paper draft, and I can't remember what other technical choices are still undetermined. ??? there are a couple more

Potential future?

Well, I want to do this on the aaTiny45 probably. I'll write code in the arduino environment unless I reach a limit there, and I'll post all the final code. I'll try to make useful functions and basic setup, so that anyone can do modifications as they might want. I'm hoping there could be a couple niche uses for something like this being accessible to more hobbyists. For a different project (I'll post it next weekend? or the weekend) I plan on making the parameters something that can be changed without a programmer, but for this board I think there are too many things to rely on a rudimentary programmer-less programming (at least to my level of sophistication). Basically, there are too many application specific settings. But these can be changed by adjusting the variable parameters in the easy to read arduino-environment code.

Different project for the near future:
The other project I mentioned I'll post more info on, will be custom throttle code IC. Run your throttle input into the MCU, and the MCU will run a PWM output through a small LC circuit that modifies your output into the controller. This is useful for high power bikes so you can have a more gradual throttle gradient, and can additionally bypass the servo-tester circuit by just applying a servo-signal if you're using an RC controller. It could also take cell-log input to drop the power in effect of low voltage alarm, or 3-switch input to universally change the max speed to whatever threshold you want. If the project took off with other people, it could be extended to current-throttling (much of this slack in demand<-->availability has been taken up with the new lovely cycle analyst though. So I'm not as into it anymore.) This custom throttle curve idea has existed before, and was worked on by Zombies before I think he got too involved in other projects (or just stopped updating his prototyping thread.)
 
.
 
This sounds something like the unit Kfong developed. Should be a thread int eh for sale section (new) for it, and maybe a dev thread in ebike technical. Just search Kfong's posts for the ones in the for sale section shoudl find it. Might give you some pointers.
 
Ahhhhhhhhhh...


I'll go check that out tomorrow. Haha. I write these long threads after a couple months waiting/searching to see if anyone else has done it, but then end up finding out after I post it might already exist.


Edit: is very similar. http://endless-sphere.com/forums/viewtopic.php?t=32135
....
 
That happens a lot to me (pretty mcuh every time I have an idea, it's already been done by someone...usually a lot better than I would've done it. :lol:) All sort of stuff in my build threads was already done by others.


I only know about Kfong's unit because i was pondering somethign similar, and then he psoted about his; I didn't even post about my idea (which would've been discretes/analog rather than MCU/software) because his is a much better solution than mine would've been. (I don't even remember much about mine now).
 
Use kfong smart switch, Which I have one and still solid. No losing battery to the controller leeching and Kfong's smart switch capable high ampere (yet tested high amp and I am running 45amp) and cost you bit more by addition mosfets. You might want talk to kfong about this.
 
chroot said:
Use kfong smart switch, Which I have one and still solid. No losing battery to the controller leeching and Kfong's smart switch capable high ampere (yet tested high amp and I am running 45amp) and cost you bit more by addition mosfets. You might want talk to kfong about this.

Hi Chroot,

Yeah, it looks like Kfong's switch is exactly what I was intending, with just a different platform (and I'm unclear how he powers the MCU). But all in all, I'd be basically copying him, with additional current sensing ability and a slightly more available design. So I am unlikely to pursue this as a first priority, because I really dont think I am adding much of anything. I can work on some other projects. Still, this was going to be fun :p. Oi vey.
 
amberwolf said:
I only know about Kfong's unit because i was pondering somethign similar, and then he psoted about his; I didn't even post about my idea (which would've been discretes/analog rather than MCU/software) because his is a much better solution than mine would've been. (I don't even remember much about mine now).
You need to get into MCU/software :). Heh, you know so much about analog; I don't know why you don't do digital sometimes :p.

I guess I'll just refocus on the throttle response MCU bit, and put that together next weekend. Eventually we could interface it with a $10 MPU6050 accelerometer and have your "crash sensing" safety system.
 
I have wanted to do software for a long time...but I am terrible at it. Even in what little coding I *can* do, it's always about six times too big and still doesn't work right. :( I might be the only person that can screw up "hello world". :lol: :oops:


I still would like to come up with that "safety bike computer" system--the CA v3 does a fair bit of things I'd like it to, and Lebowski's controller does bunches of it, Kfong's device does some more, etc. But nothing unifies them all, or does the other bits I'd like to see available. Most here on ES wouldn't use the thing...but if it were available, maybe companies might pick it up and start using it, and make bikes that did more for people that dont' know how to (since I think ebikes should make a lot more people ride bikes that would never otherwise have touched one).
 
Back
Top