Introduction: Upgrade Your Chinese CNC With Arduino, Proteneer 3.51 and TCM2209
I've ordered my Chinese CNC 3040T on Ali Express. Delivered from Germany it arrived in Belgium in 2 days but hummm it was unusable. The driver card was too old and did not support Windows 10 or Linux. So what ? return it ? No. Upgrade it !
After a bitof research I decided to give it a go on basic of a simple Arduino UNO and some additional devices.
Problems this upgrade address are :
- the driver board in the CNC is not compatible with modern computers. It requires either a parallel port and Mach3 commercial software or USB with CNCUSB but no driver is available for windows 10 and CNCUSB is not available under Linux
- CNCUSB is a mysterious controller software and it's not clear which post processor is to be used in Fusion 360
- The machine definitly needs limit switches for homing and to prevent crashes
- a Zero probe is a nice to have
- TMC2209 will bring silence in steppers and is more accurate.
- Universal GCode Sender and GRBL 1.1 become well supported softwares and are definitly better than Mach3 or CNCUSB
- I'll also give configuration and first use hints.
The CNC :
An arduino Uno :
The shield (Proteneer v3.51) - be sure to have at least that version, and not version 4 that is for Arduino Nano :
Motor drivers (TMC2209, one per axis) :
Spacing Screw Brass Threaded Pillars :
Connectors (one4 pin per axis) :
Insulation Shrinkable Tubes
You'll have some soldering to do so you need obviously need an iron for that ... A small screwdriver and a multimeter are also useful. And of course, un computer to drive the thing.
Better clamps :
Really optional. I did my first experiments with a 6mm bit that is much more robust than the 1/8 standard bit. For that you need :
Limit switches (I'll develop that later) :
The bit :
Step 1: Checkup and Unmount of the Original Card
First check if your machin really needs this upgrade. Try and connect it. If everything works you may try to give it a go like that. If your card only has a parallel port but your PC a has none you'll need the upgrade. You'll also need that upgrade if the card has an USB port but it is not recognised by your PC because the USB driver only works for windows 7 or so. That was my case. Even if everything works you may need the upgrade if the card has no support for end stops that are really useful for that kind of machine.
First open the box and locate the card. It's quite easy. It holds the parallel and/or USB port and most witings start there. Se the pic above showing the card Ive removed...
Take pictures of the way it is mounted in case you want to revert or undersatnd the wiring.
Unplug all connectors from that card and unscrew the card from the box. That one will be for your personal museum of old computer devices.
Step 2: Install GRBL 1.1 on Your Arduino
Let's start by installing GRBL firmware on your Arduino UNO
Download GRBL code from here :
Take the hex file from the latest release.
Download and install Arduino IDE from here :
Start Arduino IDE. Plugin your Arduino via USB Cable
Select your Arduino board from the Arduino IDE Tools > Board then select your Arduino board's port from the Tools > Port menu.
Note the COM port used.
Open a command prompt
Copy paste the Following command :
C:\Program Files (x86)\Arduino-1.8.3\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\arduino-1.8.3\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:C:\Users\berdeter\Downloads/grbl_v1.1h.20190825.hex:i
Carefully check and adapt the command, especially the parts in bold :
- the path to the Arduino installation that dépends on IDE version and may differ on you PC
- the COM port to be used
- the full path of the hex file
Run that command with Arduino connected in USB. It taked a few minutes. This prepares you Arduino as GRBL controller.
Step 3: Install the New Hardware
Start by experimenting the positionning of the Arduino in the box. If possible, reuse an opening for the USB connector. Make sure the positionning does not conflict with other items. If possible position it in the flow of ventilation.
Use spacing pillars of the right height. You'll probably need to drill a few holes in the box. Screw it on. Check you can connect the USB.
On the Prteneer card remove the 3 jumpers below each driver sockets. Keep them you may need them again.
Stick the heat sinks on the TMC2209 drivers and plug the drivers on the Proteneer card the way shown on the picture. I have 3 drivers for X, Y and Z. You may need a 4th one if you machine has 4 axis.
Plug the proteneer hat on the Arduino.
You can add a jumper on the EN of the Proteneer card. On the picture I've connected wires but it's more a jumper you need there.
Step 4: Check and Pobably Change Stepper Connectors
Check first that wires from the back of the box to the connectors on the proteneer card are long enough. If fo you'll have to replace or extend them. Don't use wires with a smaller section as original wires. They can take 3 ampere and that's not little current.
Check connectors on the cables are compatible with ones ont the proteneer card. If not take pictures to keep wire colors in the same orders, cut and solder to new connectors. Before sodering I insert a thermo rectractable tube on the wire. This will then be positionned on the solderings and heated to avoid any risk of short circuit.
If like me you had only 2 wire colors ex red red black black, don't worry too much if reds or blacks are swapped. This will just change motor rotation direction. I'll explain how to fix that progamatically later.
Main principle you can check with a multimeter is that, if steppers are conencted, there is a resistor between wire 1-2 and 3-4 but no contact between 2-3 or 1-4.
Plug that in. You can plug the stepper connectors in either directions. It does not really matter.
Plug the main power to the Proteneer screwed connector. You'll probably need to cut out the connector. Use your multimeter to check polarity and voltage. before plugging. Ideal voltage is 24V. It should be between 12 and 36V.
Be very careful with polarity on this connection. On my machine wire colors are inverted. Check the other card for plus and minus signs and do measure to be absolutly sure.
Step 5: Install the Machine !
Well that's it fo the basic electronics.
It's time to install the machine on your desk. there is basically 2 directions you could put it on the desk. Be sure to have easy access to all steppers because you'll need to fasten screw up a bit every once in a while.
I want to be able to work on stocks that are longer than the bed so I'm installing it in a direction that suits me for that. I've built myself a work table with the machine just underneath.
Install it, connect it.
Be sure to have easy access to the screws that fasten steppers's axis on the transmission. You'll have to tighten them once in a while.
Step 6: Install UGS on Your PC (Universal GCode Sender)
Download UGS from here :
and simply unzip it.
Start it from ugsplatform64.exe located in the ni folder. May be named differently if are on Linux or Mac OSX
- Select the COM port (should be the same as tghe one you had with Arduino IDE)
- Select GRBL as firware
- Select 15200 as baud rate
- Click the connect button
You are connected to your machine.
Step 7: Check Configuration and Metrics
In the command prompt, type $$
The machine aswers with current configuration.
Switch off the CNC and turn the stepper wheels to locate approximatively at the center
- Set step sizes XY ans step size Z to 10
- Set feed rate to 2500
- Switch on the CNC
- Click the X+ button : check that the X axis moves. Check it moves on the right direction
- If the y axis moves instead, swap connectors for X and Y on the control box and try again
- If the X axis moves the wrong way type this in the command prompt = $3=1 and test again
- if the machine moves the wrong way, add 2 to the value of $3 so type either $3=2 or $3=3
- if it goes the wrong way add 4 to $3 (many possibilities now)
Great ! your axis move in the right direction now !
Move the spinner up a bit to set it about 1 cm from its top position. In the command prompt enter the following :
You've just set the home position of the CNC. Move it somewhere else then type
Mount a tool on, the collet. Don't start the spindle
It gets back to the home position. Be always sure to set the home position above anything that stands on the bed.
Take a piece of paper, put it on the bed.
Go down graduatly with Z-. When it is between 10 and 20mm high change step size Z to 1 and keep going down untill it is very close to the paper. Set step size Z to 0.1 and continue while moving the paper with you hand. Stop when the paper start being stuck under the tool.
Click Z0 : you've reset the reference Z.
Click Reset Zero : you've set the reference location in X, Y, Z.
Now in the command prompt type
The machine returns to its home location
Click "Return to zero" the machine gets back to its reference point
- Mark the location of the spindle on the bed
- Let it move 100 X+
- Mark the new location
- Measure to see if the distance is 100mm If not you'll adjust $100
- Lets call the distance you measured m0
- in the command prompt type $100. Lets call its value v0
- compute the new value v1 = v * m0/100
- Note on my machine v1 = 400
- Set the new value like this : $100=400
If you had to change someting you'll have to set new locations for ref point and home
Your machine is ready to work !
Let it go to extremities in X-, X+, Y-, Y+ to realize the usable part of the bed. Mark it as a rectangle and highlight the non usable area that I call the danger zone. Be very carful never letting you machine reach that zone as it could damage some parts.
Step 8: Build Your First Project in Fusion 360 or FreeCAD or Any Other CAD/CAM Software
There are many tutorials for that. It's a long story.
Just remember in the end you'll use a post processor for GRBL and produce a GCODE file that will probably have extension .nc
Step 9: Manufacture You Project !
OK you have your GCode file now.
Load it in UGS with the open button.
Now here is your checklist :
- Make shure screws on yous stepper transmission ar all well fastened before any manufacturing process
- Make sure the tool is well fastened too
- Go up with the spinner and set the home point abaov all items on the bed with G28.1 as usual
- Fasten your stock on the bed. Put a martyr plank bellow
- Set your reference point
- Open your gcode file
- Run it !
- Watch it running and be ready to stop in case it goes wrong
You can use your machine !!!