Mesa board for CNC lathe upgrade

More
01 Nov 2023 21:16 #284284 by carson
Hi,
I've been pouring over a bunch of threads here on Mesa boards and I'm pretty sure that I want to upgrade my system to use one, but I'm still quite confused about the best one to choose and the overall process of getting it hooked up and any other hardware required.  I'm sure this info is already out there somewhere but I'm having a really hard time piecing it all together.

I have been running LinuxCNC on a dedicated desktop PC using a parallel port interface to control my CNC lathe.  I've had some issues with latency and timing, particularly with threading operations.  I'd like to upgrade my setup to use a Mesa board for (hopefully) better performance and also to get away from using the parallel port.  I think an ideal solution would be to use a Raspberry Pi with the Mesa board so that I don't need to tie up a full PC.  I've read about varying results of this approach on this forum.  Mesa makes the 7c81 board (seems to be out of stock currently) specifically to interface with the GPIO of the RPI or I could get one of the ethernet boards, but some users complain about timing issues with ethernet on the RPI.  An ethernet board also seems nice if I decide to use it with a PC instead of an RPI.  Which boards have people had success with when controlling with an RPI?

My current setup (using the PC with parallel ports) can control 3 open loop steppers, has 6 limit switches, an encoder for the spindle and an MPG with a quadrature encoder, and about 5 other buttons/knobs for input.  So I'd like to get a Mesa board that can handle all of those outputs and inputs.  In the future, I'd also be curious about using some glass scales on the X and Z axes of the lathe to provide feedback, but maybe that's another topic.

Are there any self-contained guides or tutorials on getting the mesa board setup with LinuxCNC?  Will I need to change the firmware on the FPGA to configure it?  Do I even need to run a real-time OS if the FPGA is controlling all the fast timing? 

I really appreciate all help and suggestions!
Carson

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

More
01 Nov 2023 21:59 - 01 Nov 2023 23:19 #284289 by PCW
Using a RPI4 with Ethernet, you may need to slow the servo thread rate to 2 ms.

A PC is usually easier to setup with LinuxCNC and doesn't suffer from the various graphic
library issues the the RPI has. This causes problems with some of the fancier LinuxCNC GUIs.
The RPI4 is also noticeably slower than most desktop PCs (whether these issues are fixed
with the RPI 5, I do not know)

If you want to interface with your existing parallel breakout board, you could use a 7I92T
If not, a 7I96S is a good choice. Either the 7I92T or 7I96S can be expanded to add
additional encoder inputs  if desired.

Real time is still needed with all LinuxCNC axis motion hardware, as LinuxCNC provides
the motion waypoints in real time at the servo thread rate. The FPGA does high speed
operations like step generation, PWM generation, encoder counting, etc. This means
the step rate, encoder count rate etc are not constrained by the real time capabilities
of the host.



 
Last edit: 01 Nov 2023 23:19 by PCW.

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

More
01 Nov 2023 22:53 #284294 by carson
Okay, sounds like a PC might be the way to go.  One annoyance is that I use Fusion 360 for CAD and CAM and since it only runs in WIndows, this requires a dual boot where I can't use the same machine simultaneously for running LinuxCNC and altering my CAD file.  My original plan was to use the RPI to run LinuxCNC and just remote desktop into it from my Windows computer which could run Fusion.  

So does that mean that for synchronized motion, like a threading operation, the feedback control and timing is performed entirely on the FPGA or is the computer still used to close the loop?  
Have people had success using a Mesa board along with linear encoders (glass scales from a DRO) for feedback to stepper motors?  Would that feedback loop be handled by the FPGA? 

Seems like with the 7i96S a break out board isn't really necessary and it could just be directly connected to the stepper drivers.  Maybe that's just more risky for potentially damaging it?  

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

More
01 Nov 2023 23:35 - 02 Nov 2023 00:05 #284295 by PCW
Yes, a 7I96S basically incorporates a breakout board so is intended
to connect directly to motor drives, limit switches etc. A 7I92T needs
an external breakout so a 7I92T could work with your existing parallel
port breakout.

All higher level motion control is done in LinuxCNC including all
spindle synchronized motion (threading, rigid tapping etc)
Any feedback/PID loops are also done in LinuxCNC.

