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

More
29 May 2026 17:20 #346741 by PedPEx
Hello guys,

Here is a little update. Since my last post, I had a detailed look at my picture gallery, specifically at the pictures of an EL5021 terminal I bought and disassembled back in early 2025. The original plan back then was to add an axial resistor in order to get it to read 11µA encoder signals. I quickly realized that wouldn't work, took some pictures, reassembled it, and returned it to the seller.

Last weekend, I took another detailed look at the PCB of the EL5021 and recognized the interpolator IC Beckhoff is using: an iC-Haus iC-NQI. For my own interpolator solution, I had actually copied the typical application circuit straight from that datasheet. That's why I immediately reordered an EL5021 terminal off eBay, opened it up, and properly reverse-engineered it today.
Beckhoff is actually following this required application circuit almost exactly ( Datasheet iC-NQI, Page 24, Figure 30 ). They are also using 4.7k Ohm resistors for RS1 and RS2. Those have to be swapped for 50k Ohm ones (I will test if these are too big; possibly 43k or 47k are better suited), and lastly the 120 Ohm resistors need to be removed. This way, the EL5021 terminal should be able to read 11µA sensors. By adding a 120 Ohm axial resistor across each input channel (A & /A, B & /B, and C & /C), the EL5021 can again be used for 1V signals. In theory, it would also support TTL signals, but that is outside the scope of this test.

Other than that, I vibe-coded a CiA402 dashboard tab for LinuxCNC to be able to see any problems with the Danfoss VFD directly in one place, without needing to decode the status word or the command word. The Danfoss VFD is now also able to read the frequency of an inductive sensor, internally calculates the motor speed, and reports that speed back via a PDO as feedback speed.

Additionally, the decision was made not to keep the original relay-based DC gearmotor solution, but to switch to two Beckhoff EL7332 terminals. Details about that coming soon™.

I'll test the functionality of the modified EL5021 terminal and keep you posted :) Wishing you all a great weekend!
Attachments:
The following user(s) said Thank You: rodw, Surmetall

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

More
30 May 2026 14:26 #346769 by vibram
Awesome work Patrick!
Regarding the spindle, here is my solution for a similar setup, the idea was to be able to keep the drilling operation possible. It works well 
 
Attachments:

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

More
30 May 2026 17:30 #346775 by PedPEx
I do actually like the way the spindle encoder is mounted. Unfortunately, I already sourced a SICK absolute multiturn SSI encoder ATM60-A4A 13x13 bit a long time ago and only paid 65 EUR for it - or I'm going to use my leftover Baumer OG73 S SN1024 1V_pp encoder, which I received as a gift a long time ago. In case neither implementation works out as it should, I'll have a detailed look at your encoder :D ( AliExpress Link )

Back to the modified EL5021 terminal: I couldn't believe that it was that easy to modify it and be able to read the encoders back. That's when - as any sane person would do xD - I got into the car, drove to my parents' house, and tested the modified terminal on the Maho CNC mill. What can I say, it's working like a charm, even on the first try :o So, yes, an EL5021 Beckhoff terminal can actually read 11µA_pp signals and you only have to modify 9 resistors in total. A rudimentary schematic is attached :) I'm not able to measure the capacitance of the capacitors due to the installed resistors within the circuit, but their values shouldn't really matter (maybe an RC low-pass filter is no longer tuned as it should be, but that shouldn't cause problems here - I hope). I documented the very first test of the modified terminal and uploaded the video to YouTube.

I've also attached a screenshot of the CiA Danfoss VFD diagnostic tool for anyone interested :)

Attachments:
The following user(s) said Thank You: RotarySMP, vibram, Surmetall

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

More
30 May 2026 19:31 #346780 by Surmetall
how cool is that! great work! that opens a huge door for older Heidenhain scales to ethercat without the need of exe's. thank you very much!

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

More
31 May 2026 14:52 #346804 by PedPEx
Hello guys,

I did some further testing of the modified EL5021 terminal. As expected, when a 120-ohm resistor is added to each channel, it is indeed able to read 1V_pp sensors again. I confirmed this with a Baumer OG73 S SN1024 (SEW branded). So, it was time to get the EL5021 integrated into LinuxCNC. For this, I used my Claude subscription and pretty quickly got a working driver for the encoder input terminal. As far as I can tell, there are no bugs in the driver. Unlike the EL5101 and EP5101, the EL5021 doesn't have the option to reset its counter with every C pulse (at least with the revision that I have - HW: 08; SW: 05). I also found out that Beckhoff seems to have made a major revision change with the newer terminals. A lot of the documented Data Objects from the Beckhoff Information System are not implemented in my terminal.

The only thing left to do is to write a component that takes care of the Beckhoff Latch-C and Latch-C-valid signals and makes them as easy as possible to use for the standard homing procedure of LinuxCNC.

Wish you all a nice Sunday :)
The following user(s) said Thank You: vibram

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

Time to create page: 0.205 seconds
Powered by Kunena Forum