John's Build Log - Taking the step to make something useful

Hi All,

This will be my build log for learning electronics and embedded systems.

The diploma I studied after school many years ago was a 50% hardware 50% software type deal, and I have always been fascinated with designing hardware and then writing the software to make it a full on product. Life happened after my studies though and I just went to where the work opportunities were, so I became a software developer, no hardware in sight. I am currently employed as a software developer for enterprise line of business applications, but the fascination for the hardware side never went away.

I decided to action that recently and got my first STM32 development board and started tinkering with the obligatory ā€˜make the LED blinkā€™ type stuff. I tried quite a couple of groups and courses for brushing up my electronics knowledge (which is VERY basic) but none of them really showed me how to practically use what I am learning. You can only learn Ohmā€™s law and Kirchhoffā€™s law in so many ways before you really want to make something useful :wink:

I stumbled onto Contextual Electronics by accident when Youtube recommended a video to me and I joined because I really like the idea of learning hands on. Take action, fail, ask questions, try againā€¦this process really appeals to me and how I like to work.

I work best if I set myself a goal and work towards it, so to help myself along, I want to achieve the following for a start.

Mid Term Goal (6 months) - DLP 3D Printer Motherboard:

I am quite into 3D printing. Just love the fact that you can design something, print it and use it for its intended purpose in the comfort of your own home. I chose to design a DLP (a.k.a Resin 3D printing) 3D printer motherboard because it has all the basic elements of what I want to build in the longer term, but much simpler. This should help me build my skills and confidence to get to my bigger goal. I will be posting more about what I would like to achieve with this and what I am doing to get there later.

Long Term Goal (1 year+) - FDM 3D Printer Motherboard:

In the longer term I would like to build a full FDM 3D printing motherboard for use with Klipper. Klipper is open source 3D printing firmware that I am running on one of my printers and I think it is quite a good piece of firmware. A bonus for this goal would be designing the board in such a way that it can be used as a drop in replacement for some of the popular hobbyist 3D printers and selling it as a product.

You can expect from this build log a lot of questions and requests for comments. I am not afraid to be wrong and really thrive by learning through iteration and feedback. Really looking forward to interacting with the community and learning.

Eventually would love to be able to contribute to this community too, but I have a bit of a road in front of me before then.

John

1 Like

Block Diagram

The Idea

Cerberus will be the name for my DLP printer motherboard. The name popped into my head when I was drawing the block diagram and the three blocks that the micro controller will be controlling. :grinning:

The Raspberry Pi Compute Module 4 will be used to host a web interface for uploading files to print and drive the LCD screen that will be providing the mask for the printing layers. The web interface will also be used to control the printer. At this point I am thinking of just using nanoDLP but I would also like to write some firmware to get more experience in that area. Time will tell, will see what route I go when I get to that point. I decided to use a compute module 4 instead of just a straight Raspberry Pi because I would also like to use it in my longer term project so want to get experience with using it as soon as possible.

The micro controller will be used to drive the Ultra Violet LEDā€™s used to cure each layer of the print, drive the Z-Axis stepper motor and up to three PWM fan outputs. The fans will be used to cool the Ultra Violet LEDā€™s, the motherboard and one extra output for driving another general purpose fan where needed.

I am planning to use UART for communication between the Pi compute module and the microcontroller. For the stepper motor driver I am planning to use either a TMC2208 or TMC2209. Both of these allow UART communication for setting up the motor parameters like current which saves me from using a small POT to set motor currents. I have always found the solution of using a POT a bit clunky.

And that is the high level plan at this point. Next step, start the KiCad schematics. And here I bet I will have a lot of questions and need a lot of input.

I would really appreciate any input and thoughts on any of my posts.

I decided to start at the DC power supply for my board. 3D printers typically have either a 12V or 24V DC input. I decided to design the DC power supply side of my board to take either 12V or 24V in so the end user has a choice of input power supply. The input voltage will also be used as output to run the UV LEDā€™s, so giving a choice between running 12V or 24V LEDā€™s is a nice feature I think. Although I have a feeling this might give me problems down the line when I design the switching circuit for this, I guess I will see when I get there. The input voltage will also be used for the PWM fanā€™s down the road.

I am quite concerned about routing all these different voltages on the board as I have never done that before. But that is a bridge I will cross when I get there.

The two major components on the board need 5V and 3.3V. 5V to power the Raspberry Pi and 3.3V to power the microcontroller. My DC supply thus has two steps. 12/24V down to 5V and then 5V down to 3.3V.

VCC to 5V

I found this regulator through a YouTube channel I watch, and after reading the datasheet for it decided that is is perfect for what I need. It can deliver a constant 3A which is perfect for the Raspberry Pi.
I followed the steps and calculations in the datasheet to come up with the schematic. I am not 100% sure that I got the inductor right, but I will iterate through this schematic again and go through all the calculations again.

5V to 3.3V

