Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Single-chip microcomputer control PWM needs bidirectional thyristor to find the relevant circuit diagram and program (preferably in C language). I gave the rest of my wealth to everyone.
Single-chip microcomputer control PWM needs bidirectional thyristor to find the relevant circuit diagram and program (preferably in C language). I gave the rest of my wealth to everyone.
I often use this, motor speed regulation, strictly speaking, this is not PWM, but SCR phase shift trigger.

The circuit is very simple, and the SCR trigger circuit and the zero-crossing detection circuit can be completed by an interrupt service program.

I don't know some details of your application, just a brief idea.

Generally, MOC302 1 is used for SCR triggering. There are typical circuits in the related manuals, and the CPU can be terminated with a GPIO.

In closed-loop control, zero-crossing detection does not need to be very accurate. Usually, 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.

The structure of interrupt program is divided into two parts, zero-crossing interrupt and delay interrupt.

The 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.

Delay interrupt to do one thing, trigger output. If the timer has the function of triggering output, this interrupt program is not needed.

The specific delay time is controlled by the main program and is generally set according to the calculation result of PID. Note that the longer the delay time, the smaller the output voltage.