Single chip microcomputer controls PWM and adopts bidirectional thyristor. How to design related circuit diagrams and programs (in C language)?
I often use this, motor speed regulation, strictly speaking, this is not PWM, but SCR phase shift trigger. \x0d\ circuit is very simple, a thyristor trigger circuit and a zero-crossing detection circuit can be completed by an interrupt service program. \ x0d \ x0d \ I don't know some details of your application, but I'm just talking about my thoughts. \x0d\ SCR triggers are generally MOC302 1. There are typical circuits in the related manuals, and the CPU can be terminated with a GPIO. \x0d\ Zero-crossing detection in closed-loop control does not need to be very accurate, but generally a bidirectional optical coupler is enough. The input of optocoupler is connected with AC input, and the output is connected with CPU interrupt. It is best to use Schmidt to shape the output signal. X0d interrupt program is divided into two parts, zero-crossing interrupt and delay interrupt. \x0d\ Zero-crossing interrupt does two things, the output is reset and the start is delayed. If the timer has an external pin reset start function, this part can be omitted. \x0d\ Delays interrupt to do one thing and trigger output. If the timer has the function of triggering output, this interrupt program is not needed. \x0d\ The specific delay time is controlled by the main program and generally set according to the calculation result of PID. Note that the longer the delay time, the smaller the output voltage.