This one was an awesome find! a Low Dropout regulator with a fixed output. I donā€™t think it gets easier than that. I found this regulator through Google searches for what I was trying to do.

Miscellaneous

Just to ensure that it is easier to ā€˜debugā€™ the board when I eventually start putting them together, I added two red LEDā€™s to indicate if the 5V and 3.3V is present. The resistors were calculated for a 2mA current through each LED.

I really enjoyed figuring out how to do this side of the board. I am pretty sure I have made some mistakes, as I mentioned before my knowledge at this stage is pretty basic, but I will keep iterating until I get it right.

As usual, any comments or questions will be really appreciated.

When you apply power to VCC, only F1 will limit the current sunk into C1/C2. If F1 is a 10ohm polyfuse, then itā€™s 2.4Amps. The DMP510DL is rated for 1.2A, so you might be cutting is close, depending on what type F1 really is

Thank you @kvk I didnā€™t even think about that. Will be relooking that part of the design today to size everything correctly.

Investigating the proper way to do the reverse polarity protection in front of my DC power stage has been quite an awesome ride. I found two tutorials that was very helpful in getting this part correct. Leaving the links below here if anyone wants to check it out:

Reverse Polarity Protection Design Guide
Reverse Polarity Protection with a MOSFET

VCC to 5V - Fixed (I think :wink:)

I am not 100% sure about the resistor on the gates value, but I will revise the whole schematic again at the end and check all values etc.

Thanks again for pointing out the potential problem there @kvk.

Nextā€¦onto the motor driver ā€¦ or the MCU ā€¦ or the PI interface ā€¦ I will draw one out of a hat and see where we go :crazy_face:

BTW, I think I discovered why most implementations use a POT with the TMC2209 instead of the UART interface. The TMC2208 and TMC2209 implements a single wire UART interface and protocol. So timings in the firmware will have to be very accurate and I will probably have to have some sort of open drain circuitry for the UART-RX pin on the microcontroller side. That will be a nice challenge when it comes up and something I didnā€™t even plan to learn at this stage.

In most (all?) cases the gate resistor and the zener are not needed - just connect the gate to ground.

1 Like

Thanks @JuliaTruchsess will do

So the resistor+zener combo is used to allow operation at a higher voltage than the Vgs_max of the transistor. For that specific transistor, the max is +/- 25V, and as youā€™re operating at a max of 24V, that should be fine in removing the resistor+zener. However, 1V of margin between normal operation and potential damage to components is cutting it a bit close in my opinion.

As to calculating the actual resistor value, it should be high enough that youā€™re not burning excess power when the zener is conducting, but it should also be low enough so that the zener will conduct sufficiently when the input voltage is in the range to potentially damage the FET. Having said that, that should leave you a huge range of potentially acceptable values. I usually just pick a value Iā€™m using elsewhere in the design, and thatā€™s in the 10k-100k range.

1 Like

Very valuable input, thank you @seth.kazarians. Yeah that is why I had the zener in there, that 1V difference didnā€™t make me feel super comfortable with the margin. So as I understand it, because it is a 20v zener diode, it will clamp the voltage between the gate and source to 20v correct?

Thanks for the input on calculating the resistor value. I will look at the value again and possibly change.

I really appreciate the input as I learn.

Beware of transient power dissipation. If you gave a big capacitor on the output you can easily violate the SOA

1 Like

You know, switching slow you are long time in linear mode

1 Like

Yeah thatā€™s pretty much it. Also, be aware that there is a ā€œkneeā€ to the zener voltage. For this situation, Iā€™d probably spec a 10-12V zener, as itā€™s well within the On portion of the FET. The datasheet specā€™s a 70mOhm RdsON at 10V, so thatā€™s pretty solid.

Yes, thatā€™s a good point, this is something to be aware of. However, with the components and values that are picked, I think it should be fine. I would say that simulation would be a good option to determining this, but as always, the simulation is only as good as the models being used.

1 Like

Ah, sorry, I didnā€™t notice that Vcc is 24V. Yes, I would include the zener & resistor in this design.

1 Like

As I started getting deeper into the stepper driver, the MCU etc. etc. I think I may have bitten of a bit too much for a first project.

I am taking this weekend to evaluate and decide if i am going to make something simpler first and then get into the motherboardsā€¦

After lots of evaluation and processing I decided to still go for the DLP printer motherboard as a first build. I will be taking it a bit slower though and making sure I learn everything I need to in detail along the way, not just steam ahead!

Initially I said this is my target in the next 6 months and I think I got a bit carried away with trying to do it quickly. I will just keep on reminding myself that this is a 6 month goal.

So onward! Lets see where we landā€¦

I have been going through the ABC course in the members section. It is very good to see how the whole process unfolds. There is much more planning, trying, changing through the process than I thought which is very good to see. I was trying to get each step perfect before moving on. Going through that course is setting me up nicely for continuing with my project. Very cool.