5th Axis: PathPilot or Regular LinuxCNC

More
21 Jan 2025 15:45 - 21 Jan 2025 15:52 #319573 by senatorperkins
5th Axis: PathPilot or Regular LinuxCNC was created by senatorperkins
Hi folks,

First, apologies as I know this has been discussed before several times, but I can't seem to find enough recent information about what I'm hoping to do. I have a 2024 model Tormach PCNC 440, currently running Pathpilot 2.12, and has a Mesa 7i92tf as controller and Leadshine MX3660 as 3-axis driver. I added a Xoomspeed USB I/O box to enable spindle reversing (mostly for tension/compression tapping) and it works nicely (thanks David Loomes)! I have configured a 4th axis with a 4-wire Nema32 stepper (plus 100:1 harmonic reduction), using a Leadshine DMA860H as a driver. It works nicely too! 

What I'm hoping to do next is add a 5th axis, and I already have another DMA860H and 5th axis (one nema23 mounted on another, both with 50:1 harmonic reductions. I talked with someone at Mesa and I believe I understand the wiring and controller firmware updates I need to make (I have a Sainsmart 5-axis breakout board to connect as daughter card to the 7i92tf, Mesa is writing me firmware for this). I also believe I have what I need to program CAM, using Fusion 360 with the manufacturing extension. What I will need help with is configuring Pathpilot to work with a 5th (C) axis, as well as modifying the post processor (ideally David Loomes' Xoomspeed Pathpilot with Probing post since I use in-program probing and prefer that one, especially angle probing for coordinate rotation!).

Now, I know that Tormach apparently removed the 5th axis functionality from Pathpilot. My first question to the forum is: would you recommend adding it back into Pathpilot? Or should I switch to a regular LinuxCNC install? I do like the Pathpilot interface and post processors for Fusion 360 I'm using, plus I'm not very familiar with Linux in general (even though my "Pathpilot computer" is of course running Linux and I have worked with it to add a VistaCNC pendant and the Xoomspeed I/O box, 4th axis, and Samba LAN filesharing. And I'm comfortable modifying ini/hal files and running terminal commands as long as I know what they should be), so I would prefer to stay with Pathpilot. Having a DRO for the C axis in the GUI is a nice-to-have but I think I could live without it, at least for now, so I won't necessarily need to modify the Pathpilot GUI. But if LinuxCNC is the way to go, my second question is: would it be possible to dual-boot on my linux box ("Pathpilot Computer") so that I can use Pathpilot for 3 or 4-axis jobs and switch to LinuxCNC for 5-axis jobs? I like the idea of having a separate partition for LinuxCNC, especially because I'm worried about messing something up and not getting it to work at all, and having to do a full Pathpilot re-install (plus redo all the modifications I've made) just to get back to a usable 3/4axis setup.

For the modify Pathpilot route, my next question is: how exactly do I go about adding the 5th axis (simultaneous 5th, not just indexing of course.. with or without TCP, I still need to figure out exactly what TCP is and if I want/need it.. or if it's even relevant here)? I can't seem to find a tutorial or much documentation about this, can anyone here point me towards a resource, or possibly give me a list of what files I'll need to modify (I might be able to figure out what the modifications are from the LinuxCNC documentation, but it's hard to be sure that I know the full list of what needs to be modified)? I learned that Pathpilot will overwrite any firmware changes to the controller on each startup, but I think I found how to disable that too so that I can use the firmware modified to work with the breakout board. I'll also need to know what to modify (if anything) in either Tormach's post or, preferably David's post, though for testing I'm happy to write the NC code by hand or use MDI. I'm a little familiar with modifying posts from analyzing sections of David's post that were giving me weird g-code (rapid move during expanded tapping?! turned out it was intentional and a clever hack for tension/compression heads) and to add back the code to apply coordinate rotation after angle probing, which David had removed apparently due to some random errors with axes limits he ran into during testing. Anyway, bonus points if you can tell me exactly what the mods would be or give me modified files.. actually, I'd happily pay someone a few hundred dollars for this service if it results in a working 5-axis system (seriously, let me know if you're interested)!

