Retrofitting an old industrial CNC mill with EtherCAT components - MAHO MH400E

More
18 May 2026 15:38 #346478 by PedPEx
Hello guys, 

a friend and i have planned a retrofit of an old industrial CNC Mill - a MAHO MH400E - since many years, after scoring it back in 2020 and driving it through Bavaria while the very first Corona wave hit the whole world.

The first intention was to retrofit the machine with Mesa hardware and LinuxCNC. After destroying two Mesa boards in another machine build, we decided to use propper industrial components. Therefore the desire to use EtherCAT with reliable Beckhoff hardware arose. After gathering all the necessary components over the years, it was finally time to implement drivers and everything in order to install the accumalted hardware into the Maho CNC mill. The whole process can also be found in my bachelors thesis and is publicly available on GitHub .
The thesis is intentionally written in a way, that beginners have all necessary EtherCAT commands, instructions on how to build the repos from source and CiA402 related information centralized in one place. 

The retrofit is not finished at the moment and the process of implementing every component into the CNC mill will be shared here. We aim to execute this retrofit to the highest possible standard, drawing on our professional backgrounds in electronics and mechanics.

Starting from 05/2026, the hardware is mounted inside the control cabinet - which is subject to change, all spindle motor speed controll with contactors will be removed and all the 400V components will be replaced with newer Siemens safety hardware and contactors. The machine is able to read the axes position with an accuracy of 2µm (1µm was planned). The root cause of this problem is subject of the future posts. I'll keep you posted. 

All machine files can be found in this GitHub Repo (Maho400E-LinuxCNC) , the custom interpolator PCB is also avaliable on GitHub (SinCosEnc-Conv_EP5101) , the custom EtherCAT drivers can be found in the seperate "linuxcnc-ethercat" repo and in the long shot, the Siemens Machine Keyboard ( Siemens-LinuxCNC-Interface ) is also planned for implementation as a seperate EtherCAT device. 

If you have any questions, just join the conversation

Best Regards
Patrick
 
The following user(s) said Thank You: RotarySMP, tommylight, rodw, andrax, onceloved, kaya

Please Log in or Create an account to join the conversation.

More
19 May 2026 21:59 #346498 by rodw
The following user(s) said Thank You: PedPEx

Please Log in or Create an account to join the conversation.

More
21 May 2026 03:59 #346524 by andrax
I'm curious to see how the machine performs.

Please Log in or Create an account to join the conversation.

More
22 May 2026 09:39 #346556 by RotarySMP
It is interesting to see your mod. It looks like you have kept the original spindle motor and gearbox control. Did you use the gearbox Comp my mate created for the 400E, or did you roll your own?

github.com/jin-eld/mh400e-linuxcnc

Please Log in or Create an account to join the conversation.

More
22 May 2026 10:07 - 22 May 2026 10:16 #346559 by PedPEx
The spindle motor is not implemented into the machine configuration, yet. All the legacy contactors and time-relais for controling it will be decommissioned soon and the Danfoss VFD will fully control the spindle motor. We did however already pull a shielded motor power cable which is necessary for VFD driven motors. While pulling the cable through the cable sleeve, we found another broken cable that seemed to have been damaged a long time ago – it was the cable for the spindle motor brake. The brake still works, so everything good there. For the spindle brake a new cable was added and thats where the retrofit stopped like ~2 weeks ago.

We plan to reuse the original three-phase induction motor and gearbox, paired with a VFD. This setup allows us to seamlessly adjust the speed from 0 to approximately 4000 RPM while retaining the torque advantages of the gearbox. We intend to use your LinuxCNC component to control the gearbox. However, the logic for calculating the optimal gear, executing the shift, starting the spindle, and handling all subsequent speed adjustments (must be managed by the VFD) has to be programmed. With this approach, I am very confident that the Maho will be capable of rigid tapping for large threads.

As soon as i visit my parents again, i will further work on the Maho. I hope i will get the homing working soon - pretty new to LinuxCNC HAL and slowly getting used to it.
Last edit: 22 May 2026 10:16 by PedPEx. Reason: forgot gearbox details
The following user(s) said Thank You: RotarySMP

Please Log in or Create an account to join the conversation.

More
23 May 2026 05:33 #346566 by RotarySMP
Thanks. 
Where are you planning to install an encoder in the spindle drive?

Please Log in or Create an account to join the conversation.

More
23 May 2026 11:47 #346570 by PedPEx
Since we operate in vertical milling mode 99.9% of the time, we need to read the spindle position somewhere on the vertical milling head. Our current plan is to design and manufacture a resin (or similar) replacement part to substitute the white fan/impeller (or whatever the exact term is). By carefully cutting slots on the back, we should be able to mount an SSI encoder behind the hydraulic drawbar and drive it with a belt. If you have a better idea, let us know :)
We do actually have a second unused channel on the SSI encoder input terminal, eventually we will integrate the horizontal spindle too, but i don't think so.

Picture Source: Your Video "Why does my MAHO CNC spindle rattle? || RotarySMP" @ 1:57 (
)
Attachments:

Please Log in or Create an account to join the conversation.

More
23 May 2026 12:59 #346571 by Surmetall
Cool project! I like your PDF!

To the spindleencoder a hollow shaft encoder by calt on AliExpress is really low priced and should perfect fit the spindle.

To be honest i never understood why people mount an encoder to the head that is flipped away in horizontal mode. Even if you use it not that often - 50% of cool Features can not use rigid tapping. so you even less will use the cool horizontal mode. not a good place in my opinion. just mount the encoder to the motor and scale with the gearbox and you are happy for the z signal you only need an inductive sensor or similar on the horizontal spindle for reference.


greetings
Tom
The following user(s) said Thank You: PedPEx

Please Log in or Create an account to join the conversation.

More
23 May 2026 13:31 #346572 by PedPEx
Thank you Tom :)

The current plan is to mount an inductive sensor on the motor shaft and let the VFD count the pulses. That way no additional EtherCAT hardware is required and the VFD (or LinuxCNC) is able to read the motor velocity for a future PID controller or similar. An encoder is not well placed at that spot, because the vertical milling head has quite a bit of dead-zone/backlash. To keep it as simple as possible while being accurate, we decided to mount the encoder on the milling head

Please Log in or Create an account to join the conversation.

More
23 May 2026 13:46 #346573 by Surmetall
i am aware of the backlash but in this case it doesn't matter.

Please Log in or Create an account to join the conversation.

Time to create page: 0.203 seconds
Powered by Kunena Forum