Introduction: CNC Controller

Hi, I'm currently done schematic and layout of CNC controller. The PCB has been ordered and I'm waiting for delivery. It's first version after I get my PCB I will do some measurements and first startup. Schematic and PCB were made using KiCad software.

What were my expectations?

  • Compatible with GRBL software
  • Two voltages 12V/24V for cooling fans
  • Pull-down or pull-up endstops
  • Indication LED for voltages
  • Holes for 50x50 fan for cooling stepper drivers
  • Reverse polarity protection

Supplies

The BOM file will be added, but first I need to test the circuit board with all calculated values. There are some capacitors that are special, I mean some of this capacitor has low ESR and capacitors where are use with crystal need to be NP0 dielectric.

Step 1: Power Input

Main fuse is 10A, but I think 6-8A will be enough(I need to test and I will update that information). USB and main power to PCB has TVS diodes to protect low voltage circuits and reverse polarity protection.

Step 2: Power Supply

There are two step-down DC-DC converters, one for 5VDC other for 12VDC. I did calculations for inductors and capacitors to work properly, all calculations are adopt for max current rating for converters. All formulas that I used are in datasheet of converters. Microcontroller and USB communication is powered by 5VDC as endstops. 12VDC is only for cooling fans.

Step 3: Stepper Motors

There are few components that I need to add to work properly. Two capacitors on power motor lines, one as magazine of energy, other decoupling. All of this steeper motor driver has own fuse, on schematic is slow 2,5A fuse but for my application I will solder slow 1,5A fuse. I need to test this fuses on real CNC work. All connections for microcontroller I measure from GRBL shield. It's prepared for two independent Y-axis. A4988 and TMC2209 compatible(I'm using TMC2209)

Step 4: Cooling Fans

As I write before, there are two options to power fans 12V/24V. I added simple filtering of interference from fans.

Step 5: EndStops

We can choose pull-up or pull-down signal to microcontroller. In most cases, GRBL software implement internal pull-up resistor. I added a low pass filter to eliminate debouncing from switches.

Step 6: USB to UART

Next, what I need is communication between microcontroller and computer. I used CH340 IC for communication. To prevent from short between 5V of DC converter and USB has been added, a simple circuit to automatically chose 5V that microcontroller will be using. 5V from DC converter has higher priority. Also, there is an ISP programming port.

Step 7: Sum Up

All files of project will be uploaded when board will work. I don't want to give you now all files because I not quite sure all works just fine. If you want now files you can write to me and I will send to you, but after I will get my PCB and test it I will update this post and inform about progression.


Updated 15.09.2023

Step 8: Problems With This Version

There were a few little problems. First the LM358 OPAMP gives signal to start up the 5V DC/DC converter, but it needs to be power up by 5V, so it was not turning on. The solution for this problem was to add pull-up resistor to Enable pin in DC/DC converter. After some testing, I decided to not powering this device via USB, so I don't need this OPAMP and stay with always ON DC/DC converter. 


Second problem was ground loop on stepper motor driver. Power GND and Logic GND are the same, so on layout I changed this. 


Next what I saw on schematic was pull-up or pull_down endstops. When I chosen a pull-down the signal was coming via all resistors that were activating all endstops. When we want to use pull-down version, we do not place resistors in pull-up circuit.


Capacitor was before reverse polarity protection, if we connect power reverse probably this capacitor will blow up. I change it place behind mosfet.


I found there were bad footprint for SOT23-3 zener diode, so I make it correct.

After this corrections all works fine.

Step 9: New Version

All problems with old version were solved in this new revision.

  • Replaced all connectors(endstops and fans) to degson 3.81mm.
  • Added ground plane.
  • Changed PCB size