For the LinuxCNC path, other than dual-booting/partitioning I think I can find the documentation I need to configure the 5th axis, and hopefully make the SW connections to my hardware. Actually I can probably figure out the dual booting too, just want to know if it's possible and advisable. But if anyone wants to give any advice on this path here (a list of steps or files to modify, gotchas, workarounds, links to tutorials/helpful documentation/etc.) I would also be very grateful. And a question, maybe for a later time - how easy (or possible) is it to put the Pathpilot GUI onto a generic LinuxCNC install? I don't necessarily need the conversational functionality, but I do really like how probing and ETS works in Pathpilot.

Anyway, thanks for reading and in advance for any replies! Apologies again if people are tired of talking about 5th axes in Pathpilot. I'm a resourceful guy and usually pretty good with research (and retired so I have a lot of time on my hands) so I don't necessarily need step-by-step instructions but I can sense that there are some gaps in what I can find and understand here. Any hints to fill those gaps would be super helpful and very much appreciated!
-Ryan in Mexico 
Last edit: 21 Jan 2025 15:52 by senatorperkins.

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

More
31 Jan 2025 10:51 #320222 by andypugh
Replied by andypugh on topic 5th Axis: PathPilot or Regular LinuxCNC
1) You probably don't need to "dual boot" as such, LinuxCNC will almost certainly run on the same OS as PathPilot. One way to keep the systems separate would be to compile LinuxCNC yourself as a "Run In Place" system. (the only reason to comple from source in this case is that it's a well documented way to achieve an isolated LinuxCNC instance, all contained within one folder)
Depending on where pathpilot installs files, and what they are called, you might be able to just install LinuxCNC alongside PP. But I don't know if that would work.

2) There may be an advantage in running PP, my understanding is that their trajectory planner makes a better job of blending linear and rotary moves.

3) Do you know how PP "removed the 5th axis"? Is it just not represented in the GUI? what happens if you pretned that PP is LCNC and just add the jonts back and change the GEOMETRY in the INI?

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

More
01 Feb 2025 05:11 - 01 Feb 2025 05:14 #320284 by senatorperkins
Replied by senatorperkins on topic 5th Axis: PathPilot or Regular LinuxCNC
Andy, thank you for the reply!

1. That's great news, I'll look into how to do that. Keeping folders separate should be a workable solution!

2. Yeah, I'd really prefer to stick with Pathpilot too. 

3. I don't know how they removed the functionality, but it's not just removed from GUI. With the default INIs, I get the error "Axis b not present on this machine (valid axes are XYZA)" when I try something like an MDI G0 B120. Adding back the 5th axis callouts in the INI files is the first thing I tried and it led to an error that isn't letting me determine if the 5th axis is now working (details below). Honestly, I don't really know what I'm doing... yet.

INI modifications I've tried (in tormach_mill_base.ini, tormach_440_specific.ini, tormach_440_7i92.ini, tormach_440_7i92_specific.ini, and tormach_440_sim_specific.ini - though that last one is just for the GUI/preview/simulation I assume):
  1. I go through and any time the A axis (aka axis_3) is specified, I duplicate and increment the duplicate to B axis/axis_4.
  2. I duplicate the whole [AXIS_3] section and rename the duplicate [AXIS_4]
  3. In the [TRAJ] section, I set AXES = 5, and COORDINATES = X Y Z A B.
  4. In the [HOSTMOT2] section, I increment the num_stepgens from 5 to 6 (though I may eventually have more than 6 depending on my breakout pinout/firmware and HAL definitions).
  5. In the [MACHINE_CONFIG] section, I add the line B_AXIS_SUPPORT = B_AXIS_6_8_INCH B_AXIS_4_INCH under the line that says the same for the A axis. No idea what this is about, but yeah.. I'd like B axis support!
  6. I add "#pp_include ../common/5th_axes.inc" under the include for 4th_axes.inc and I duplicate the .inc file, rename to 5th axis and change any references to A/axis_3 to B/axis_4 in it. Though I don't know the syntax, does the # sign mean this is commented out? Or is that just how you do an include in an ini file?
  7. Weirdly, there are no [JOINT] sections in any INI files.. will I need to add one since the B axis is mounted on the A axis? Or would my 5-axis setup have no joints?

