Bagster
Member level 2
I did a Pic controlled supply as part of a piece of test equipment.
I ised a simple R2R ladder on Port c of the PIC (0-5V, 8 bit = 19.53 mV/bit) I then used a LM358 opamp as a x 5 amp, you can easily make it a x 6 to get 30V, the resolution will obviously be 30V/256 = 117mV/Bit resolution. To get the current and noise immunity from a mains converted supply, i used a power opamp from Burr Brown (OPA 544T). This with a split supply (-3V to 35V) will enable you to get 0 - 30V in 117mV steps, you can adjust the LM358 gain to give a different ratio of mV/bits.
I used a max 1681 for the negative generation, simple and easy to use.
For the Current measurement/feedback, you have a choice. Either construct a differential amplifier around a series resistor and amplify the current gain to the required ratio needed by the micro.
Accurate diff amps are tedious to design, so for speed you can use a MAX471. This little beast has an internal sense resistor and trimmed/compensated diffamp that can be adjusted by an external resistor to give the required current gain ie 1mV out for 1mA through. This is placed in series with the output.
You now have a fully programmable 0-30V psu that is a breeze to operate through a single 8bit port and a single a-d input. The PSU can have a software current limit and can provide sine/triangular waveforms if required.
All you have to watch is the power dissipation of the OPA544T. It has thermal and overcurrent protection. Texas instruments/Burr Brown will send you samples free via there web site.
I can give you some code for the reading of the A_D and the binary to decimal read out of the current taken.
I used a PIC16F877 for the design.
If you want anymore info let me know.
Hope this helps.
Bagster
I ised a simple R2R ladder on Port c of the PIC (0-5V, 8 bit = 19.53 mV/bit) I then used a LM358 opamp as a x 5 amp, you can easily make it a x 6 to get 30V, the resolution will obviously be 30V/256 = 117mV/Bit resolution. To get the current and noise immunity from a mains converted supply, i used a power opamp from Burr Brown (OPA 544T). This with a split supply (-3V to 35V) will enable you to get 0 - 30V in 117mV steps, you can adjust the LM358 gain to give a different ratio of mV/bits.
I used a max 1681 for the negative generation, simple and easy to use.
For the Current measurement/feedback, you have a choice. Either construct a differential amplifier around a series resistor and amplify the current gain to the required ratio needed by the micro.
Accurate diff amps are tedious to design, so for speed you can use a MAX471. This little beast has an internal sense resistor and trimmed/compensated diffamp that can be adjusted by an external resistor to give the required current gain ie 1mV out for 1mA through. This is placed in series with the output.
You now have a fully programmable 0-30V psu that is a breeze to operate through a single 8bit port and a single a-d input. The PSU can have a software current limit and can provide sine/triangular waveforms if required.
All you have to watch is the power dissipation of the OPA544T. It has thermal and overcurrent protection. Texas instruments/Burr Brown will send you samples free via there web site.
I can give you some code for the reading of the A_D and the binary to decimal read out of the current taken.
I used a PIC16F877 for the design.
If you want anymore info let me know.
Hope this helps.
Bagster