Solenoid driver circuit for player piano- controlled by PWM

Thread Starter

john smith_1510419217

Joined Nov 11, 2017
10
Hi,

I'm trying to build a one-note prototype (as proof of concept) for a player piano using a solenoid and an Arduino to play a key, using PWM. The solenoid will be energized at higher voltage initially compared to the nominal voltage to provide a stronger initial force, then will be held at lower duty cycle e.g. 1/10s later until midi off signal is received.

The solenoid to be used, which will be characterised (voltage/stroke) in a separate experiment as it is a Chinese solenoid with no data sheet, is 24VDC, 400mA, 10mm stroke and 45N holding force (research suggests for a piano 50N is max suitable).


My question is regarding the circuit design of the solenoid driver circuit.

Would you suggest I use a live solenoid(common emitter) set up, where the solenoid is connected to the live +50V supply and then the transistor as the switch?
or use a dead solenoid set up, where the transistor is connected to the live part and then the solenoid.
Also, would a mosfet be more appropriate in this case?

The safety mechanisms have been considered, in terms of current limiting and pull-down resistors and diodes. A watchdog timer will also be implemented.

Finally, for the power supply, any ideas for a cheap 50V supply? (aim is to keep costs down)

Any help would be much appreciated as this is quite a vital part of the project and I'm learning as I'm doing the project (mechanical engineer student here).
Thanks :)
 
Last edited:

philba

Joined Aug 17, 2017
959
I'm not sure what you mean by live part of a solenoid. Perhaps you are referring to low vs high side drivers? Could you provide a circuit drawing? Google-jitsu didn't help illuminate me on "live solenoid".

Also, why use 50V to drive a 24V relay? 50 is kind of non-standard. 48V supplies are more common. Though, I still don't understand the need to drive the solenoid with >2X it's spec'd voltage.

In general, for that kind of current, using a MOSFET would be my approach.
 
Last edited:

MaxHeadRoom

Joined Jul 18, 2013
28,477
A higher voltage is normal with an inductive device when using PWM for control, but my question is why/how do you intend to control a solenoid with PWM?
Max.
 

crutschow

Joined Mar 14, 2008
33,965
It's easier to connect the solenoid to the plus supply and switch the ground side of the solenoid, since that only requires one transistor.
An N-MOSFET works well for that purpose.
It should have a 100V rating, with an on-resistance less than an ohm.
A logic-level type (max Vgson of 2V) can be driven with a 5V logic signal directly.
Do you know what PWM frequency you will be using?

You will need a diode across the solenoid to suppress inductive spikes (cathode to plus supply) and carry the PWM current.
A 1N4002 will work for that.

Don't have any suggestions for a specific power supply.
You might check Ebay.
 

Thread Starter

john smith_1510419217

Joined Nov 11, 2017
10
I would assume he momentarily energizes the solenoid with the full 50V, and then goes to a low duty-cycle PWM to maintain the pull-in at a low value (he stated 1/10th) of the rated current.
Yeah, the aim is to energize the solenoid at a higher voltage depending on the midi signal velocity value (i.e. for a loud note, 50N are needed, for soft note 10N are needed etc.) These will correspond to duty cycle coded in from converting the midi signals in arduino. After the initial hit, to hold the note, a lower duty-cycle PWM.

For the PWM frequency, I was thinking of using something like 25kHz to avoid the audible frequency region.

Thanks for the help everyone :)
 

Thread Starter

john smith_1510419217

Joined Nov 11, 2017
10
So you are intending to vary the stroke of the solenoid?
Max.
The stroke will be the depth of the key, which is around 9-10mm, so the plan is to have the first few mm have a stronger initial force and then level off at a lower duty cycle for the rest of the stroke. Is that what you mean?

I am testing the solenoids and characterising them so that I have a voltage/stroke graph meaning I'll have a better idea of what pwm i need to use as well.
 

crutschow

Joined Mar 14, 2008
33,965
How would i account for the arduino drawing too much current?
Is the Arduino drawing too much current? If so, how much?

The only current to drive the MOSFET is that required to charge the MOSFET gate capacitance. The gate itself draws no DC current (it looks like a capacitor).
With PWM there is an average current gate drawn to charge and discharge the gate capacitance. You can minimize that by buying MOSFETs with low gate capacitance/charge.
 

Thread Starter

john smith_1510419217

Joined Nov 11, 2017
10
Is the Arduino drawing too much current? If so, how much?

The only current to drive the MOSFET is that required to charge the MOSFET gate capacitance. The gate itself draws no DC current (it looks like a capacitor).
With PWM there is an average current gate drawn to charge and discharge the gate capacitance. You can minimize that by buying MOSFETs with low gate capacitance/charge.
I was thinking more of a safety mechanism, in case the arduino drew too much current which would fry the pins. The concern came from being connected to the high voltage power supply. However, I didn't really know how much of a consideration that should be.

so with the gate capacitance, it would affect the speed at which it was switched on an off? so the frequency of PWM has to be considered carefully?
 

crutschow

Joined Mar 14, 2008
33,965
I was thinking more of a safety mechanism, in case the arduino drew too much current which would fry the pins. The concern came from being connected to the high voltage power supply.
Only the MOSFET drain sees the high voltage and that has no effect on the gate current.
so with the gate capacitance, it would affect the speed at which it was switched on an off? so the frequency of PWM has to be considered carefully?
Yes, you generally want a PWM frequency no higher than required.
For your application, you probably want it just high enough to be inaudible.

You also want to buy a MOSFET with as low a gate capacitance as you can find that still has a sufficiently low on-resistance to carry the solenoid current without significant dissipation.
That makes the gate easier to drive at the desired PWM frequency, and reduces switching losses.
 

Thread Starter

john smith_1510419217

Joined Nov 11, 2017
10
Only the MOSFET drain sees the high voltage and that has no effect on the gate current.
Yes, you generally want a PWM frequency no higher than required.
For your application, you probably want it just high enough to be inaudible.

You also want to buy a MOSFET with as low a gate capacitance as you can find that still has a sufficiently low on-resistance to carry the solenoid current without significant dissipation.
That makes the gate easier to drive at the desired PWM frequency, and reduces switching losses.
Thank you for the clarification!
Yeah I was thinking of using 25kHz but it seems 31372.55Hz is easier to code into the arduino.
In the data sheets would I be looking at the total gate charge? or is it better to infer from the input gate capacitance?
 
Top