Spindle as Joint or Spindle
- GaryLa
- Offline
- Premium Member
Less
More
- Posts: 83
- Thank you received: 1
15 Mar 2023 23:44 #266795
by GaryLa
Spindle as Joint or Spindle was created 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.
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 or Create an account to join the conversation.
- JPL
- Offline
- Platinum Member
Less
More
- Posts: 335
- Thank you received: 113
16 Mar 2023 01:34 - 16 Mar 2023 01:38 #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
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
Last edit: 16 Mar 2023 01:38 by JPL.
Please Log in or Create an account to join the conversation.
- JPL
- Offline
- Platinum Member
Less
More
- Posts: 335
- Thank you received: 113
16 Mar 2023 01:41 - 16 Mar 2023 01:51 #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.
EDIT: But then maybe not.... humpff... All this was for spindle orientation, not the same thing as spindle as C axis... My bad.
Last edit: 16 Mar 2023 01:51 by JPL.
Please Log in or Create an account to join the conversation.
- GaryLa
- Offline
- Premium Member
Less
More
- Posts: 83
- Thank you received: 1
16 Mar 2023 11:29 - 16 Mar 2023 11:43 #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.
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.
Last edit: 16 Mar 2023 11:43 by GaryLa. Reason: typo
Please Log in or Create an account to join the conversation.
- GaryLa
- Offline
- Premium Member
Less
More
- Posts: 83
- Thank you received: 1
16 Mar 2023 12:58 - 16 Mar 2023 16:57 #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:
Has anyone seen an example of this? Perhaps the component to use is the "sim-encoder" ?
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" ?
Last edit: 16 Mar 2023 16:57 by GaryLa. Reason: updated
Please Log in or Create an account to join the conversation.
- JPL
- Offline
- Platinum Member
Less
More
- Posts: 335
- Thank you received: 113
17 Mar 2023 04:52 #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
The following user(s) said Thank You: GaryLa
Please Log in or Create an account to join the conversation.
- GaryLa
- Offline
- Premium Member
Less
More
- Posts: 83
- Thank you received: 1
17 Mar 2023 12:15 #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!
Thanks!
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23162
- Thank you received: 4860
17 Mar 2023 19:50 #266941
by andypugh
Replied by andypugh on topic Spindle as Joint or Spindle
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... 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.
The following user(s) said Thank You: JPL
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23162
- Thank you received: 4860
17 Mar 2023 19:52 #266942
by andypugh
Replied by andypugh on topic Spindle as Joint or Spindle
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
forum.linuxcnc.org/24-hal-components/388...or-simulation#223508
The following user(s) said Thank You: GaryLa
Please Log in or Create an account to join the conversation.
- GaryLa
- Offline
- Premium Member
Less
More
- Posts: 83
- Thank you received: 1
17 Mar 2023 22:37 - 18 Mar 2023 14:45 #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
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
Last edit: 18 Mar 2023 14:45 by GaryLa.
Please Log in or Create an account to join the conversation.
Time to create page: 0.069 seconds