Mill with auxilarry spindle
- bobhare
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 0
24 Jan 2020 14:45 #155651
by bobhare
Mill with auxilarry spindle was created by bobhare
I have a three axis gantry router using stepper motors on the three axes and wish to use the A output to drive an auxiliary spindle through a stepper motor. The router spindle is driven through a VFD.
I need the auxiliary spindle to run at a controlable steady rpm (and also be controlled by at variable speed through the g-code if possible).
The machine would then run as a router lathe.
Despite searching i can't find anything that indicates how to set up STEPCONF for this purpose or how to drive the stepper.
Is it possible to use a stepper motor for this and if so how do i do it?
The nearest i got to understnding it was
Help will be much appreciated.
I need the auxiliary spindle to run at a controlable steady rpm (and also be controlled by at variable speed through the g-code if possible).
The machine would then run as a router lathe.
Despite searching i can't find anything that indicates how to set up STEPCONF for this purpose or how to drive the stepper.
Is it possible to use a stepper motor for this and if so how do i do it?
The nearest i got to understnding it was
Help will be much appreciated.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17991
- Thank you received: 4838
24 Jan 2020 15:48 #155654
by PCW
Replied by PCW on topic Mill with auxilarry spindle
If you just need a step rate and direction set by a gcode command its
certainly possible in the hal file but I dont think the stepconf knows how
to do this.
Basically you set up a new step generator running in velocity mode
and connect the stepgens velocity command to perhaps a analog output pin
set by a M68 gcode
certainly possible in the hal file but I dont think the stepconf knows how
to do this.
Basically you set up a new step generator running in velocity mode
and connect the stepgens velocity command to perhaps a analog output pin
set by a M68 gcode
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
Less
More
- Posts: 10820
- Thank you received: 3565
24 Jan 2020 18:05 #155661
by rodw
Replied by rodw on topic Mill with auxilarry spindle
You don't need to use M68 as Versions 2.8 and 2.9 support multispindle configurations.
So you can control the speed using M3, M4 and S commands but you will still need PCW's methodology to set stepper speed.
See:
linuxcnc.org/docs/devel/html/gcode/other...ec:set-spindle-speed
linuxcnc.org/docs/devel/html/gcode/m-code.html#mcode:m3-m4-m5
You should be able to use some hal logic on the spindle forward and reverse pins to map to a step direction signal. See
linuxcnc.org/docs/devel/html/man/man9/mo....html#SPINDLE%20PINS
off the top of my head an or2 on the direction pins with the output and2'd with one of the original direction pins should do it.
So its time to learn how to edit your hal file by hand.
So you can control the speed using M3, M4 and S commands but you will still need PCW's methodology to set stepper speed.
See:
linuxcnc.org/docs/devel/html/gcode/other...ec:set-spindle-speed
linuxcnc.org/docs/devel/html/gcode/m-code.html#mcode:m3-m4-m5
You should be able to use some hal logic on the spindle forward and reverse pins to map to a step direction signal. See
linuxcnc.org/docs/devel/html/man/man9/mo....html#SPINDLE%20PINS
off the top of my head an or2 on the direction pins with the output and2'd with one of the original direction pins should do it.
So its time to learn how to edit your hal file by hand.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17991
- Thank you received: 4838
24 Jan 2020 18:28 - 24 Jan 2020 18:28 #155664
by PCW
Replied by PCW on topic Mill with auxilarry spindle
You should not need any special direction pin mapping, just use the signed spindle
RPM from LinuxCNC, for example spindle.1.speed-out, and connect it to the stepgen
velocity command, direction will then be automatic.
RPM from LinuxCNC, for example spindle.1.speed-out, and connect it to the stepgen
velocity command, direction will then be automatic.
Last edit: 24 Jan 2020 18:28 by PCW.
The following user(s) said Thank You: rodw
Please Log in or Create an account to join the conversation.
- bobhare
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 0
25 Jan 2020 10:25 #155717
by bobhare
Replied by bobhare on topic Mill with auxilarry spindle
Thanks for your replies which I'm sure will help. I won't be able to get to work on the issue for a while but I'll keep you posted.
Please Log in or Create an account to join the conversation.
- RotarySMP
- Offline
- Platinum Member
Less
More
- Posts: 1455
- Thank you received: 528
25 Jan 2020 11:19 #155718
by RotarySMP
Replied by RotarySMP on topic Mill with auxilarry spindle
Nice set up. Who was the mill manufacturer?
MArk
MArk
Please Log in or Create an account to join the conversation.
- bobhare
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 0
27 Feb 2020 16:36 #158650
by bobhare
Replied by bobhare on topic Mill with auxilarry spindle
I've set up the A axis on the bench and it is now running perfectly in position mode in that i can control it with g-code to rotate at commanded angles and speeds; part way there. I had to increase FERROR to have it run at decent speeds.
However, I'm having difficulty with changing the A axis to velocity control.
I can't find "ctrl_type" in the "loadrt stepgen" section of the HAL file to change. I tried adding it following another post but Linux CNC wouldn't load.
I've studied the references given but the info hasn't penetrated into my grey matter.
Any additional help would be appreciated.
I attach the .ini and .hal files.
The rotational axis is aligned with the y axis and i quess, therefore, should be the b axis and not a. How do i change this?
Thanks
However, I'm having difficulty with changing the A axis to velocity control.
I can't find "ctrl_type" in the "loadrt stepgen" section of the HAL file to change. I tried adding it following another post but Linux CNC wouldn't load.
I've studied the references given but the info hasn't penetrated into my grey matter.
Any additional help would be appreciated.
I attach the .ini and .hal files.
The rotational axis is aligned with the y axis and i quess, therefore, should be the b axis and not a. How do i change this?
Thanks
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 4957
- Thank you received: 1441
27 Feb 2020 20:50 #158689
by Todd Zuercher
Replied by Todd Zuercher on topic Mill with auxilarry spindle
I believe that that is set by the loadrt line when loading the stepgen component. There isn't a pin for changing it while running.
loadrt stepgen step_type=0,0,0,0 ctrl_type=p,p,p,v
Should change the last stepgen to velocity command.
loadrt stepgen step_type=0,0,0,0 ctrl_type=p,p,p,v
Should change the last stepgen to velocity command.
Please Log in or Create an account to join the conversation.
- bobhare
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 0
28 Feb 2020 15:52 #158756
by bobhare
Replied by bobhare on topic Mill with auxilarry spindle
In the hal file there already existed the first part of the line so i added ctrl_type=p,p,p,v but Linuxcnc would not load. I changed the v to a p and it loaded. I understand the default is position control so i guess the hal file is configured for that.
Looking down the hal file for the a axis i find this.
setp stepgen.3.position-scale [AXIS_3]SCALE
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 0
setp stepgen.3.dirhold 36000
setp stepgen.3.dirsetup 36000
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
net apos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
net apos-fb stepgen.3.position-fb => axis.3.motor-pos-fb
net astep <= stepgen.3.step
net adir <= stepgen.3.dir
net aenable axis.3.amp-enable-out => stepgen.3.enable
This seems configured for position and may need re-configuring for velocity. If that's the case how do i go about it?
Looking down the hal file for the a axis i find this.
setp stepgen.3.position-scale [AXIS_3]SCALE
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 0
setp stepgen.3.dirhold 36000
setp stepgen.3.dirsetup 36000
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
net apos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
net apos-fb stepgen.3.position-fb => axis.3.motor-pos-fb
net astep <= stepgen.3.step
net adir <= stepgen.3.dir
net aenable axis.3.amp-enable-out => stepgen.3.enable
This seems configured for position and may need re-configuring for velocity. If that's the case how do i go about it?
Please Log in or Create an account to join the conversation.
- tommylight
- Offline
- Moderator
Less
More
- Posts: 19516
- Thank you received: 6547
28 Feb 2020 16:28 #158759
by tommylight
Replied by tommylight on topic Mill with auxilarry spindle
What was the error report, the debug information part ?In the hal file there already existed the first part of the line so i added ctrl_type=p,p,p,v but Linuxcnc would not load.
Please Log in or Create an account to join the conversation.
Time to create page: 0.078 seconds