Need help making rotary axis behave like second spindle

More
1 year 6 months ago #326001 by theslawek
I have a turning application that's better suited towards a constant RPM on the rotary. I have my A axis functioning fine right now with position control.

I'd love to be able to just issue a M3 S1000 $1 instead of playing with the inverse time mode approaches.

I've searched the forum and tried several things without luck. Honestly, anything HAL related is an instant headache nightmare for me. Believe it or not, I'm an embedded programmer and did ladder logic in college, but the HAL stuff just does NOT click for me. I'd be willing to pay for someone's time to figure this out for me. I have a project for my church that is way behind.

I'm using Probe Basic for the GUI. I'd be willing to give up some GUI control as long as I can issue gcode commands.

Attached are my current INI and primary HAL.

Tried: 
- Changing control_type from 1 to 0, but had no idea what else to do
- Considered the rosekins but that doesn't really apply to my needs

Other forum posts I've read:
-  C Axis as Second Spindle - LinuxCNC
-  Using A axis as second spindle with stepper motor - LinuxCNC
-  Lathe spindle question turning and milling. - LinuxCNC

Thank you.

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

More
1 year 6 months ago #326064 by andypugh
Does this help at all?
wiki.linuxcnc.org/uploads/orient.svg
It's one potential way to do it.

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

More
1 year 6 months ago #326137 by jimmyrig
Easiest way would be to make another config.
leave the old one for when you need position.

In the new config change the A to be a spindle.

Lookup step and direction spindle for examples. If you dont want to mess with it I could do it for you.

Then it should work as you intend with me s1000 $1

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

More
1 year 6 months ago #326244 by theslawek

Easiest way would be to make another config.
leave the old one for when you need position.

In the new config change the A to be a spindle.

Lookup step and direction spindle for examples. If you dont want to mess with it I could do it for you.

Then it should work as you intend with me s1000 $1
 
Yes, I would plan to have an alternative config for this use case.

I've already searched around and tried tweaking things, but wasn't getting any success. I think I may be getting stuck up on the motion related HAL entries but I'm not sure. I would be very grateful if you could sort it out for me.

Does this help at all?
wiki.linuxcnc.org/uploads/orient.svg
It's one potential way to do it.


Andy, I wouldn't know where to start with this.

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

More
1 year 6 months ago #326272 by spumco
OP-
Unfortunately, there is no built-in or pre-made configuration for combining a rotary axis and spindle functions in LCNC.  As you've discovered in other forum posts there are a number of ways to skin the cat, but none of them can be implemented without some HAL fiddling.  Much like tool changers, rotary axes/spindle combinations are very hardware dependent so a one-size-fits-all approach is unlikely to be created and incorporated in to mainstream LCNC code.

Others may - hopefully will - chime in, but what I've gathered is the fundamental hurdles to a combination axis/spindle is that LCNC cannot re-home an axis in the middle of a gcode program.  Other controls I've used (or own) home the rotary axis every time the axis is engaged via M-code, including in the middle of a program.  LCNC can't do this, and so the result is a massive following error between where LCNC expects the rotary axis to be and the real position after running in spindle mode and then switching back to axis mode.

If you have axis encoder feedback to LCNC, then LCNC goes crazy when you switch from spindle mode to axis mode due to the following error.

If you don't have encoder feedback (open loop), then there is no way to switch from axis to spindle and back to axis mode in the middle of a program without completely losing track of position.

All the configurations I've come across for axis/spindle are just different schemes to work around the above problem.

Do you need the A-axis/4th axis to do synchronized motion with another axis?  i.e. lathe-like threading or rigid tapping?

If not, then the caxis.comp HAL component would be the easiest way to get your 4th to behave like a spindle.  Once of the nice things about caxis.comp is that there are no M-codes required to 'switch' back and forth between positioning and spindle (velocity) modes.  Caxis.comp handles that internally - essentially it checks for spindle-type commands and if one is issued (M3 Sxxx $xx) then it spins the rotary axis.  When the spindle stop command is issued caxis.comp simply returns the rotary axis to the last position it was at before the velocity command was triggered.

If you do need synchronized motion then one of the other methods would be better; I've found that caxis.comp interferes with synchronized moves and have had to abandon attempts at using it on my lathe in favor of one of the other configuration types.

It would help if we knew what your end-goal was, or at least how you intend to use the combo spindle/axis.
Is it primarily going to be a rotary axis with infrequent spindle work?  Or is it more like a lathe with infrequent C-axis positioning?
What are you driving the rotary axis with?  Servo drive?  If so, is the drive capable of homing accurately on its own?

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

More
1 year 6 months ago #326285 by theslawek
Hi Spumco,

I can't find any official documentation about caxis.comp, just many forum posts about it from you. Is this something new not in the documentation yet?

My goal is to make my CNC router use the rotary axis and simulate a lathe. I've actually already done this before moving to my Mesa 7i76e but using an external device with a dial ( amazon link ) to control the speed. I'd like to have that programatic control over the speed for obvious reasons. I actually have a YouTube video on what I did then. 


I don't need dynamic change between velocity and position controls. I'm more than happy to restart LinuxCNC with new config when changing operations.

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

Time to create page: 0.470 seconds
Powered by Kunena Forum