Wednesday, 10 February 2021

Setting up Probe Basic Lathe for LinuxCNC - and making config changes

Que?

Many of the GUIs available for LinuxCNC are pretty clunky. To be fair, they have often been designed by engineers rather than graphic designers. But the result is that many of them look like a spreadsheet or a tragic Powerpoint fail. 

The Pathpilot interface that Tormach developed around LinuxCNC is a pretty cool example of how it CAN be done. 

Recently, there have been a couple of interesting developments in the GUI department, such as the QtPyVCP interface, particularly the Probe Basic version. The installation info is shown on their website.

The Github repository contains the lathe version. So I managed to get this installed in minutes..... 

And.... then of course the penny dropped that this is a sim version only. In other words it will operate as a pretend machine on your desktop but there's no "real" version yet. If I'm to get this thing running my lathe, I'll have to mess about with the config files to connect my real world components (motors, switches, VFD etc). 

You might hope to get some support from the forum on this part but then you'd be forgetting that this is the LinuxCNC community we are talking about - they are focused on developing the features. While they may be generally supportive, you seem to need to have gone through a rite of passage before you can be engaged with fully and you also need to be fairly expert in Linux and the workings of LinuxCNC.

I posted a couple of times, asking for some guidance, hoping that somebody would explain what to do. Then I worked it out for myself - very LinuxCNC! The bottom line is that you can't use the PNCConf tool to edit the Probe Basic config. You have to do it yourself.

The resulting .ini file is posted on the forum in that link. In summary:

  • The .ini file defines the configuration parameters.
  • The .hal file lists the "connections" 
And to go from a sim system to a "real" system, you basically change the .ini file so that you are communicating with actual peripherals rather than pretend / simulated things. It's the .hal files that make the connections, so you essentially just change the .ini contents to point the installation at the Axis .hal files instead of the Probe basic (sim) .hal files. The .ini file hardly needs to change.

How to make config changes to Probe Basic Lathe?

So, once you've got your system sort of up and running, how would you make changes to the configs as you add more features and peripherals? Well clearly it isn't going to involve the PNCConf tool. There's only one way to do it really and that's to make changes to another installation and work out what has changed. Then make those same changes to the Probe Basic Lathe. 

I have a working system based on the default "Axis" GUI. This is supported by the PNCConf tool, so I can add my peripherals, configure Axis with PNCConf until it works and then compare the before and after versions to identify what has changed.

Here's what I found when I reduced the number of stepgens to 2, added "X limit all", "Z limit all" and "X Home" switches and configured the spindle encoder. I used Visual Studio Code to do a Diff (compare) and highlight the changes:





So I can easily see that I need to paste the following code in if I want to implement the spindle encoder:

# ---Encoder feedback signals/setup---
setp    hm2_5i25.0.encoder.00.counter-mode 0
setp    hm2_5i25.0.encoder.00.filter 1
setp    hm2_5i25.0.encoder.00.index-invert 0
setp    hm2_5i25.0.encoder.00.index-mask 0
setp    hm2_5i25.0.encoder.00.index-mask-invert 0
setp    hm2_5i25.0.encoder.00.scale  [SPINDLE_0]ENCODER_SCALE
net spindle-revs             <=   hm2_5i25.0.encoder.00.position
net spindle-vel-fb-rps       <=   hm2_5i25.0.encoder.00.velocity
net spindle-index-enable     <=>  hm2_5i25.0.encoder.00.index-enable

I'd never have figured that out. 

As for the limit and home switches I've just added, I can see I need to replace this section (which I think was unintended anyway):

# external input signals

# --- JOINT-SELECT-A ---
net joint-select-a     <=  hm2_5i25.0.7i76.0.0.input-00

With this:

# external input signals

# --- BOTH-X ---
net both-x     <=  hm2_5i25.0.7i76.0.0.input-00-not
# --- BOTH-Z ---
net both-z     <=  hm2_5i25.0.7i76.0.0.input-01-not
# --- ALL-HOME ---
net all-home     <=  hm2_5i25.0.7i76.0.0.input-02

And the X limit / home switches need this to be replaced:

# ---setup home / limit switch signals---

net x-home-sw     =>  joint.0.home-sw-in
net x-neg-limit     =>  joint.0.neg-lim-sw-in
net x-pos-limit     =>  joint.0.pos-lim-sw-in

With this:

# ---setup home / limit switch signals---

net all-home     =>  joint.0.home-sw-in
net both-x     =>  joint.0.neg-lim-sw-in
net both-x     =>  joint.0.pos-lim-sw-in

For Z, replace this:

# ---setup home / limit switch signals---

net z-home-sw     =>  joint.1.home-sw-in
net z-neg-limit     =>  joint.1.neg-lim-sw-in
net z-pos-limit     =>  joint.1.pos-lim-sw-in

With this:

# ---setup home / limit switch signals---

net all-home     =>  joint.1.home-sw-in
net both-z     =>  joint.1.neg-lim-sw-in
net both-z     =>  joint.1.pos-lim-sw-in

Well that seems to be reasonably straightforward. A bit of a pain in the arse but workable.

No comments:

Post a comment

How to add 7i85 board to 5i25/7i76 combo

Although I'm not quite ready to integrate my X and Z linear encoders with my LinuxCNC system, I have the 7i85 board already. I 'll n...