PWM Controlled Current Source to drive 24V Proportional Solenoid Valve using Arduino

I would like to implement a PWM controlled current source to drive 24V proportional solenoid valve using Arduino. What I need are the following:

  1. Input will be 5V PWM with 5000Hz frequency, duty cycle will increase the load current proportionally.
  2. The solenoids I need to use have internal resistances varying between 10-25 ohms.
  3. My maximum load current should be 2.5A, which means at %100 duty cycle (5V) the load current should be 2.5A for any solenoid I am driving (if it can draw it), so no matter the load resistance.
  4. My switch has to be at high-side, thus the load should be at low-side.

I have tried a couple both high-side and low-side constant current source circuits but none of them was successful, in other words, the load current was changing with load resistance. I guess what I need to do is to implement one of the circuits below, read load current on shunt resistor from another pin, and change my PWM output accordingly to keep the load current the same for ANY solenoid I use as my load. And I guess it has to be fast. But in the circuits below, I do not know what to do with the output of the opamp. What I thought about that was to create a gain such that the opamp outputs 5V at 2.5A on shunt resistor (Rsense) and compare it with my PWM output and change PWM, but no success so far. Guess if that is the way, I need help with its software, or of course I am open to other ideas. Also the switch I will use is a logic controlled high-side driver such as BTS462 (Infineon Smart High-Side Power Switch). I would appreciate any help, thank you already.

image

Why do you want the current to be the same which ever valve is fitted ?

Why not just control the voltage via FET to drive the solenoid .

A current source using pwm , driving an inductive load is a difficult task as the inductance resists the build up of current - so you’ll get a ramping current on each pwm “ pulse” - if you try with the Arduino synchronising measuring current at the same time as the pwm pulse is difficult , and as said as the waveform of current won’t be “rectangular” , what do you measure ?

There is no way around unless you adjust the voltage according to the resistance change.

You can use an opamp (comparator) comparing the shunt voltage with a set voltage to generate a free running PWM with current control. This principle is frequently used to implement a current limit in a H-bridge.

I think "if it can draw it" is opposite of "no matter the load resistance". What do you mean by this?

Hi, @norbel
Welcome to the forum.

Can you please post a link to specs/data of the proportional valve?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Welcome norbel! I would suggest you spend some time studying Ohm's law, you can find a calculator at: Ohms Law Calculator. You state: "My maximum load current should be 2.5A, which means at %100 duty cycle (5V) the load current should be 2.5A for any solenoid I am driving (if it can draw it), so no matter the load resistance. To maintain a constant current regardless of the load is next to impossible. How much voltage are you willing to pump into the solenoid. At 5 Volts you need the coil to be 2 Ohm. If the coil resistance goes to 5 Ohms you will only get 1A with 5V,. you will need 12.5V to get your 2.5 amps.

Hello hammy, thanks for the reply. I have been driving solenoid with a logic controlled high-side driver by just giving the PWM to its enable pin (or NMOS gate) just as you suggested, but this is a different application I require

will try that, thank you

thank you for your reply, yes I know what Ohm's law is, that's why I think I need to change my PWM accordingly by sensing current from shunt resistor

Sorry but this is still not clear. - as I said you will struggle to measure and control current with pwm as you describe- coil inductance is against you!!
You can change the valve opening by changing the voltage to it ( with pwm) .If you change the valve even to One of the same type it probably won’t open to the same position for the same “current” anyway - so controlling current seems pointless.

So it’s better to explain the project a bit more if you still need help

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.