Determining the number of turns for a solenoid

I am trying to determine the number of turns that is required in a solenoid to cause it to move an armature inside. From what I understand the greater the B the more force that it can produce on the armature.

To increase B I know that I can increase the number of turns to do this, but this is where I am finding problems, if I increase the number of turns this will result in an increase in inductance (L) and if the inductance of the coil increases, my PWM will be affected (will it not?) because it will resist changes in current when I apply the PWM, but if I reduce L then my B is affected. So how do I choose the best number of turns?

Increasing inductance will affect the solenoid if you are feeding it PWM, but not necessarily in a bad way. PWM works precisely because the inductance averages the applied voltage. For the time that your PWM switch is on, current increases, but at a rate limited by the inductance. When the PWM switch is off, current decreases, but again at a limited rate.

The result of this is that the current (and thus the magnetic flux and force) approximates a steady value that would have resulted had you applied a fraction of the supply voltage according to the PWM duty cycle. For example, if the supply voltage is 12V, and you drive it with a 60% duty cycle, the current you get is essentially the same as you would get by applying a constant $12V \cdot 0.6 = 7.2V$ to the solenoid.

Increasing the inductance makes this average better, further reducing the ripple in the current between PWM cycles, or alternately, allows you to use a slower PWM frequency for the same current ripple.

Increasing the inductance also limits the rate of change of current, and thus force. However, it's quite difficult to make the inductance so high that this becomes significant in most applications. If you weren't worrying about it yet, I wouldn't start now.

The bigger problem with adding more turns is usually that the DC resistance of the solenoid also increases. Since the resistance converts electrical energy to heat but doesn't help you create mechanical force, less resistance means higher efficiency. However, more turns allows you to generate more flux with less current. Since resistive losses are given by $P = I^2 R$, reducing the current can reduce resistive losses more than reducing the resistance. Yet, more turns also means the induced EMF from the movement of the solenoid will be higher, which requires that you can supply a higher voltage to overcome that EMF to accelerate the mechanical load.

So, you are faced with many trade-offs. In the end, it comes down to optimizing the parameters that are important for your application. Adding more turns isn't good or bad, it's a trade-off. I'd suggest experimenting.

It's the DC current that flows that is important for solenoids and the average value of your PWM is the DC value - inductance has no part to play on the DC currents (average PWM value).

Go for as many turns as you can fit in the space and as tightly wound as you can for biggest value of flux. You'll need to also consider the wire's thickness and current carrying capabilities - you don't want it to burn.

• thanks for your answer but i was just wondering in my case i forgot to mention that in OP that I need the solenoid to switch polarity so the armature has to move left and right , what will happen in this case because then I have to consider the inductance right because it is going to impede any changes in current .
– subz
Aug 2, 2013 at 13:15
• @subz Yes, if you are wanting to alternate the current then inductance plays an important role and the magnetic energy acquired in one direction must be removed before you can reverse the voltage or you'll have a big back-emf spike of voltage that could damage semiconductors and even relays. If your current is 2A and the coil is 1H, then the energy stored is $\frac{I^2L}{2} = 2joules$. To remove this energy in (say ) 10ms requires something that can dissipate $\frac{2}{0.01} = 200W.$ If this happens 10 x second then the power averages out to 20W. Aug 2, 2013 at 14:14
• lets say that i add a spring to the system connected to the armature so current is applied and spring is compressed . Then when the current is turned off will the induced voltage and energy stored in field not cancel out ? induced voltage from the spring decompressing or stretching. Thanks :)
– subz
Aug 3, 2013 at 7:12
• @subz I think this will appear to store more energy in the coil. But at least you have an automatic release/return mechanism. Try it and good luck dude and don't forget the reverse biased diode across the coil. Try it in series with ten ohm .- the kick back voltage will be higher (current x resistance) but if your transistor is rated on breakdown voltage accordingly it will work quicker at turning off. Aug 3, 2013 at 16:15