CncMill

From richmondmakerlabs.uk
Jump to navigation Jump to search

Machine Overview

Hardware specs.

  • 3-axis OpenBuilds C-Beam CNC Router. This machine is an X/Z gantry with a moving Y-table bed. The total machine travel is X 350mm, Y 280mm, Z 160mm.
  • GRBL Control board is CNC xPRO Controller v3 from Spark Concepts
  • The steppers are OpenBuilds branded NEMA23 1.8°/step four wire motors MT-2303HS280AW-0B, rated for 400g.cm detent (cogging) torque and 12.6kg.cm holding torque @2.8A. They drive Tr8x8(p2) lead screws,
  • The spindle is believed to be GDZ-80-2.2B supplied by Huanyang. Water cooled, 2.2kW, 24000 RPM (nom.), 220V, ER20 collet chuck.
  • The VFD driving the spindle is Huanyang HY03D023B. It is rated for a 3.0 kW load and 230V input.

Basic Controls

There are three control buttons mounted on the side of the cabinet, at the front right top corner; resume (green), feed-hold (yellow), stop (red).

The stop button will stop all the motion. If the machine was moving at the time the exact position will be lost, requiring a rehoming operation.

The feed-hold button will bring the machine to a controlled stop, where it will pause.

The resume button continues movement from the controlled stop of feed-hold.

There is also an E-stop button and mains power switch mounted at the front right bottom corner. It cuts all power to the VFD and motor power supply, though the GRBL control board will still be powered via USB from your PC. It is then safe to change bits/collets and mount and adjust workholding fixtures. Without motor power, the Z-axis can drop, so you should rehome after turning it back on.

Operating Instructions

The low-level stepper controller runs GRBL and is accessed by the trailing USB cable to the side. To operate it requires a computer with some form of high-level controlling software for sending Gcode.

The following is the operating sequence I [PaulEvans] found works for me.

Computer Preparations

The following steps need to be performed on your controlling computer (most likely a laptop) beforehand.

The GRBL controller now has control of spindle speed, so don't forget to include an appropriate M03 instruction in the output to set it.

Preparing The Machine

Once at the machine, the following setup needs to be performed to get the machine ready for operation.

  1. Connect the trailing USB cable to the computer you'll be running UGS from. Check that it appears as a new serial port - e.g. a new /dev/ttyUSBn device will appear on Linux.
  2. Start UGS. It should detect the serial port. Configure it to "GRBL" firmware type and "115200" baud communication. Press the Connect button. UGS should now be reporting that the machine is in "Alarm" state - don't worry, that's just how GRBL powers up for some odd reason.
  3. Send the $X command to reset that alarm. This will be found in the "Machine" menu under the "Actions" sub-menu item.
  4. Send the $H command to start the homing cycle. This will align all the axes so that the controller knows where they are.

At this point the machine is now ready to perform a milling job.

Running A Milling Job

Now the machine is ready to go and you have your Gcode file, you are ready to actually cut it.

  1. Load the Gcode file into UGS (the "Browse" button in the toolbar of UGS Platform).
  2. Mount the workpiece on the Y-bed under the machine.
  3. Using the jog controls in UGS, move the cutting head to the appropriate "zero" reference point on your workpiece.
  4. Once all three axes are aligned relative to the workpiece, press the "Reset Zero" button. Note be sure not to confuse it with the similarly-labelled "Return to Zero" button; which performs an entirely opposite operation!
  5. Start the spindle controller by pressing its green "Run" button. Note that GRBL now has control of the spindle speed, so it will start at speed 0 to begin with until the G-code program instructs the spindle to begin.
  6. Double-check the positioning is correct, and if you're happy, hit the green "Go" button in UGS to start the job.

You may find it helpful to perform a "dry run" first to check that everything will be OK. Without the spindle running or the workpiece secured to the bed, the "Go" button will still make the machine move around. You can watch whether it appears to be going in the right places - the "Visualiser" window in UGS may help you to confirm this too. For extra safety against the chance of crashing the head into the bed, run this first without the endmill tool in the spindle, or at an increased Z height away from the bed. If you do run this dry-run at an increased Z height, don't forget to reset it back to the working height to do the real run.

GRBL now has full spindle control - the above instructions are out of date. IanM (talk) 08:22, 9 February 2025 (UTC)

Inventory

A (probably incomplete) list of the milling cutters:

  • Drills 0.4mm - 1.2mm in 0.1mm steps
  • Cutters 1.5mm - 3.175mm
  • Endmill 2x6 (5 pcs)
  • Endmill 3flute 3x6 (no box)
  • Endmill 3flute 5x6 (no box)
  • Endmill 3flute 6x6 (no box)
  • Endmill 3flute 7x8
  • Endmill 3flute 8x8
  • Endmill 3flute 9x10
  • Endmill 3flute 10x10
  • Endmill 3flute 12x12
  • Rounded endmill R1x6
  • Rounded endmill R3x6
  • Rounded endmill R5x10 (2 pcs)
  • Ball nose endmill R10x35 ((I don't know why we have this; it's too large to fit in the spindle))
  • T-slot cutter 16x6

Internal Notes

Grbl controller configuration:

The controller is running a custom build of Gnea GRBL v1.1h to support VFD control and individual axis homing.

All axes are configured for 8x microstepping (see jumper settings). The Tr8x8(p2) leadscrews have 8 mm lead, and the motors give 200 full steps per turn so there are 200 step pulses per mm.

GRBL steps_per_mm=(360/step_angle)*microstep_multiplier/screw_lead

Front panel (button box) cable:

Colour Function
Black GND
Red 5V (unused but may be useful for expansion)
Yellow Feed hold
Green Start/resume
White Stop
Blue spindle PWM

How it's all wired together (motors, control board, spindle drive) [| CNCRouterWiring.pdf]

See Also

  • GRBL - [1]
    • GRBL Pocket Reference - [2] - Two page chart of GRBL error codes, settings, and supported G-codes
  • Universal Gcode Sender - [3]

Getting the CNC working

Way back in the early years of RML, the CNC was sufficiently operational to complete several projects. Paul B built the machine between August and December 2015. It was moved to its current location in the cloakroom in October 2016

Back in Jan 2017 Nick Devenish had some success with it: [4], plotting with a Sharpie in the spindle rather than actual machining.

In 2018 Paul E completed several projects using it and also fitted LED lighting (currently disabled).

