The solenoid requires a certain amount of current to generate its magnetic field. If the solenoid was a perfect inductor, the DC current would rise above all means and would most likely damage other circuit components. However, solenoids inherently have a significant amount of DC resistance used to limit the current magnitude.
Provided you place a bypass capacitor (to absorb high-frequency current pulses induced by changing the current magnitude) between GND (close to the mosfet source) and the 12 V connection solenoid, you do not have to worry about a significant overshoot. Your selected mosfet has breakdown voltage of 100 V, which is certainly an overkill.
The mosfet also has a non-zero on-state resistance Rdson (160 mOhm), which will slightly reduce the current through the solenoid. Another implication of Rds is mosfet power dissipation - which is negligible in this case (160 mOhms provided the channel is fully open).
1) Since this is semi-static application (no switching at tens of kHz), you only need to look at these parameters:
- gate voltage threshold (should be lower than you gate supply voltage)
- on-state resistance Rds (to calculate voltage drop and losses)
- allowed current (which is very much correlated to Rds)
2) One problem I see with your circuit is that the gate voltage will be 3.3 V but the MOSFETs gate voltage is specified between 2 and 4 V. In practice, it's fine because even if you get a "bad" part, the MOSFET will still partially close and allow current current to flow through its channel. An implication of low gate voltage is that the switch will work in the linear mode, where its on-state resistance is much higher than the guaranteed value.
EDIT The gate threshold voltage is the minimum voltage where the MOSFET starts conducting current; however, the channel current would most likely not be enough to turn on the solenoid. Look at Figure 1 in datasheet, which correlates gate voltage with drain current and drain-source voltage.
You could easily use this part :: FDN327N. The gate voltage is specified at 1.8 V and allowed average drain current is 2 amperes.
The value of R1 depends on:
- allowed source peak current - some PWM gate drivers can well support 30 A peak, which (with 10 Ohm gate resistor - R1) very quickly charges the gate and thus minimizes time spent in the linear mode.
- desired dv/dt, which significantly affect radiated and conducted emissions
- gate threshold voltage
I assume you drive the gate from an MCU pin - look at the datasheet on allowed pin current. That current is, however, the average current so you can drive much more on a peak basis. I would guess that 50 mA is fine -> 3.3V / 50 mA ~= 70 Ohms would be a good value for this application.
For these kinds of things, I personally like to simulate the circuits. This not only gives you the values, it also makes it possible to play with the circuit to learn more about how it behaves. And an inductor and a capacitor in one circuit always smells like oscillation so calculations don't always turn out as simple as one might think. Also the actual form of the current pulse through the solenoid will be intresting to estimate how it would physically behave (we don't know anything about what is attached to it).
My simulator of choice is mostly LTspice IV since it is free for personal use. Lets start with a slightly modified version of your circuit:
SW1
and SW2
are voltage controlled switches which are controlled by source V2
and B1
, whereas V2
is a pulse (0V to 10V 200ms on, 400ms cycle, 1ns rise/fall time). B1
is the opposite of it, so SW1
and SW2
have are always open when the other is closed.
Lets first concentrace on the pulse, for that we set R1
to a reasonably low value (10Ohm in this case) and give C1
the special value {C1}
. To get a bit more realistic I usually give it some value (e.g. 4k7u) and then select a capacitor from the list that roughly matches on I would use to get a useful ESR. You can also just enter one like 60m Ohm or so. Then we add the SPICE Directive (.op
toolbar button) .step param C1 100u 10000u 100u
and start the simulation (simulating one second here). The resulting current through the solenoid (90mH, 6Ohm) is:
Right click on the graph, chose "Select Steps" to see what curve fits to what capacitor value.
You see that the current is of course not a square wave, so arbitrarily assuming everything above 800mA is considered part of the wanted pulse, looking at the blue one it is roughly 20ms there, so a useful value there would be 7100uF. But depending on what the solenoid should do, this may or may not be the pulse you are after.
Now we have a value to play with, so we can either replace the {C1}
by that value, or if we want to later play with it again, we can comment out the .step
directive by prefixing it with a ;
and then lets add the line .param C1 7100u
to the same directive (right click to edit).
Now lets add another directive .step param R1 1 10 1
to the circuit and change the value of R1 to {R1}
. Then run the simulation again and additionally look at the current through R1 now:
Due to the way we set up the simulation (that is, we have a fixed cap loading time before we switch over) you can see that at the point we do the switch, there is for each resistor value a different current flowing, which is equivalent to a different load of the capacitor, which you can see influences the pulse on the solenoid. You can change the pulse on V2
to e.g. PULSE(0 10 100ms 1ns 1ns 400ms 600ms)
to simulate a longer loading time, which then will have almost no influence on the solenoid pulse. To satisfy your "at most a couple of seconds" requirement, the 10 Ohm will sufficiently load the wanted capacitor within half a second at a peak current of ~810mA so you can probably even go a bit higher. Of course this changes when you chose a different cap.
Note that you can have at most three .step
directives active at once, giving you the ability to play with a lot of value combinations, at the cost of an almost unusably crowded graph window. Sometimes using .step param list
will help here to chose some better values.
Best Answer
A capacitor like that is typically used to provide power for short-term current spikes in the circuit is is directly connected to.
A typical application that needs these type of capacitors (called bypass or filter capacitors) are digital integrated circuits that need a extremely short spike of power every time the state change, but are very low power as long as the state is steady. This spike is caused by internal parasitic capacitances that need to get quickly charged to a different voltage. The inductance of the connection to the power supply might be too high for the power supply to deliver the required current spike, so a capacitor is connected close to the circuit causing the spikes, so that the connection to it has less inductance.
Another use of capacitor for DC is a filter capacitor after an rectifier, to have voltage available even when the AC input is just crossing zero. In that case, I would consider the capacitor part of the power supply, not of the supplied circuit.
In your application, the load is dominated by the coil of the solenoid, which can be modelled as a series circuit of an inductor and a resistor. At turn-on time of the transistor, the inductive behaviour of the coil is dominant, causing a slow rise of the current, and afterwards the pure DC resistance of the coil determines the current, which needs to be constantly supplied while the solenoid is turned on. Neither during turn-on nor in the steady state, a short current spike is consumed, so the capacitor is pointless. Also your LiPo battery does not need a capacitor to deal with zero crossings, as it is a DC source.
Side note: A different situation occurs on AC solenoids with a significant movement of the core: The inductance of an AC solenoid with the core pulled in is significantly higher than at turn-on time. As AC current is determined by the impedance, which might be dominated by the inductance of the solenoid coil, the AC current during pulling can be many times higher than the current in steady active state, up to the destruction of an AC solenoid (due to continuous over-current) if the mechanical movement does not occur, because it is blocked. Of course, an electrolytic cap can not be used to catch the current spike of an AC circuit.