I am designing a lighting controller and I'm having a bit of trouble figuring out how to handle the fast timing needed for phase control.
The circuit has four triacs. The AC signal is also being fed back to an input through an optocoupler that is used to detect zero crossings. I have the zero crossing input configured to generate an interrupt on falling edge. This part is working fine. The way I have designed it is to have a task for each triac. The zero crossing interrupt will give a semaphore to the triac tasks. The next part is where I'm having trouble. The tasks will then need to delay anywhere between 10uS to a full half AC cycle (120 Hz). My original thought was to just do a vTaskDelay of that time but I can't get micro second resolution.
After the phase delay the triac output would be turned on - then a 10uS delay - then back off again. The task would then wait on the next semaphore from the zero crossing input.
Any thoughts?
Architecture for phase controlled triac
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: Architecture for phase controlled triac
I think your best bet would be to use the MCPWM peripheral. It has a sync input that should do what you want, and would give you a phase control system entirely in hardware.
Re: Architecture for phase controlled triac
Any suggestions for configuring this? I haven't seen any examples that do anything similar.
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: Architecture for phase controlled triac
Look at the technical reference manual; it describes the peripheral. Also take a look at the documentation for the MCPWM driver in the esp-idf documentation, it should also help a bit. I don't think we have examples around for this specific use case, sorry.
Who is online
Users browsing this forum: No registered users and 108 guests