I am designing a scr based digital battery charger for the first time and have successfully driven scr to provide 110V-DC from a 140V singe-phase transformer. 2 SCR-diode combination forms full bridge rectifier and each scr driven via gate driver controlled from software. Now my design needs to constantly maintain a 110VDC up-to 10Amps of current. To do this I have used a voltage divider feedback from output (470k+10K) and a PID controller combination which varies trigger angle of SCR (from 90degree to 180degree, every half cycle) to maintain the voltage (i.e. between 0A to 10A)

Software samples adc at every 10us and my PID controller runs every 1ms. When I tested with 40ohm rheostat as load, it is working but not to my expectation. The problem is if I draw more current voltage first dips down and then after few seconds(2-3sec) pulls back-up OR if I suddenly increase the resistance, voltage shoots up (which is very scary) then eventually comes down to desired 110V.

I have seen analog SCR based PCB that maintain the voltage as if voltmeter is stuck at 110V display no matter the load. I want to show similar output from a digital controlled design. So if any one has tried this and achieved immediate control using PID please provide hints.

Please note that I have ensured common things like,

  1. SCR target trigger pulse decided by PID is generated from software exactly at the right time from zero crossing (0.1us resolution).
  2. Have tried to maintain minimum delay in voltage feedback using lesser capacitance values (although the feedback is isolted using opto, but its propagation delay is lesser than PID loop)
  3. Tried for 10-15 day and nights for fine tuning PID Kp, Ki, Kd terms and read all theory related to it.
  4. I just feel the problem with software is that even though PID loop runs every 1 ms, SCR can be triggerred only at every 10ms (due to 50Hz AC). So eventually PID input will have a delay of 10ms before it realize the result of last set value. So when I try running PID every 5,10,15,20 ms. But still 2-3 seconds dip or shoot is inevitable. But if this was the case, how analog SCR charger PCB achieving it?
  • 1
    \$\begingroup\$ Sounds like your PID isn't tuned well (too large I-gain, too low P-gain). Can you post a time plot of your step responses? \$\endgroup\$
    – Sim Son
    Commented Dec 6, 2021 at 15:26
  • 1
    \$\begingroup\$ Makes no sense to have 1ms PID loop if the new output value is acting after 10ms only. Then you are regulating a ripple. I would set PID loop to 20ms or more. \$\endgroup\$
    – user208862
    Commented Dec 6, 2021 at 16:02
  • \$\begingroup\$ I'd set the PID loop to iterate once for every half-cycle; that way it'll at least be synchronized with what you can control. \$\endgroup\$
    – TimWescott
    Commented Dec 6, 2021 at 16:16
  • 1
    \$\begingroup\$ You probably need more proportional gain, you may need more output filtering, and to get the highest proportional gain you may need a nonlinear controller that takes the nonlinear nature of the SCR timing to output voltage into account. In addition to those step responses you've been asked for, please post a schematic, at least of your rectifier and output stage. \$\endgroup\$
    – TimWescott
    Commented Dec 6, 2021 at 16:19
  • \$\begingroup\$ Schematic please. \$\endgroup\$
    – Andy aka
    Commented Dec 6, 2021 at 17:48

1 Answer 1


Of course executing PID loop faster than actuator can follow leads to wrong computation of integral part, and D-part as well. It has to be determined if PID is actually the correct way. A system with L and R is suitable to be controlled with PI controller, this way all the motor controllers do work.

To have a very simple and reliable control, you should start with P-control. This is the closer approximation you are asking for :

I have seen analog SCR based PCB that maintain the voltage as if voltmeter is stuck at 110V display no matter the load.

The output RMS voltage is not linear to the phase angle, so you could use a specific inverse function to linearize the system. With this purely analytical approach you could know the phase angle "a priori" with known input supply volatge and the desired (setpoint) output voltage.

Then you measure the output voltage and apply only a slight correction, computed via P-controller. From here you can start doing PI, PID,...

  • \$\begingroup\$ Thanks for the answer. As I read through comments, I realized there is no other secret driving technique, but to tune the PID itself. So after investing 1-2hr daily on this finally able to achieve what I inteneded. Sorry for late reply, I felt posting schematic and discussing is of no use. My learning is that you gotta put effort until the feedback adc that you get is exactly the result of the previous phase angle that was decided by the SW to fire the SCR. It seems impossible but proper tuning in SW and HW(ensuring no-delay) will achieve this. \$\endgroup\$ Commented Dec 24, 2021 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.