The nominal 1 KHz servo thread rate is usually sufficient for this
kind of motion control. This is because the controlled device is usually
under velocity control and has a local velocity loop.

There are some threads here ( on the LinuxCNC forum ) that describe
using linear encoders with step/dir drives to increase the accuracy
and which were successful. Unfortunately these were a couple of years ago
and  I could not find them with a quick search.

EDIT: Here is a thread about using linear encoders with step/dir drives:

forum.linuxcnc.org/49-basic-configuratio...le-closed-loop-setup

 
Last edit: 02 Nov 2023 00:05 by PCW.

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

More
02 Nov 2023 09:36 #284308 by rodw

Okay, sounds like a PC might be the way to go.  One annoyance is that I use Fusion 360 for CAD and CAM and since it only runs in WIndows, this requires a dual boot
 

The better way is to install SAMBA on your linux box and enable users to map a share to their home directory. Then you can sit on a Windows PC and tell F360 to output files direct to your nc_files folder.
The one gotcha is that there is a policy change required on Windows to enable SAMBA connections.

The Linuxcnc downloads page now has a prebuilt image for the pi4b. Its based on Bookworm, the raspberian 64 bit kernel and Linuxcnc 2.9.1 which is just released.  Perhaps give it a go before you write it off. Some people have found it works OK with a 1 ms servo thread.
linuxcnc.org/downloads/

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

More
02 Nov 2023 16:07 #284343 by carson
So would I have any reason to expect better performance for threading operations with the Mesa FPGA board if the spindle synchronization servo is still being done by LinuxCNC?  Maybe it depends on whether it's the base thread or the servo thread that is limiting performance with my current setup.  With my current setup (using the parallel port) threading messes up once every few passes (seems to get slightly out of phase with previous passes: forum.linuxcnc.org/26-turning/45294-thre...zation-issues#236574).  I never was able to fully diagnose what's going wrong.  I guess it could also be that the software encoder counting is too close to the limits of its performance.  But I'm really hoping things will work better with the Mesa board.

Also, for closing the loop with linear encoders and steppers, I've read some people on this forum have had good success, but is it even worth trying for a setup (like mine) that has regular acme threaded lead screws with a fair bit of backlash?  That seems tricky for the feedback controller to handle.

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

More
02 Nov 2023 17:37 #284350 by tommylight

So would I have any reason to expect better performance for threading operations with the Mesa FPGA board if the spindle synchronization servo is still being done by LinuxCNC? 

Yes. LinuxCNC is not the limiting factor, parallel port is.

  With my current setup (using the parallel port) threading messes up once every few passes (seems to get slightly out of phase with previous passes

Most probably parallel port exceeded the ability to count encoder pulses.
You can always try a slower feed rate till you find a reliable value.

Also, for closing the loop with linear encoders and steppers, I've read some people on this forum have had good success, but is it even worth trying for a setup (like mine) that has regular acme threaded lead screws with a fair bit of backlash?  That seems tricky for the feedback controller to handle.

Linear scales would help a lot, the machine will get to where it is supposed to despite backlash.
With simple steppers you can still use backlash compensation, same as with encoders attached to the motors, so not much of improvement, but with encoders it would alert if it skipped steps, and than can be used by LinuxCNC to stop the machine so you can check what went wrong.

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

More
02 Nov 2023 18:48 #284356 by Mecanix
Hi Carson. I'm currently in the same situation as yours, with retrofitting a 4ax milling machine though, not a lathe. Currently migrating everything over fpga hardware compute, although not a mesa solution (they are unavailable in my country).

Like yourself I also have a 2ax lathe (2.5k rpm, manual tool changer, etc). This runs on a parallel port and I couldn't be happier about the set-up and reliability. Using the mode "X" parallel port, and a phase A & B & Z 100ppr omron rotary encoder. Just never fails a thread and/or rigid tapping with this set-up, and so pointless to upgrade this in my case.

All that said; are you familiar with using parport in 'X' mode or knew about it?

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

Moderators: PCWjmelson
Time to create page: 0.079 seconds
Powered by Kunena Forum