Quote from: dc42 on Sep 15, 2013, 11:20 pmCorrect on both counts. I suggest you use a PWM frequency of 3906.25Hz, which is a value you can get from the PWM pins associated with timer 1 and timer 2.This gives a period of 256 ns, and since there are two clock edges per period, this would require an opto-isolator with at most 128 ns on/off time (and, realistically, somewhat less than that) Correct?EDIT: Holy cow! The cheapest "high-speed" optical isolator on Mouser is nearly $8, although it does have a 50-100 ns on/off time.
Correct on both counts. I suggest you use a PWM frequency of 3906.25Hz, which is a value you can get from the PWM pins associated with timer 1 and timer 2.
To eliminate the need for high-speed opto-isolators ($$$), could I put the low-pass filter on the PWM output pin instead?
No, the period is 256us. So an ordinary opto isolator that takes perhaps 5us to switch off in the circuit I gave will suffice.
The main problem with trying to pass an analog signal through opto isolators is that you need to perform calibration to allow for the variation in their transfer ratio.
If the current transfer ratio is C, this means that when you pass a current I through the emitting side and apply whatever voltage is specified between the collector and emitter of the receiving side, you will get a collector current of C * I. Current transfer ratio is typically specified as a percentage. For the circuit I suggested, the CTR is not critical unless you are using low values of R. What values of R will you be using?
Based on a cutoff frequency of 100 Hz, resistor value of 11 kOhm, capacitor value of 0.15 uF, I then go to this calculator ( http://sim.okawa-denshi.jp/en/PWMtool.php ) which is PWM-specific. It tells me that I will have a ripple of 0.25 volts on a 0-5v PWM output. 5v / 0.25v = 20. Does this mean that I will effectively only have 20 steps of resolution?
Not quite. You will have 255 steps, but the output voltage will have 0.25V of ripple, which may or may not matter.
You can reduce the ripple by using a 2nd (or higher) order filter instead of a first-order filter. Can the welder Vcc supply intended for the pot drive a lower resistance than 22K?
Another option is to use an op amp powered fro the welder Vcc, to implement an active 2nd or 3rd order filter.Yet another option (but more expensive) is to use an ADUM6401 digital isolator chip feeding a DAC.
What about increasing the PWM frequency from 3 kHz to 30 kHz, which reduces ripple by a factor of ten?
I suggest two opto isolators (or one dual opto isolator) configured as in the attached schematic. Choose R to be about half the value of the recommended potentiometer, and the product R * C to be about 0.1 to 0.2 seconds.
Quote from: joshuabardwellI don't think I understand how this circuit emulates a potentiometer after all.The circuit doesn't emulate a potentiometer
I don't think I understand how this circuit emulates a potentiometer after all.
To test the circuit, apply about 5V (or even 9V from a battery) between the output Vcc and output ground, and use a multimeter to measure the output voltage as you vary the PWM.