need help to control this

madmurg

Feb 7, 2012
10
Joined
Feb 7, 2012
Messages
10
I want to use pwm from an arduino to control this
http://uk.farnell.com/jsp/search/productdetail.jsp?SKU=1936419
It is a solid state relay with proportional control and needs 2-10v to operate.
I need a circuit design to convert the 0-5v pwm to 2-10v analogue. I have tried using a transistor and a low pass filter on the pwm which gives the correct outputs on the relay but it does not work.
would using an opamp be better. any circuit ideas would be appreciated.
 
Last edited:

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Perhaps you have connected the control the wrong way round.
Perhaps there is interference getting from the mains to the computer.

As always, split the problem into separate parts and get each part working. Forget the computer to start with and control the SSR with a battery. Does that work?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Your circuit will allow the voltage across the device to vary, but it may be over a smaller range of PWM values than 0% to 100%. It may also not be linear.

Is that a problem?

But you say it's not working at all...

Have you measured the voltage across the relay as you vary the PWM mark/space ratio?

The specs don't seem to say, but is it safe to put close to 12V across this device? (I would expect it to be OK, but you never can tell...)
 

madmurg

Feb 7, 2012
10
Joined
Feb 7, 2012
Messages
10
sorry my schematic has a typo the power supply is 10v and the voltage at the terminals is correct ie if I do analoguewrite 255 to the output of my arduino i get 10v at the connections if I write 130 to the pin I get 5v at the terminals etc. this is only if I take out the capacitor. If I put in the capacitor I get 10v at the terminals all the time.
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
I would think that the circuit is responding to the peak of the PWM signal. Try disconnecting the transistor from the capacitor and see if the voltage across the capacitor can be raised and lowered.

If it can be, re-connect the transistor with a 10k resistor.

Note that you are driving the SSR with a current source and not voltage source so a small current may give full output. One bodge way of overcoming this would be to put a resistor across the SSR to develop a voltage from the current supplied by the transistor.
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
I have increased the capacitor to smooth the input a bit more. The base current is controlled by the 10k resistor. The amplified current is fed across the 100R resistor to develop up to 10V. I have used the spare 47uF cap to smooth the supply a bit more.

If you cannot get 10V across the SSR, then increase the 100R resistor.

Test without the mains connected so that you are not zapped.
 

Attachments

  • SSrelay.png
    SSrelay.png
    4.5 KB · Views: 143

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
The problem you have is that the capacitor gets a voltage on it that is roughly related to the PWM mark/space ratio, but what happens from there can get very screwy very quickly.

Before the voltage on the capacitor gets to 0.7V, nothing happens -- there is a "dead" zone.

Now, let's look at the load. I'll assume it is a LED with a Vf of 1.7V and a series resistor of around 825 ohms (to get a current of 4 mA at 5V as per the specs)

At 2V, the current will be about 0.4mA, and at 10V it will be around 10mA.

So, as voltage across the capacitor rises, the base current increases. The transistor amplifies this current, and at some point it gets to about 0.4mA -- the current required to have 2V across the load. If we assume a current gain of 200, the voltage across the capacitor at this point is 0.7 + (0.0004*10000)/200 = 0.02V -- so the threshold for action is 14.5% duty cycle.

As the duty cycle increases further, the current available to the base increases, until the collector current reaches 10mA. This will be at 0.7 + (0.01*10000)/200 = 1.2V which is 24% duty cycle.

So all your control is in a small range of duty cycles, say around 10%. This range will vary in size depending on the transistor and temperature, the actual current drawn by the load, and certain other factors (the non-linearity as the transistor approaches saturation has not been considered earlier).

A better approach is to either employ a level converter to alter the output of the PIC from 0-5V to 0-10V and then integrate this, or to employ an amplifier with a gain of 2 to transfer the voltage across the capacitor to the load. (A more fancy approach is to have a gain of 1.6 and an offset voltage on the output of 2V)

In the former case, you could employ a circuit like this to change the level:

3752d1330317340-igbt-ignition-coil-driver-driver2.jpg


(That was prepared for another use, so please ignore the 12V rail)

This will produce a near 12V swing from the PIC output, and will drive significant current. It is shown here driving a mosfet, but imagine that is a capacitor.

The resistor in series with the capacitor needs to allow a current that is large enough so that the current drawn by the load (it will be placed across the capacitor) does not load the circuit too much. I would suggest a value of around 68 ohms. This will limit the max voltage across the load to under 10V, so maybe you need a higher supply rail... Then you need a capacitor large enough that the ripple will be low.

Large currents mean it's not the best solution.

The op-amp solution is better:

attachment.php


For this you require an op amp with an input common mode range which includes the negative supply rail, and which can swing the outputs to the supply rails (or very close to the +ve one)

If you want to bias the output so you get a 2V to 10V output for a 0 to 100% mark/space ratio (essentially 0V to 5V input), look here.
 

Attachments

  • x2 integrator.png
    x2 integrator.png
    5.1 KB · Views: 210

zamilac

Mar 8, 2012
5
Joined
Mar 8, 2012
Messages
5
I would think that the circuit is responding to the peak of the PWM signal. Try disconnecting the transistor from the capacitor and see if the voltage across the capacitor can be raised and lowered.
 
Top