High school is finally over!
That being said, having chosen a technical school, I, like others, was asked to create a project to be shown during the oral interview with the exam commission. This post is meant to be sort of a postmortem for it.
Now, my goal was to create some sort of PLC, capable of controlling high power loads. The plan was to make a switch mode power supply in order to power a microcontroller. With it, I would read and execute commands from a line terminal, such as turning on and off the relays that would control the HV loads. For the relays, I chose to build some solid state ones using TRIACs.
My main goal was also to demonstrate how it was possible to use custom PCBs to make it all happen. Yes, I was the first one at school to "discover" the existence of JLCPCB and PCBWay (I've used the latter for the final product). Gone were the days of using our CNC milling machine (which, in its current state, can't make tracks smaller than 1.5mm!) or chemicals. During this time, I also wanted to help all others with their projects (suggesting them to also make custom PCBs).
Issues didn't take long to appear while designing the circuits. Initially, I was using an RX140 board from Renesas as the main brain of the thing. Now, ignoring the fact I absolutely hated the IDE Renesas gave me (it's based on eclipse, and it was tedious to use), that board died while I was casually using the debugger. I mean, that board had ESD warnings all over, but holy f**k, I even placed it on an antistatic surface. Frustrated with the slow process known as programming for a Renesas product, I have instead chosen to use an STM32 based board, and oh boy it was a good choice to make. Of course, I had to rewrite a lot of code, but I think it was all worth with.
The solid state relay board didn't give me many issues, and I was happy about it.
And then... I had to make the SMPS. God.
I was lucky enough to use a commercial transformer from wurth Elektronik and to find out that the initial prototype worked well. However, when the first PCBs arrived, we discovered that all prototypes kept blowing pretty violently.
Eventually, after some testing, we found that the feedback loop was unstable. It used a TL431 and the only thing I can say is that, to make the board small, I made some... questionable choices with its layout. We eventually swapped it with a zener diode and everything worked well.
The boards were designed using Altium designer and KiCad, and were uploaded on PCBWay for manufacturing. You can see the final flyback board on the image above. It uses an NCP1012AP10 controller (I know it's obsolete, but at this point I'm just relieved everything works), and I've tried to follow the recommended layout. The final boards arrived two weeks before the exams. Everything then went according to plan.