Tag Archives: LinuxCNC

LinuxCNC EMC2 HAL Files: 3 axis mill, 2 axis lathe with encoders, jog wheel, axis compensation, camera view

Due to frequent requests – here are the configuration files for my LinuxCNC (EMC2) controlled mill and lathe.

The mill is a 3-axis machine, with stepper motors and jog wheel (see earlier post).

emc2 linuxcnc fkm 3 axis mill hal with jog 150101

The lathe has 2 axis, stepper motors, and digital readouts. No feedback on the readouts, but they are great for highest precision work. Configuration files also include the setup for spindel-synchronized movement and spindle speed readout. I have run spindle-synchronized toolpaths for cutting regular and tapered threads with no issues at all, up to a few 100 RPM. The GUI (axis) is also configured for use with a little camera that is very handy to set the coordinates of the tools.

emc2 linuxcnc jet lathe with optical scale and spindel index 150101

Any questions, please ask. These files are meant as a source code collection for you to code your own HAL files, etc.; if you need help with a particular configuration, feel free to contact me.

Please consider that some fragments of the code might be copyrighted by others – however, I have modified it so many times that it is virtually impossible to trace back.
My contribution to these HAL files: You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. The work may not be free of known copyright restrictions in all jurisdictions. Persons may have other rights in or related to the work, such as patent or trademark rights, and others may have rights in how the work is used. I make no warranties about the work, and disclaim liability for all uses of the work, to the fullest extent permitted by applicable law.

FKM349VL Benchtop Mill: control, EMC2 LinuxCNC interface

The FKM349VL is one of many similar benchtop mills, Made in China. It’s size and power requirements make it quite suitable if you need a small machine that is still capable of machining aluminum alloy, and to some degree, even steel.

General characteristics – X travel = 490 mm, Y travel = 160 mm, Z travel = about 330 mm.
Table size is 700×180 mm

Spindle is MK3 with M12 draw-bar (this is the most significant limitation – only manual tool change!).

fkm349vl mill

The linear stages use 16 mm, 4 mm pitch ball screws. Motors are 4.5 Nm, 6 Amp nominal. These are quite powerful, plenty of torque for this machine. This allows velocities of about 1800-2200 mm/min with no steps lost.

The control electronics are all housed in a cabinet attached to the machine. All pretty nicely made (motors powered by roughly 50 VDC, from the toroidal transformer; the blue transformer provides 12 VDC for the control circuits):

fkm349vl control overview

The stepper drivers – Leadshine units, up to about 5.5 Amps, configured for 4.3 Amp peak, 3.1 Amp RMS. Type MD556, V2.5. The units are similar to the Leadshine M542 and M752 units. Aka, KL-5056, aka, Rhino RMCS-1102 – many similar units exist.
The stepper motors have 200 steps/rev; the drivers are configured for 8 microsteps per full step – this results in 1600 steps per rev.

fkm349vl stepper driver

By default, this machine came with a “CNC-Workbench” CNC controller, offered by W+W Automatisierung (www.ib-weigelt.de). I gave it a try but soon found out that it is not up to my requirements; it’s a nice little controller, for what it is, no complaints, but really only for very basic uses, and difficult to interface with other CAD/CAM software. Most of my other machinery either uses industrial control, or EMC2 (LinuxCNC), so the decision was soon made to adapt the control to EMC2.

EMC2 has a powerful hardware layer, using the parallel port for control input and output. To allow proper speed and noise immunity (very important if you don’t want to run into issues!), a little interface circuit was fabricated, on a piece of perf board:

fkm349vl interface brd

fkm349vl interface brd solder

fkm349vl control schematic

Nothing too fancy – low pass filter, Schmitt trigger, LED driver (the stepper driver use optocoupler inputs). The limit switches are combined by diode OR connections, switches are normally closed – to prevent machine damage in case of a broken wire.

The internal interface of the machine, originally used by the “CNC-workbench” controller uses a pretty uncommon high density D-SUB connector – 44 pins!

fkm349vl high density plug

First time I have seen this type of connector, but it offers a fair number of contacts, for a pretty reasonable price, and quite a bit of soldering effort!

The software implementation – let me know in case you need the EMC2 HAL files for reference. Also attached a little incremental encoder as a “handwheel”, using a second parallel port. Quite amazing what you can do with a second hand computer, a few parts, and free software!

Micro-Tel MSR-904A Microwave Receiver: a set of new handles

For a while I have been looking for a set of of spare handles for the MSR-904A, but to no avail; the unit was missing the handles – had some rough rack-mounting fixtures. Fortunately, most of the Micro-Tel equipment uses the same kind of handle, so at least I know how they should look like.

handle micro-tel

These handles are actually of a very nice design, and don’t look too complicated to fabricate. So I thought I would give it a try and machine a set of spares.

For the material I selected a piece of 7075 alloy T651 temper (fully hardened, stress relieved). This is a quite strong alloy, and it needs to be because the MSR-904A is heavy, and the full weight rests on handles if it is set down on the floor/carried around, etc.

How to machine such handles – well, it is best done using a CNC mill, and luckily, I have one in the basement, even if it is just a small machine.
fkm349vl mill

It is a FKM349VL table-top mill, not a very heavy machine, but pretty capable if used correctly. This is not for heavy loads and throughput-optimized toolpaths, but it can yield very usable accuracy, and the surface finish is very nice, provided that good tools are used. Typically, I get parts that are reproducible to within 0.01 mm, and absolute accuracy typically better than 0.03 mm, depending on how the machining goes.

handle intermediate pieces

Starting from a plate, first, the opening of the handle was machines, and chamfered. The original handle uses a radius chamfer, but well, I only have tooling for 45° chamfers around, fair enough.

Then, the holes were drilled, and countersunk, followed by machining of the left and right (short) edge.

A bit more tricky, the piece where the handle is mounted to the case. This is fairly thin, and some excess metal was left to allow easy clamping of the piece. Sure, there are other ways of achieving the same result, but it saves a lot of time if the vice doesn’t need to be re-adjusted, and if everything can be done in two or three clamp positions.

As one of the last steps, the excess metal is taken off.

handle removing excess

All in all, considerably more effort than I thought:

(1) Cut the plate to approximate size; machine one long side flat

(2) Machine handle cut-out

(3) Machine chamfer (upper side)

(4) Machine left and right edge (short sides)

(5) Spot drill, drill, and countersink holes

(6) Turn around – align

(7) Machine other chamfer

(8) Machine mounting piece

(9) Mount set of 4 pcs upside in vice

(10) Cut-off excess

(11) Cut recess of mount piece, left and right

(12) Machine front chamfer, 2x

(13) Deburr, finish

handles final

These were the tools used –

handle tools

And, not to forget, EMC2 with the Axis interface. Thank You EMC2 (LinuxCNC) team for providing such great software, free of charge!

handle axis

I might still anodize the handles – but first need to do some tests with 7075 alloy (never anodized this alloy before, and don’t want to waste the handles!).