In 2019 others also used it successfully, (One of Peter H's attempts at a rifle stock is still on the shelves above the machine), but by December it became apparent that it was faulty.

In 2021 Ian B and Andy rewired the machine to move the GRBL controller and power supply to the outside of the enclosure. See Rewiring the CNC.

In 2022 & 2023 Andy and Paul E spent a lot of time working on the CNC with little success. Andy upgraded the machine's table with a MDF spoil board with M6 threaded inserts for workholding.

The Z axis was dropping unpredictably when the spindle was running, which took a chunk out of the MDF spoil board, fortunately without other damage.

In May 2024, Vic Chang fitted a fan to cool the stepper drivers on the GRBL controller, and also made a start on separating the wiring (EMI mitigation).

Little progress has been made since.

Issues:

  • Z axis doesn't hold position reliably - We aren't certain whether its EMI or an overloaded Z axis
  • Spindle control by GRBL not working
  • Machine and lighting wiring in disorganised state - Risk of snagging
  • No spindle cooling - The spindle is designed to be water cooled, but we don't have it hooked up. Also, the water pump is totally dead.

EMI

We suspect the Z height holding issue may be due to EMI from the spindle VFD possibly causing the Z stepper driver to 'see' extra step pulses. In an attempt to diagnose this the spindle motor cable has been removed from the gantry cable chain (to reduce coupling to the stepper cable) and shortened.

Tasks?

  • Line filter on incoming supply to VFD
  • Ferrites between VFD and board
  • Shielding between board and Spindle - Ian was trying to find something
  • Possible Suppressor capacitors
  • Separate wiring routes sensibly - in progress
  • Star Grounding at multiple points, be careful of loops
  • Fuses/ other sensible protection?

The spindle cable is unscreened four core, 8 mm dia, approx 2 m long.

Some possible things to buy??

  • Line filter
https://www.amazon.co.uk/Filter-CW4L2-20A-T-Power-Terminal-Single/dp/B0CJC3X3RW
This comes from this video - https://www.youtube.com/watch?v=DJfiOqaeFDg
  • Ferrite Cores
I've no idea on sizing these, would these help?
Some words from Steve
"Yes, remember to get suppressor type, not transformer type. You can use multiple turns and you can use them in both uni-directional and common mode"
Which, I presume, rules out these - https://www.amazon.co.uk/Uxcell-a12022900ux0327-Transformer-Ferrite-Toroid/dp/B008IGQQFG
There's a video here https://youtu.be/84aKURxohlg
  • Suppressor Capacitors
Need Ian/ Paul's opinions, as this is beyond me, but here's what Steve wrote
"Suppressor caps - When combined with ferrites result in better suppression than either alone. EFO polyprop caps are best, but anything except electrolytics will help to some degree. Values around 0.1uF @ 660V are good, be careful about introducing too many AC leakage paths as you might get into issues with the RCD"

Mechanical Issues

  • Check whether there's a mechanical problem losing Z height
The axis may be overloaded due to the weight of the oversize spindle motor and clamping collar.
Proposed test: load the Z axis with weights hung off the spindle motor to determine how much margin it has before it fails to hold position unpowered (stepper cogging torque) and to drive upwards a precise known distance.
The Z axis uses a nom. 8 mm dia. buttress screw in a nylon anti-backlash nut block and travels 8 mm per turn. If the motor is unpowered, light finger pressure will cause it to start dropping, continuing till it binds most of a turn later due to runout. It desperately needs a lower effective pitch screw that will self-hold + a new anti-backlash nut block to fit.
  • There are several screws and a bracket missing from the frame compromising rigidity
  • There is excessive play (lateral tilt) in the machine's table - needs adjustment

Spindle Control

GRBL G-code G3S<number> and G5 are now (Feb 2025) working to start and stop the spindle and set its speed.

N.B. the S speed number should be in the range 6000 to 24000.

Implementation

The VFD digital inputs use DCM as common, and its analog inputs ACM. They are not internally connected. Strap DCM to ACM so both digital and analog inputs can share a common ground with the GRBL controller. The digital inputs are active low, and have approx. 10K pullups to +24V so cannot be driven direct from a 5V logic GRBL board. A 2N7000 N-MOSFET, gate to GRBL spindle DIR, source to GND, and drain to VFD FWD is used as an inverting buffer. The Spindle PWM is RC filtered to get a 0-5V analog control voltage, wired to inverter VI. GRBL GND is wired to inverter ACM/DCM (and is the cable screen).

GRBL has been upgraded to a custom build of Gnea GRBL v1.1h with the following enabled in config.h

// Customisation in config.h:
#define USE_SPINDLE_DIR_AS_ENABLE_PIN // line 360
#define SPINDLE_ENABLE_OFF_WITH_ZERO_SPEED // line 368
#define HOMING_SINGLE_AXIS_COMMANDS // line 124

ToDo:

  • build a neater interface board that directly fits the GRBL board terminal block, with the 2N7000 MOSFET, RC filter etc. all on one board, with four screw terminals for VI, FWD, and DCM/AM to the invertor and GND to the button box. Mount next to GRBL board.

Historical notes

GRBL prior to v0.8 used Arduino D12 (PB4) pin for Spindle Enable output and D11 (PB3) for Z limit input. v0.8 - 0.9 swapped these pins to use the D11 hardware PWM for spindle control and D12 for Z limit, if compiled with VARIABLE_SPINDLE defined. If undefined they revert to the old pins. Gnea GRBL v1.1* uses the new pins.

Early versions of the CNC xPRO GRBL controller board used the old D11 & D12 pin functions. Newer versions including the v3 we are supposed to have swapped D11 and D12 to the new GRBL v1.1 functions. The pin functions can be swapped by the solder jumpers SJ2 and SJ3. Our board is configured for spindle PWM on D11.

In July 2019 Paul E got GRBL spindle speed control working. As of Jan 2025, GRBL G3 is NOT working to start the spindle and G5 does NOT stop the spindle, however S<number> does work to control the speed once manually started. The VFD apparently needs a separate input for start/stop as it doesn't threshold its speed control input. A possible fix would be to use a custom build of GRBL with Spindle Enable on the normal spindle direction pin, giving up the option to reverse the spindle in G-code (which we have never used)

ToDo:

  • Confirm CNC xPRO board version and that its correctly wired for the GRBL version installed - OK
  • Trace spindle control signal all the way to the inverter and confirm waveforms and voltages - In Progress
  • Check inverter soft settings and external/internal speed control jumper - Jumper correct, P001 set for external control.
  • Upgrade to custom build of GRBL with separate spindle enable pin - Done
  • Rewire spindle PWM (through RC smoothing filter) and separate enable direct to the VFD - Done
  • Check if the VFD has braking support : https://www.huanyangvfd.com/how-to-judge-whether-the-inverter-has-dc-braking-function/