Hello guys. I come to you in an act of desperation, because I’m out of ideas and I need a frame of reference.
I converted a manual mill (PM30 equivalent) to CNC with linear guides, AC servos, and an ATC spindle. It’s not the best machine I could have built, but given the space and weight constraints it was the best I could fit into my workshop. Was it a good idea to convert it to linear guides? No. But I crossed that bridge in the early stages of the project and decided to follow through on it.
Machine specifications
- Linear guides: HGR20 with QH linear guide block on every axis (medium preload)
- Ballscrews: Double-nut C5, preloaded (ground, not rolled)
- X: 25 mm diameter, 5 mm pitch, 640 mm length, fixed-supported bearing arrangement, FK15 (C3) + FF15
- Y: 25 mm diameter, 5 mm pitch, 420 mm length, fixed-floating bearing arrangement, FK15 (C3)
- Z: 32 mm diameter, 5 mm pitch, 620 mm length, fixed-floating bearing arrangement, FK17 (C3)
- Servo motors and drives: Delta ECMA-C20604RS, 400 W, 60 mm frame; ASD-B2-0421-B servo drive
- Spindle: CNCDepot FM30F
- Motor mounts:
- X: direct drive with these shaft couplers
- Y: direct drive with the same shaft couplers
- Z: belt driven with a 2:1 reduction with AT5 belt and pulleys (originally direct drive, but could not balance loop stability and movement accuracy sufficiently as the inertia ratio was 1:13.5, the reduction reduced it to 1:6.5)
- Travels & rapid speeds:
- X: 562 mm, max 15 m/min
- Y: 275 mm, max 15 m/min
- Z: 350 mm, max 12.5 m/min (limited by pulse rate of the controller)
- Controller: EdingCNC CNC720 (a Dutch controller)
I had a friend manufacture the X/Y saddle, the Z saddle, the spindle spacer, the motor mounts (with the exception of the Z-axis) and the end plates for the X axis. Yes it was expensive. He did a really good job.
The problem
The machine is complete, but there is one issue that has cropped up that I have not been able to solve. I have milled test pieces with a squares, diagonal squares, and circles, and have identified the following issues:
- The squares I machines were 50 and 25 mm; both the X and Y axis dimensions are slightly under size (0.06 mm), and there is a max of 0.01 mm difference between the 25 mm and 50 mm square
- The diagonal 25 mm square comes out as a rectangle; one edge is too large (25.12 mm) and one edge too small (24.92 mm)
- The circles are oval and the error reverses based on whether or not I am using a climb or convential cutting strategy
Machining slower reduces the error, but even at 200 mm/min which is horrendously slow I still get a 0.03 mm discrepancy
Based on these findings I have looked into numerous properties of the machine:
X/Y squareness
It is essentially perfect. I have a knife edge square to hold up to the part and I see no light under the part. I have verified that the machine is square with a granite master square in every plane (XY, XZ, YZ), I get basically no movement in X/Y with a 0.01 mm indicator.
Backlash
The X axis shows less than 5 µm backlash, the Y axis shows 10 µm backlash with a 0.02 mm variation in position, possibly due to ballscrew to motor mount alignment which is not perfect (but not so bad that a motor coupler couldn't take up the slack a little bit)
Pitch error
I measured it at 0.06 mm per 200 mm for the X axis and I couldn't really tell from the Y axis. This was after I semi-blindly applied a correction scheme to the controller, which I based on the Y axis, which was poorly measured (lol), and I have since removed the correction and not measured again, but this only accounts for the X/Y dimensional accuracy anyway, not the error when interpolating which I am trying to solve
Deflection
I have significant deflection when pressing hard on the spindle in the +Y direction on the YZ plane, up to 0.05 mm when pushing and I think even 0.10 mm if I used some momentum as I pushed. Pushing in the +/- X direction resulted in less deflection, a maximum of 0.05 mm even when pushing with some momentum. In any case, the machine is made for aluminium with occasional steel in mind, and with the tooling I have I manage to do a spring pass that results in whisps of aluminium so thin that I could breathe them in (when climb cutting, not conventional), for what it's worth
Servo tuning
I don't have access to bar-ball test equipment, but given that I made a circle with climb milling and a circle with conventional milling and that this resulted in the error being reversed, I interpret that as a servo gain matching error.
I have performed frequency analysis after auto tuning and made sure the bandwidth of the control loop (both position and velocity) is as high as possible while maintaining enough gain and phase margin. I have set the stiffness (P2-31) to 180 Hz for both X and Y; any higher and the servos start to resonate; lower than around 100 Hz results in visible and measurable oscillation of a few 0.01 mm (period of 1 second). I'm not sure to what extent the X and Y would need to be different, but I tried 120 Hz for Y while X remained at 180 Hz, and it did not result in a measureable difference in following accuracy when interpolating.
I have tried increasing position feed forward gain (P2-02) from 50% to 100%, but I could tell the motors weren't really having it and they sounded like they were on the brink of screaming at the top of their lungs when they didn't move for a few seconds.
I have made sure the moving filter (P1-68) and low pass filter (P1-08) are set to 0, and I have set S-curve acceleration (P1-34) and deceleration (P1-35) to 20 ms (from 200 ms). This resulted in no change.
I have tried increasing position integral compensation (KPI, P2-53), but setting it to something like 5 rad/s already gave me oscillations; I think even tried 1 (the lowest) but it would still result in overshoot after rapids at 0.25 g acceleration and deceleration. The only active integral term in the system at the moment is in the speed loop (KVI, P2-06), which is set to 180 (equal to the stiffness setting), but the manual suggests that this does not help with the follow error.
It also set anti-interference gain automatically and I think I set a fairly high low-pass filter of resonance suppression (NLP, P2-25) based on the frequency analysis graph.
I have not messed with gain switching.
I have an electronic gear ratio of 10,000:500 or something like that, and my steps per mm is at 1600, so 0.625 µm per step
The fastest pulse rate of the controller is 400 KHz
I have tried messing with some settings in the controller like disabling look ahead feed, but that didn't help either
Final remarks
I have no frame of reference on what to expect, and this is my first build, so a few questions remain:
I have no integral gain on the position loop; should I? The manual suggests that a higher proportional gain is what helps with dynamic following error, and that integral gain is there mostly for static errors
Is it possible that the X axis is the only motor that struggles to keep position? I have only tried a higher X and a lower Y; not the other way around. Even still, I would have expected to see some kind of difference with a 50% increase in gain (Y with respect to X)
What level of stiffness and bandwidth do you typically want for a CNC machine?
How likely is it that the controller is to blame? Linear movements show no real lost movement, and I have tried lowering the maximum commanded by increasing the gear ratio of the servo (and as such doubling the resolution of the position steps) without success. That doesn't rule out that there isn't an error in the time domain, however.
For people with more experience with servos and tuning: I just SOL and are my motors too small? The inertia ratio for X is 1:10, Y is 1:7, and Z is 1:6.5, but I'm not sure what is typical for a servo in this application. 400 W seems to be more than enough power; I can even accelerate at 1 G without a hitch, it just makes the room shake so I limited it to 0.25 g lol
Am I just going to need to make a counter with a microcontroller and use a linear scale and the output of the rotary encoder to find out what the following error truly is, and to see what the source of it is (controller vs servo control loop)?