How I defeated a CNC machine (part 2)

Hello again everyone! Thanks to the first part, I received feedback that was useful to me, so I decided to continue my activity in writing articles.

What happened before?

In the previous part, I told how I got a CNC machine (2D milling machine) with ready-made mechanics and frame. All I had to do was make him eat g-code and make movements in accordance with this code. I selected the necessary programs to work with a homemade CNC machine and successfully launched the first g-code on it.
Also in the first part I talked in detail about hardware of this machine.

Finishing setup

First! The first thing I encountered was a terrible noise. I can't even describe how loud it was initially. Of course, the first thing that came to mind was to lubricate the guides and screws, since the machine had been lying on the shelf for a long time and was even covered with dust. Naturally this didn't help much.
Then we began to criticize the frame, all the components of which were printed on a 3D printer, the poor placement of the machine on the table, it was not attached to the table at all, it just lay there – in a word, OSCILLATIONS, BACKGROUND and RESONANCE. But everything turned out to be much simpler.
CLARIFICATION: The above certainly affects the creation of noise, since the rigidity of such structures is minimal. But we wanted to assemble a CNC machine that would mill not METAL, but some simple plywood or plexiglass 2-3 mm thick, and in the future even install a laser head. In a word, the requirements for our machine in terms of rigidity MINIMUM.

Replacing stepper motor drivers. It was this detail that changed everything. It's no secret that drivers greatly influence the noise that appears when steppers operate, but I could not imagine that they have such an influence.

It turns out that the original developer had already foreseen this and purchased new drivers, after a diligent search for new drivers (they were lost somewhere in the workshop), I found them and began to study the issue of “Stepper Motor Drivers”.

Old and new stepper motor drivers

Old and new stepper motor drivers

Previously stood HR4988, they used to be very popular and many manufacturers even included them with the control board. But time passes and new and popular drivers are already on the market. For this CNC machine we purchased TMC 2209 Lerdge. As many sellers write, “The logic is compatible with the A4988 driver…”, I understood this as “the same pinout.” That is, I just pulled out the old driver and inserted a new one (via the gnd pin), nothing smoked or caught fire. But of course, not everything is so simple, it turns out that replacing the driver is a big deal THE SCIENCE.

I've been dealing with this for a long time microstep, or rather with jumpers on the control board. The specifications say that TMC 2209 capable of dividing the step by 256. This means that you can achieve very good accuracy and smooth operation of stepper motors, as well as significantly reduce noise. The characteristics of this driver can be controlled using UARTby connecting additional contacts between the board and the driver. To be honest, I didn’t want to get into this jungle, because it was necessary to tinker with the firmware, which was not installed by me.

Jumpers

Jumpers

I decided to use the old-fashioned method; there are jumpers on the control board, they had to be put in the right position. WHAT IS THIS POSITION???
After studying a bunch of articles, for some reason I couldn’t find the answer to my question. According to one of the articles, I even had to remember the binary number system.

The seller of the control board has this picture:

So I have two questions:
1) Why are there 3 jumpers, but only 2 are indicated for my driver?
2) Where is my step division by 256, why only 64?
I still didn’t understand the logic behind installing these jumpers, so I set the mode to 64.
For me LOW is OFF, HIGH is ON.
Then: 1-down, 2-up, 3-down (left).

Therefore here my recommendation, if you are just starting to assemble your machine, be sure to study the issue of UART driver management in your firmware. And who already has a lot of experience – please explain how to use these jumpers?

Also, when installing drivers, it is very important to correctly set the reference voltage, also known as Vref. There are many detailed articles on the Internet on how to do this, but I’ll say it briefly. We take a multimeter (in V mode), one probe into the common ground, I fed it through the power supply, so I connected the black probe to the black contact. And the red probe needs to be brought to the driver potentiometer. Then we twist and set the required voltage.
And more puzzles! What is the required voltage? Different sources, different data. Big formulas that intimidate beginners. One of the formulas included the resistance of a resistor. I apologize, of course, but on my driver the resistors did not have any markings at all, and measuring with probes is not very convenient.

I took the readings that the seller indicated – 1.25V, but for some reason I have little faith in the reliability of these numbers. Because this voltage depends on the stepper motor with which the driver will work. For my Nema 17HS4401 – 1.7A. By the way, here again it’s not clear, different sellers have different values, somewhere these steppers indicate 1.5A.

On one of the forums I saw this advice: “You set it to 0.8V, and then start the machine, does it skip steps? Makes noise? Turn it up by 10%.” If you have time, then it’s possible, but for me it’s long and not very interesting.

Result: I'm new to this issue, I'm just interested in trying and learning. The task of assembling a mega cool machine with fantastic characteristics is NO. I don't want to spend a lot of time debugging. Therefore, I read a lot, but set the voltage from the seller’s data – 1.25V. The machine has stopped making noise, like being cut, does not miss steps, and works smoothly. CONCLUSION: Replacing drivers really helps reduce noise.

Second! Any CNC machine must be equipped limit switches. I installed two, one on the X axis and one on the Y axis. You can also install two on each axis. I came across one of the forums where they discussed the installation of limit switches in great detail, I will simplify the process for you and just send you a photo with the result of those detailed discussions:

Connecting limit switches

Connecting limit switches

One of the contacts on the board produces 5V, which, if connected incorrectly, can cause a burnout. If the limit switches are mechanical, it is better to avoid using the 5V contact. They are more needed for optical limit switches. I checked this connection, it works.

Next we need to “enable” these limit switches in the firmware. I did it through the program LaserGRBL.

LaserGRBL

LaserGRBL

Third! Let's move smoothly to the third point of final tuning – this is the tuning itself, or rather the firmware tuning. I have it GRBL 1.1so its configuration is very conveniently done through LaserGRBL.
You need to connect your board via a wire to the computer, and then connect in this program to the corresponding COM port (speed 115200). Find and click on the “GRBL Configuration” button. And then explore this very useful site: https://cnc3018.ru/ewr-carta/
There is a lot of useful information in the “DIRECTORY” tab, but at this stage we need the “” tabDESCRIPTION $$“. It talks in detail about each item in the configuration file. Here you can configure inversion, “turning on” the limit switches, the “home” mode, the speed and acceleration of the engines.
It is very important to correctly configure the speed and acceleration of the motors; for my machine configuration, the parameters are as follows:

Speed ​​and acceleration parameters

Speed ​​and acceleration parameters

These are not ideal, but optimal settings; when accelerating above 100, my machine jerked sharply and stopped moving.

Conclusion

In two parts, I tried to briefly tell you what I had to face when finalizing the almost finished machine. There are plans, however, to install a laser head on this machine, in the datasheet of the control board (MKS DLC32 V2.1) the possibility of installing a laser head is indicated. In the meantime, let's set up a sacrificial table and play around with plywood and plexiglass.
By the way, as soon as I published the first part, I came across a very interesting program for working with CNC machines – EstlCAM.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *