MOSFET switchover for E-Bike controller

Status
Not open for further replies.

deepak4you

Member level 1
Joined
Apr 7, 2015
Messages
34
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
423
Calling out for help to you kind experts.

I'm working on a prototype of an Electric Bike. I am trying to use regenerative energy from the electric motor during freewheeling, to charge back the battery. I want this to be semi-automated and hence I'm trying to use high power MOSFET switches to smoothly switch between charge and discharge configurations. Below is the scenario and problem statement. Check the diagram for reference

What I have:
1. 1000W E-bike controller with throttle
2. 48V Lead Acid battery
3. Buck/Boost regulator (currently set to 54V)



How things work:
When battery is connected to controller and throttle is engaged, the controller draws power from the battery and powers the motor
When I don't engage the throttle and the vehicle is still moving, there's "regenerative" voltage at the same terminals of the controller that are connected to the battery. This regenerative voltages varies with speed.

What I wish to achieve:
1. When I engage the throttle, power should be drawn from the battery and supplied to the controller
2. When I don't engage the throttle and the vehicle is still moving, the output of the controller should get connected to the input of the buck/boost regulator. Output of the booster connects to the battery so that battery can be charged

The switch S1 will enable me to switch between charge and discharge (ofcourse that can also be automated, but that's the easy part for me). The diode on the charging leg side is added to ensure current flows only in one direction to the battery.

I managed to get a circuit fixed and refined with help of some experts like you and I built that circuit as well, but it doesn't seem to work as expected. Below is what is happening while testing with a simple LED load:

1. When I test both MOSFET switches individually without the common D and S connection, both switches work just fine. The ON and OFF switching is immediate
2. With both MOSFETs combined with a common D and S connection as shown in the figure, the appropriate MOSFET/LED turns ON after supplying gate voltage but it stays turned ON. This is happening with both MOSFETs.

I see that the LED is dimming very slowly implying that the voltage at the gate seems to be held up by a capacitor. Probably the internal capacitance combined with the gate pull down resistor? I'm currently using a 13k pull-down resistor on the gate. I could use a 1k resistor, but if the gate capacitance is what is holding up the charge and leaving the MOSFET ON for longer is indeed the reason, then a 1k resistor would still leave the MOSFET ON for lot longer. I need an immediate switch (couple hundred microseconds) of the MOSFETs.

Can someone help me understand and troubleshoot this circuit? Might be using a simulation tool could help, which I don't have one I have broken my head a lot on this circuit and am desperate to get this to work. So any help on this would be truly and greatly appreciated.

Regards,
Deepak
 

Hi,

A Mosfet is controlled by the gate voltage referenced to source.
Thus is why they call it V_GS = voltage between gate and source.

But your circuit seems to reference the gate voltage to GND. This is wrong.

Klaus
 
Reactions: d123

    d123

    Points: 2
    Helpful Answer Positive Rating
Hi

Hi,

A Mosfet is controlled by the gate voltage referenced to source.
Thus is why they call it V_GS = voltage between gate and source.

But your circuit seems to reference the gate voltage to GND. This is wrong.

Klaus

Do you mean that the MOSFETs are floating in different places with regard to the gate/VGS is never VDS/they are seeing changing VDSs?

- - - Updated - - -

...because I've been puzzling as to how to simulate the idea in a meaningful way, and looking at the best I've come up with so far, I doubt that is a meaningful but quick to put together interpretation... Sad isn't it...? All the same, if this bears some similarity to the actual circuit functioning, it makes me ask what is happening at the source of U2? It's always at 10V on either side (drain and source) and half the time the gate voltage is at 10V and the other half at 0V.

What happens when the drain of U2 in the real circuit sees the 54V from the converter but its source sees some unquantified and random voltage from the motor back emf I guess it is?

 
@KlausST - you mean to say that effectively since the source is floating, hence it is wrong?

@d123 - thanks for your efforts! Output at V5 is what I am seeing now. I'm thinking if a P-channel and N-channel combination might work instead of both N-channel MOSFETS.
 

I changed the ckt to use one N-channel and one P-channel MOSFET, but I still don't think this will work. Look at S2. This part has to be isolated during the charge (green) cycle. So effectively we land up with the same issue. I could use a high power BJT in place of S2 is it works that way, but using a BJT of that rating will itself waste a lot of energy/current for self bias (base current), hence not very efficient.

Couldn't imagine building a switching circuit would be so difficult

 

Hi,

Your gate signal seems to be 0V / 12V.

In OFF state the source voltage is undefined somehow.
Or is there something hidden in the boxes that defines the source voltage?

The gate resistor goes to GND. But without a known source voltage this won't safely switch OFF the Mosfet.
Depending on source voltage
* it may switch OFF the Mosfet. If: V_gate - V_source << V_gs_th
* it may switch ON the Mosfet. If: V_gate - V_source >> V_gs_th
* it may switch the Mosfet into linear region (resistive). If: V_gate - V_source is about V_gs_th
* it may kill the Mosfet. If: V_gate - V_source is beyond the allowed range (often +/-20V)

To safely switch OFF the Mosfet: the gate resistor must be disconnected from GND and connected to Source instead.
To safely switch ON the Mosfet (let's say V_gs = 12V). V_gate needs to follow V_source + 12V.
Example:
* if V_source = 0V, then V_gate needs to be 0V, for the Mosfet to be OFF
* if V_source = 0V, then V_gate needs to be 12V, for the Mosfet to be ON
* if V_source = 48V, then V_gate needs to be 48V, for the Mosfet to be OFF
* if V_source = 48V, then V_gate needs to be 60V, for the Mosfet to be ON

This is how the Mosfet_gate_driver_ICs work.
Many gate drivers generate the 60V (= 12V above supply voltage) with the use of a bootstrap circuit. The drawback is, that it can't work with DC = 100% duty cycle. It needs periodicly switched OFF for the bootstrap circuit to charge.

Klaus
 
Thanks @KlausST. The controller is basically a PWM controller for the BLDC motor of the e-bike along with some other electronics inside. I don't think there's anything special in there that would make the magic happen.

Can't use a simple relay here because the DC current drain is so high that the contacts don't last long.
 

Hi,

there are many relays. With a huge range of current rating. I´m sure there are many relays for your current rating.

Klaus
 

Could I not possibly replace the discharge side MOSFET with an IGBT? Or possibly both MOSFETs with an IGBT? Would that not do the trick?
 

Hi,

No. No trick. You can´t choose the voltage reference on your own. It´s given by the device (datasheet)

No discrete semiconductor device´s control voltage is wrt GND ... simply because the device does not know what GND potential is, it has no GND pin.

--> MOSFET gate control voltage is wrt SOURCE
--> IGBT gate control voltage is wrt EMITTER
--> BJT base control voltage is wrt EMITTER

****
Mind:
A logic IC has a GND pin. And all inputs refer to exactely this GND potential.

All datasheets tell which signal is referenced to which signal.

Klaus
 
Looks like physical isolation/switching is the only way out
 

Hi,

I did another version with PMOS, which is also an interpretation so remote from your actual circuit as to be useless but may be of use for other ideas/parts of what you're doing.

It does seem so about using isolation, I can't make this circuit work with floating and reverse voltages... The closest I got was a rough emulation of the motor and a very rough emulation of the battery; notice how the so-called battery (right-hand side R1 + C3) is connected to ground, not to the battery input - I haven't been able to think of a way to emulate a rechargeable battery, I'm afraid. In no way do I think the below circuit is an actual representation of what you are doing or even that similar in function in some senses. Just hope anything in the schematic may be of use to you.

 

Hi

Big

There was an outbreak of unnecessary components in the previous schematic...

This subsequent version is still far from ideal in some senses, besides being nothing like the original premise - I doubt your load is 100k to say the least, it was chosen to show the supposed battery charging principle drawn from the motor back emf in under 3 seconds (but parts of the circuit might serve an [improbable and obscure] purpose, so long as several more components are added to fit and can be made to fit with your design).

Were this to be my submission for an IEEE paper (joke), we could call it "a novel voltage transfer device that does nothing practical and wastes energy fruitlessly". So long as you put the word "novel" in there, it'll be published, from the titles I see (joke).

I was just correcting the previous embarrassing version for this embarrassing version to save face.



If you want to choose a simulation program, there are many free ones. For this circuit, I'd start by looking for one preferably specific to whoever manufactures your Buck IC or the controller IC, and that's not meant cynically, just matter-of-fact: if you need to ask questions on their support forums, I'd assume you'll get a more directed answer - unless it's a general circuit question, then most forums should be able to help or try to, like here. In theory, most models are Spice-compatible. I like TINA-TI (free version), it seems very easy to get up and running and seems to give realistic results, it has its annoying things but what doesn't; a lot of people use Spice variants such as LTSpice. There are lots of other simulation tools I see people use on this forum. I really do recommend using a simulator for some things, you can assess how worthwhile making a circuit is before wasting parts or see avoidable mistakes based on erroneous reasoning in a design, for example.

Sorry I haven't been able to be of more useful help.
 

Thanks a ton @d123 for your efforts. I've already started looking for high current DC relays. I'll also continue to see if anything from your schematic can help me get what I'm looking for. Thanks again.

MODERATOR ACTION: Useless texts are removed
 
Last edited by a moderator:

Hi,

Hope you're able to find suitable relays, look forward to seeing the result. I just had a quick play with bits of your circuit using relays and I think I want to stop thinking about/puzzling over it for today... It seems a difficult circuit to put together but I'm sure you'll succeed.

Is the motor current draw 20A at steady state?

Also, where does that 12V come from, is it tapped off the 48V battery or is it a separate battery?

How exactly do you plan to power the controller IC? I found the first simplified schematic ambiguous in this respect. What does that + sign refer to, power supply or motor/battery power paths?

I guess you know to put a flyback diode or RC snubber around the relay coil contacts; and that where feasible (perhaps not looking at the current draw, and worse, the current spikes from the motor), an 100nF capacitor across motor terminals is a standard practice.

How does that controller decide what to do regarding passing voltage to the motor and then feeding the back emf to the battery, is it - on the analog level of the IC - comparator-based?

Thanks.
 

The motor is rated 1000W, so the current draw is anywhere between 18-22 Amps DC depending on battery voltage.

12V is coming from the existing petrol bike on which i'm adding the e-bike motor

The controller is basically an e-bike motor controller, so its a box that does PWM and few other things. This controller takes in 48V DC from the battery, and supplies 3 phase PWM and phase control to the motor. I don't know the internals, but when I don't supply voltage to the motor, then I see DC voltage at the battery terminals, equivalent to the battery voltages, varying ofcourse with speed. This is the reason why I wanted to tap that voltage while freewheeling of the vehicle and charge the battery.

Diode across the relay is the least of my problems, hence never gave much heed to it in my schematic

I'm still thinking that in the second diagram that I shared, in place of S2, we could have a combination of components that could provide a "0" and "+" voltage levels dynamically (through some triggers) depending on whether a MOSFET has to be switched ON or OFF. I've never had industry experience in analog and power electronics, so my skills are very limited and academic here. But I'll continue to think over it. This should be doable.

- - - Updated - - -

Ok, so getting into my head firm and strong that MOSFET switches with defined voltages across Gate and Source, I added another P channel MOSFET where source is connected to the battery. The gate of M3 is operated via relay contacts to switch between VDD and GND. That way we have a defined voltage there. Attached is the updated circuit. Please excuse and pardon me if this schematic also turns out to be a no-goer. Just trying my best to get this to work without relays

So during discharge cycle, M1 and M3 are ON, M2 is OFF. During charge cycle, M1 and M3 are OFF, M2 is ON. Although to me it leaves M1 redundant since it is on the ground leg anyway, but not sure and again limited by lack of simulation. I'll get on to some simulation tools in the meanwhile.

 
Reactions: d123

    d123

    Points: 2
    Helpful Answer Positive Rating
Hi,

Thanks for answers and description.

Still curious, is the controller powered via M3 or that + sign is just the motor power path? Just the motor, I assume, for obvious reasons.

I have stuff to do today but when I'm able to later, I'll have a look - if/once I can figure out how to do something reasonably similar in the simulation tool.
 

Ohh yes, sorry. Forgot to answer that. The + is the connection polarity, indicating that it has to be connected to the + of battery. AND, while freewheeling, the voltage that comes out of the same terminals are also as per the same polarity. Hope I explained it clear enough without confusing.

Also continuing to think on the last ckt, M1 will have to be removed. M1 will be ON and conducting during discharge, but it will be OFF during charge and not-conducting. Which means my charge path will not be closed.

You've been really kind to help me out with the simulation @d123. Thanks a ton. I'll also quickly put a ckt together and see if it works.
 

Hi,

Thanks, it's an interesting project and I wish you well with it.

Looking at the simplified schematic in post #16, I think you'll need to put a diode after M3, cathode (the grey stripe) facing the controller + in/out pin (I've understood that it is a single bidirectional pin), otherwise the body diode may conduct in the direction that isn't required during charging.

Also, what voltages are we going to see at the source of M2, either 48V or whatever the freewheeling voltage is? I'm not sure but I think adding a large resistor to ground in parallel with the Buck/Boost converter will provide a definite and unchanging reference to ground that may or may not be a pointless addition.

Also, I think I understand that the MOSFETs will be driven from a 12V signal? That's not going to work with PMOS whose source with reference to ground is 48V, it'll maybe work with an NMOS that is - according to the datasheet - fully on at ~12V and fully off at ~0V; the PMOS will see, I think, AFAIK, (at +12V) -36V or (at 0V) -48V, so it'll be fully on all the time and the VGSmax. will have been surpassed by -16V and -28V ...Ouch, smell the blue smoke! You'd need to protect the gates with an e.g. 15V to 18V Zener diode, have fun (I abhor Zener diodes, very messy devices regarding turn-on and relatively wasteful with current, 'though with 20A kicking around I suppose a few mA is nothing to care about...).

To be honest, unless this is some secret project for whatever valid reason, either detailing what the controller IC does during the charge and discharge periods or detailing if that really is one single in/out pin at least, or better yet posting the name of the controller IC or link to the board might be helpful and get a more experienced member enthused about beginning to attempt suggesting a realistic solution or troubleshooting the schematics posted so far. As is, any solutions offered are blind guesswork peering into a nameless "black box" (with one presumably bidirectional in/out pin) that only has a plus sign and a ground connection...

I may be wrong about any and all of this but I don't think so that much.

- - - Updated - - -

Hi,

Quick check confirms what I thought about 0-12V VGS (or -36V to -48V, easier to understand, hopefully) and as a consequence, the PMOS all being on all the time... Did a simulation with the schematic in post #13 but set V1 as 48V and added V2 (12V) to power the logic gates to drive the PMOS gates. I personally feel this is a hard circuit to do but well worth the learning curve and every problem has a solution, they say.

 
The issue with body diode of M3 is something that I was already worried about. I think I'll remove the diode from the Charge path and put it before M3 Source pin. That should ensure that reverse/freewheeling current doesn't enter the battery through the discharge path?

For the controller, I really don't know much about it. Below is the image of the same, if that is of any remotest help!



For the M2 gate bias, I suspected we might have the same issue. We get stuck with the same issue as with the N Channel ckt. I'm wondering if I should simply use the relay contacts on the charge leg. The current won't go beyond 8-10A, and that too is adjustable. The contacts won't burn out since, as I understand, all buck-boost converters have an in-rush current protection. So P-channel MOSFET in the discharge leg, and simple relay contact on the charge leg.

- - - Updated - - -

Or, I could use another small current boost converter to raise 12V to 60V and use that to drive the gate of M2?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…