Need help making rotary axis behave like second spindle

More
1 year 6 months ago #326304 by spumco
Caxis.comp is not in the official LCNC distribution, so there isn't going to be any documentation beyond forum posts.  

It was authored by Andy Pugh a few years ago while he was working with another forum member who was trying to get his DIY lathe sorted out.  The lathe was configured to use the same motor for spindle work as well as c-axis positioning for a live tool.

I wound up in the same boat when I started my lathe project and stumbled across Andy's post where he uploaded caxis.comp. I shamelessly grabbed it and spent quite a bit of time trying to use it and get things sorted out.  The forum is littered with my ramblings & whining over the past year or so.

If you don't mind re-starting LCNC for spindle-mode, then creating two configurations should be pretty easy.

Do you need two spindles at the same time?  Like a router bit spinning in main spindle, and 4th axis-spindle turning as well?

Is the config you attached in the original post working well for you now and you just want some help creating a 2nd config for spindle work?

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

More
1 year 6 months ago - 1 year 6 months ago #326338 by theslawek
Ah, I see. I'm not sure I want to dive into something cutting edge. Caxis.comp just sounds intimidating because I haven't read up enough about it yet.

The INI and HAL I attached is a traditional XYZA setup. A is controlled with degree command sequence like below for turning decorative spindles for example.

G00 Z3.3000 
G00 A0.0000 Y0.0000 S20000
M3 S20000 (regular 10HP spindle)
G4 P1.5
G01 A359.9011 Y0.0001 Z2.1250 F200.0


For applications when I need the ACTUAL spindle and rotary to spin non-stop (like a spindle) (as in my YouTube video), I envision loading a XYZ+A_Spindle type config where I can issue this instead.

G00 Z3.3000 
G00 A0.0000 Y0.0000 S20000
M3 S20000 (regular 10HP spindle)
M3 S100 $1 (additional rotary axis now turning like spindle)
G4 P1.5
G01 Y0.0001 Z2.1250 F200.0
Last edit: 1 year 6 months ago by theslawek. Reason: Formatting didn't render like preview.

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

More
1 year 6 months ago #326347 by spumco
Not sure 'cutting edge' is the right term, but I understand if you're not interested in something slightly experimental.  You can always have a go at caxis.comp later.

As far as creating a second configuration goes, there are (at least) a couple ways.

First, you can simply make a copy of your current config and then hand-edit the INI and HAL files.  But you mentioned that HAL isn't clicking for you, so that may be a bit of a stretch.

Second method would be to use Mesact to create a new configuration from scratch, but this time you tell Mesact that your spindle is a step & direction type.  I think you've got the 4th axis connected to stepgen.04 and are using a 6:1 belt ratio, yes?  Include those values in the new config via Mesact, along with an appropriate max speed and estimated max accel for the 4th axis.

Leave out the 'real' spindle settings, and put everything else (axes & IO) the same as your existing config and then see what Mesact comes up with.

That should give you new INI and HAL files which you can use to create a merged/blended configuration that has both spindles and no 4th axis.

I find that using VSCode makes things easy to read/edit (there's a LCNC/HAL file plugin).  I'd set up all three HAL files across two monitors and look at the differences.  Things to look out for:
  • Dont forget to comment out or delete the A-axis/joint 3 section
  • The new spindle needs all pins to be named 'spindle.1.nnn', and the signal names need to be 'spindle1-vel-cmd-nnn' (or similar).
INI file must be edited, too, especially these:
[DISPLAY]
GEOMETRY = xyz

[KINS]
KINEMATICS = trivkins coordinates=XYZ
JOINTS = 3

[TRAJ]
COORDINATES = XYZ
SPINDLES=2

[AXIS_A] - remove this entire section
[JOINT_3] - remove this entire section

[SPINDLE_1]
(put the 4th axis spindle stuff here)

Have a go and see what you come up with.  Assuming it doesn't work - these things are rarely perfect the first time - and you get an error trying to start LCNC, make sure to screen capture the error and report back here.
The following user(s) said Thank You: andypugh, tommylight, theslawek

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

More
1 year 6 months ago #326504 by theslawek
Hi Spumco, I appreciate your dedication to helping me accomplish this.

I ran into a hurdle immediately with MesaCT 2.1.7. When set to 7i76E, or any other card for that matter, the Spindle -> StepGen tab just has a message of "not functioning yet". I even cloned the lastest master from GitHub and the same message is present.

I was about to press Post on this reply, but then I thought, why don't I try PNCConf in case that's what you meant. PNCConf seems to have what you indicated. I did the changes in the INI, but I'm hung up on the HAL part.

Here are the substitutions I made from the PNCConf HAL into the clone of my good xyza config. (A parts were removed)
  1. pid.s is pid.s1 (including in the loadrt and do-pid-calcs parts)
  2. SPINDLE_0 to SPINDLE_1
  3. changed all ".s" entries to ".s1"
  4. entries such as "net spindle-vel-cmd-rps" changed to "net spindle1-vel-cmd-rps"
I've loaded the config many times and addressed my oversights.

I'm stuck with this error:

twopass: Error in file ./hallib/main.hal:
    Pin 'spindle.1.speed-ut-rps' does not exist


Which I think relates to this block. I'm not sure how to go from here. Are these related to the GUI?

net spindle1-vel-cmd-rps        <=  spindle.1.speed-out-rps
net spindle1-vel-cmd-rps-abs    <=  spindle.1.speed-out-rps-abs
net spindle1-vel-cmd-rpm        <=  spindle.1.speed-out
net spindle1-vel-cmd-rpm-abs    <=  spindle.1.speed-out-abs
net spindle1-enable             <=  spindle.1.on
net spindle1-cw                 <=  spindle.1.forward
net spindle1-ccw                <=  spindle.1.reverse
net spindle1-brake              <=  spindle.1.brake
net spindle1-revs               =>  spindle.1.revs
net spindle1-at-speed           =>  spindle.1.at-speed
net spindle1-vel-fb-rps         =>  spindle.1.speed-in
net spindle1-index-enable      <=>  spindle.1.index-enable

My latest INI and HALs attached.

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

More
1 year 6 months ago - 1 year 6 months ago #326505 by PCW
Is this just a typo when you entered test on the forum?

Pin 'spindle.1.speed-ut-rps' does not exist

 ("ut" instead of "out")

Also I think you need:loadrt [EMCMOT](EMCMOT) servo_period_nsec=[EMCMOT](SERVO_PERIOD) num_joints=[KINS](JOINTS) num_spindles=2
Last edit: 1 year 6 months ago by PCW.
The following user(s) said Thank You: spumco

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

More
1 year 6 months ago #326506 by theslawek
Found two errors (below) since I posted this and Probe Basic now loads and IT WORKS!

M3 S1000 
M3 S1000 $1


My INI and HALs uploaded for future people reading this thread.

INI
GEOMETRY = xyza

HAL
Added num_spindles
loadrt [EMCMOT](EMCMOT) servo_period_nsec=[EMCMOT](SERVO_PERIOD) num_joints=[KINS](JOINTS) num_spindles=[TRAJ](SPINDLES)

A few followup questions if I may
  1. Should I expect M5 to stop all spindles, or do I have to get used to using M5 $-1?
  2. Is it possible to get M4 to work? It doesn't do anything right now.

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

Time to create page: 0.256 seconds
Powered by Kunena Forum