Here's the issue I get when I do all of that - PP starts normally, I reset and try to reference an axis (usually start with X), and the axis moves to home, but the "Reference X" button doesn't go away (and green light indicating it's referenced pops up) after it's homed like normal. Not until I try to reference a second axis (usually Y), then the "Reference X" button goes away, but now the "Reference Y" button doesn't go away, etc. And when I try to reference the second axis, I start getting hundreds of the same error message on the status page, I get several per second until I e-stop the machine. Here's the message:
19:27:52 | Periodic timer caught unexpected exception Traceback (most recent call last): File "/home/operator/v2.12.0/python/ui_common.py", line 2878, in periodic_status self.status_periodic_500ms( File "/home/operator/tmc/python/tormach_mill_ui.py", line 9735, in status_periodic_500ms if self.referencing in_progress and not self.is_any_axis_homing: File "/home/operator/v2.12.0/python/ui_common.py". line 10368, in is_any_axis_homing if self.hal[pinname]: AttributeError: Pin 'axis-4-homing does not exist

So I would assume that's an issue because I haven't defined a pin for axis-4-homing in the HAL files. I've tried updating the HAL files with the same strategy as the INI files, but when I do that Pathpilot won't start. Possibly because I haven't yet flashed the firmware Mesa wrote for me or connected my 5th axis breakout board / driver / motor yet. But also I can't find axis-3-homing defined anywhere in the HAL files to duplicate and modify to axis-4-homing, anyone know where it is? I've tried modifying tormach_mill_mesa.hal, tormach_mill_mesa_440.hal , tormach_mill_sim.hal, and postgui_tormach_mill.hal though I assume those last two are GUI related, so might not be contributing to this error.

I know I'll need to be more thorough/careful modifying the HAL files, especially to match the pinout of the 7i92 + generic 5-axis breakout board specified in the firmware Mesa wrote for me.. but there are some inconsistencies there that I'm asking them to clarify. Once they clarify I'll be able to get all the pin numbers and stepgen/pwm channel numbers to match across the 7i92 firmware and all of the HAL files. For now I was hoping that I could modify only the INI files and be able to make a MDI G0 B120 command without getting a "B axis not present" error (I know nothing would happen if it was working anyway since the HALs are incomplete/incorrect, new firmware isn't loaded, breakout board and 5th axis driver/motor aren't connected, but I was trying to take one thing at a time.. maybe that's not the right strategy here).

So yeah, that's where I'm at, and I'm kind of shooting in the dark at this point, but still have a lot of things to try. If you or anyone has any advice here, knows of any other files I need to modify or duplicate/rename for the additional axis, etc. please let me know.. my understanding of INI and HAL files is pretty poor. I'm working through LinuxCNC's HAL and INI documentation, but I can't find where (for example) some loadrt or addf HAL components and functions are defined (where are axis3-homing and axis3-not-homing defined!? I'm going to start looking in the python files).

I've attached the INI and HAL files (minus the sim specific ones) I've modified if anyone wants to look through them and tell me what dumb mistakes I made. Also a screenshot of the pinout/channel definition defined in the .PIN file in the firmware mesa wrote for my 7i92+breakout board, though keep in mind I'm checking with them if I should keep those pin/channel numbers and update the HAL files to match, or change the new firmware .PIN file to match my HAL pin / channel numbers (and add the additional pin/channel numbers on the P1 header (going to breakout board) where appropriate in the HAL files).

Thanks! Ryan
Last edit: 01 Feb 2025 05:14 by senatorperkins. Reason: formatting

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

Time to create page: 0.056 seconds
Powered by Kunena Forum