Spindle as Joint or Spindle

More
3 years 7 months ago #266795 by GaryLa
Hello,

I worked with LinxuCNC for several years a while back. I had been working on a proprietary system at work for the past few years. Now I'm back to using LinxuCNC and have to admit a lot of the little nuances I thought I'd never forget, I forgot.

I've converted a lathe to CNC and chose to use Teknic motors throughout, including the spindle. The one thing I don't like about Teknic motors was their lack of foresight on making the internal encoder available as an output -- at least the index pulse. But that's a gripe for another day.

I'm wanting to use the 2 HP 220V "stepper" as my spindle motor. But I would also like to use it as a C axis from time to time since I have live tooling.

I figure I will need two different INI/HAL configurations to implement this, but I'm unclear on how to run the spindle as a "stepper" but responding to M3, M4, M5 and S commands. So far it seems that without an encoder input, I cannot accomplish this. Or rather, I can't get any useful lines emitted into the HAL file by PNCCONF.

As the C axis, I assume it's not going to be a problem, as I assume I can just assign it to an axis stepgen as I have with X and Z.

Any insights would be greatly appreciated.

Please Log in to join the conversation.

More
3 years 7 months ago #266799 by JPL
Replied by JPL on topic Spindle as Joint or Spindle
I believe you really need to have access to the encoder signal but since you definitively need an index pulse per turn for threading I would suggest to add an external encoder, especially if you don't have access to the signal from the internal encoder of the spindle motor.

Now it is certainly possible to have both S and M3,M4, M5 commands from a single INI/HAL configuration.

Talla83 did this a while ago. See here www.talla83.de/ Have a look at video #14 and $15. Now, there's at least 3 difficulties:
- Its in German (with almost useless translation from youtube)
- Its made for linuxcnc v2.7 which need to be modified to run under 2.8 and up
- Its somewhat specific to the hardware he is using.

You can also do a search with 'spindle orient', which should bring up many discussions about this topic and also look at the orient component: linuxcnc.org/docs/html/man/man9/orient.9.html

Good luck

Please Log in to join the conversation.

More
3 years 7 months ago #266800 by JPL
Replied by JPL on topic Spindle as Joint or Spindle
... Some info here too: wiki.linuxcnc.org/cgi-bin/wiki.pl?SpindleOrient

EDIT: But then maybe not.... humpff...  All this was for spindle orientation, not the same thing as spindle as C axis... My bad.

Please Log in to join the conversation.

More
3 years 7 months ago #266827 by GaryLa
Replied by GaryLa on topic Spindle as Joint or Spindle
Thanks for the reply. I have managed to thread using a spindle as C with commands like:

G1 C[360.0 * 8] Z[0.0625 * 8]

Inside a loop, rewinding C and Z, and moving X inward as required, rinse, repeat. It doesn't matter where the spindle starts as long as Z starts with it and the spindle and Z can be rewound to the same positions.

What I'm not getting is exactly how to generate the HAL code to rotate the spindle using step pulses. I've seen some snippets here and there, but I'm unclear as to how many items need to be connected in the HAL for this. I've seen the following threads which are close:

forum.linuxcnc.org/49-basic-configuratio...d-mesa-card?start=10
forum.linuxcnc.org/24-hal-components/463...an-encoder-m19-g33-1

But what I was hoping for was an output from PNCCONF that I could then tweak. It appears it doesn't output anything when the spindle is assigned to a StepGen Spindle. I'm using version 2.8.4.

Please Log in to join the conversation.

More
3 years 7 months ago #266832 by GaryLa
Replied by GaryLa on topic Spindle as Joint or Spindle
Apparently, if you specify an encoder (which I don't have), PNCCONF will output the step gen information required in both the INI and HAL files.

I wasn't specifying one, because I don't have one, and I was literally getting only 3 lines of HAL code regarding the spindle and nothing in the INI.

Now I *think* the challenge will be to use the step gen itself as the "encoder" data. I think the answer lies here:

Probably a emulated index comp that takes position (say stepgen FB position),
mods by one and simulates the index logic would do all thats required

Has anyone seen an example of this? Perhaps the component to use is the "sim-encoder" ?

Please Log in to join the conversation.

More
3 years 7 months ago #266885 by JPL
Replied by JPL on topic Spindle as Joint or Spindle
Found something that I think is pretty close to what you want: forum.linuxcnc.org/24-hal-components/388...index-for-simulation



 

Please Log in to join the conversation.

More
3 years 7 months ago #266908 by GaryLa
Replied by GaryLa on topic Spindle as Joint or Spindle
I was going to try the sim_encoder approach this weekend, but I think you just saved me some bother and time.

Thanks!

Please Log in to join the conversation.

More
3 years 7 months ago #266941 by andypugh

... Some info here too: wiki.linuxcnc.org/cgi-bin/wiki.pl?SpindleOrient

EDIT: But then maybe not.... humpff...  All this was for spindle orientation, not the same thing as spindle as C axis... My bad.
A C-axis version would look much the same. Just with joint.3.motor-pos-cmd as the control rather than spindle.0.orient-angle (or whatever that pin is, I am in the Apple store killing time :-)
 

Please Log in to join the conversation.

More
3 years 7 months ago #266942 by andypugh
Also, there is a HAL component that can create "fake" index for step-dir controlled drives without encoder.

forum.linuxcnc.org/24-hal-components/388...or-simulation#223508

Please Log in to join the conversation.

More
3 years 7 months ago #266946 by GaryLa
Replied by GaryLa on topic Spindle as Joint or Spindle
JPL pointed out that thread, too. I reviewed it and it looks perfect. Thanks for writing that.

If you're interested in using andy's code, I've added some notes on using it with MESA boards.

Fake Encoder for Spindles as Steppers

Please Log in to join the conversation.

Time to create page: 0.737 seconds
Powered by Kunena Forum