Spindle control for a 2nd spindle
22 Apr 2013 20:25 #32996
by mmt
Spindle control for a 2nd spindle was created by mmt
I have a machine that has 2 spindles (DC variable speed)
Is it possible to add a second spindle meter and on/off buttons in Axis?
Or am I going to have to add something in Py and have a separate "window"
Thanks
Is it possible to add a second spindle meter and on/off buttons in Axis?
Or am I going to have to add something in Py and have a separate "window"
Thanks
Please Log in or Create an account to join the conversation.
22 Apr 2013 21:06 #32999
by andypugh
It is possible, but there may be other problems. The main one is likely to be that G-code has no second-spindle command. This means that thr "S" word will always only drive the motion.spindle-speed-out pin.
So, adding the button to Axis is only the first part of the puzzle, the hard part is making it do something useful.
The GUI layout for Axis is defined by the axis.tcl file which you can find in /usr/share/axis/tcl/
You can make changes to this file, and they should affect the layout of Axis without you having to recompile anything. The spindle buttons are set up in lines 1195 to 1303. In theory just copying these lines and changing the names should work to create the extra buttons. Just changing a few names is a lower-risk thing to try first.
However, the buttons won't do anything unless you also make changes to the code of axis.py (which is the Python part of Axis, where the executable code lives)
Replied by andypugh on topic Spindle control for a 2nd spindle
I have a machine that has 2 spindles (DC variable speed)
Is it possible to add a second spindle meter and on/off buttons in Axis?
It is possible, but there may be other problems. The main one is likely to be that G-code has no second-spindle command. This means that thr "S" word will always only drive the motion.spindle-speed-out pin.
So, adding the button to Axis is only the first part of the puzzle, the hard part is making it do something useful.
The GUI layout for Axis is defined by the axis.tcl file which you can find in /usr/share/axis/tcl/
You can make changes to this file, and they should affect the layout of Axis without you having to recompile anything. The spindle buttons are set up in lines 1195 to 1303. In theory just copying these lines and changing the names should work to create the extra buttons. Just changing a few names is a lower-risk thing to try first.
However, the buttons won't do anything unless you also make changes to the code of axis.py (which is the Python part of Axis, where the executable code lives)
Please Log in or Create an account to join the conversation.
22 Apr 2013 21:11 #33001
by mmt
Replied by mmt on topic Spindle control for a 2nd spindle
I was afraid of that.
I have a second computer that I just use for making changes and testing them before loading them up in the dedicated one.
I will give it a try.
Thanks
I have a second computer that I just use for making changes and testing them before loading them up in the dedicated one.
I will give it a try.
Thanks
Please Log in or Create an account to join the conversation.
23 Apr 2013 23:40 - 23 Apr 2013 23:43 #33077
by mmt
Replied by mmt on topic Spindle control for a 2nd spindle
OK...I have another question for you Andy (or anyone that can help)
I have evaluated my setup and may be able to get something to work but I have a coupe questions.
This machine has a spindle and a laser that bores sub .001" holes. Right now I have a speed programmable spindle and a laser power supple that needs a PWM input for power setting. I use a relay controlled by M8 and M9 to open and close the laser shutter.
My spindle doesn't need to be programmable but the laser is a must and it requires a continuous PWM signal.
If I turn the spindle on and off (M3 and M5) I can use a potentiometer to set the speed and forget it and use M8 and M9 for the laser shutter.
So my question to you is if do the above and I use the S**** command (spindle speed) for laser power supply is that a continuous out put, or is the PWM spindle output signal in Linux "toggled" on and off with M3 and M5 as well as the relay???
I do realize that it will require an initial S**** value to be activated. I just need it to remain active until an S0 is read regardless of the state of the M3/M5 output.
Thanks for your help,
Kent
I have evaluated my setup and may be able to get something to work but I have a coupe questions.
This machine has a spindle and a laser that bores sub .001" holes. Right now I have a speed programmable spindle and a laser power supple that needs a PWM input for power setting. I use a relay controlled by M8 and M9 to open and close the laser shutter.
My spindle doesn't need to be programmable but the laser is a must and it requires a continuous PWM signal.
If I turn the spindle on and off (M3 and M5) I can use a potentiometer to set the speed and forget it and use M8 and M9 for the laser shutter.
So my question to you is if do the above and I use the S**** command (spindle speed) for laser power supply is that a continuous out put, or is the PWM spindle output signal in Linux "toggled" on and off with M3 and M5 as well as the relay???
I do realize that it will require an initial S**** value to be activated. I just need it to remain active until an S0 is read regardless of the state of the M3/M5 output.
Thanks for your help,
Kent
Last edit: 23 Apr 2013 23:43 by mmt.
Please Log in or Create an account to join the conversation.
24 Apr 2013 00:15 #33080
by andypugh
The spindle command value toggles on and off with M3/M4/M5.
If you watch the motion.spindle-speed-out pin with a halmeter you can see this.
For controlling your laser you are probably better off using the G-code analogue outputs.
ie, connect motion.analog-out-00 to your PWM generator in HAL, and then set the duty cycle with
M68 E0 Q50 (for example)
www.linuxcnc.org/docs/html/gcode/m-code....ec:M67-Analog-Output
M67 _may_ be what you want, that waits for a move (G0, G1, G2, G3) to start before changing the output value.
Replied by andypugh on topic Spindle control for a 2nd spindle
So my question to you is if do the above and I use the S**** command (spindle speed) for laser power supply is that a continuous out put, or is the PWM spindle output signal in Linux "toggled" on and off with M3 and M5 as well as the relay???
The spindle command value toggles on and off with M3/M4/M5.
If you watch the motion.spindle-speed-out pin with a halmeter you can see this.
For controlling your laser you are probably better off using the G-code analogue outputs.
ie, connect motion.analog-out-00 to your PWM generator in HAL, and then set the duty cycle with
M68 E0 Q50 (for example)
www.linuxcnc.org/docs/html/gcode/m-code....ec:M67-Analog-Output
M67 _may_ be what you want, that waits for a move (G0, G1, G2, G3) to start before changing the output value.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4976
- Thank you received: 1373
24 Apr 2013 01:54 #33083
by Todd Zuercher
Replied by Todd Zuercher on topic Spindle control for a 2nd spindle
For you multiple spindle question.
Would it possibly work for you to have a few custom M codes (M1xx) to connect and disconnect the hal pins for your first and second spindles to that the regular M and S codes control either one or both of the spindles?
For example M103 would connect your 1st spindle, M113 the second, M123 both at the same time, and M105,115 and 125 would disconncet them. Then issuing
M123
M3 S18000
Would start both spindles together or
I do not know what the effect of issuing one of these new M codes would be while a spindle were running. (or if any of this is even possible) Some experrimentaion would be called for.
I also have some multi spindle machines I have been pondering about, but I have not gotten to the point of actually trying any of this.
Would it possibly work for you to have a few custom M codes (M1xx) to connect and disconnect the hal pins for your first and second spindles to that the regular M and S codes control either one or both of the spindles?
For example M103 would connect your 1st spindle, M113 the second, M123 both at the same time, and M105,115 and 125 would disconncet them. Then issuing
M123
M3 S18000
Would start both spindles together or
I do not know what the effect of issuing one of these new M codes would be while a spindle were running. (or if any of this is even possible) Some experrimentaion would be called for.
I also have some multi spindle machines I have been pondering about, but I have not gotten to the point of actually trying any of this.
Please Log in or Create an account to join the conversation.
25 Apr 2013 02:03 #33160
by mmt
Thanks Andy.
I still need a little assistance if you don't mind.
I am fairly good at modifying HAL but when when it comes to entering something from scratch I am still a little lost. The manuals are fairly in depth and accurate but not the best for training.
M68 is what I want...so what are all the lines necessary to add to HAL to make this work?
For instance if I wanted to use parport 0 and pin 16 on the parport cable for the PWM signal.
Thanks
Replied by mmt on topic Spindle control for a 2nd spindle
ie, connect motion.analog-out-00 to your PWM generator in HAL, and then set the duty cycle with
M68 E0 Q50 (for example)
Thanks Andy.
I still need a little assistance if you don't mind.
I am fairly good at modifying HAL but when when it comes to entering something from scratch I am still a little lost. The manuals are fairly in depth and accurate but not the best for training.
M68 is what I want...so what are all the lines necessary to add to HAL to make this work?
For instance if I wanted to use parport 0 and pin 16 on the parport cable for the PWM signal.
Thanks
Please Log in or Create an account to join the conversation.
25 Apr 2013 02:04 #33161
by mmt
Replied by mmt on topic Spindle control for a 2nd spindle
Thanks Andy.
I still need a little assistance if you don't mind.
I am fairly good at modifying HAL but when when it comes to entering something from scratch I am still a little lost. The manuals are fairly in depth and accurate but not the best for training.
M68 is what I want...so what are all the lines necessary to add to HAL to make this work?
For instance if I wanted to use parport 0 and pin 16 on the parport cable for the PWM signal.
Thanks
I still need a little assistance if you don't mind.
I am fairly good at modifying HAL but when when it comes to entering something from scratch I am still a little lost. The manuals are fairly in depth and accurate but not the best for training.
M68 is what I want...so what are all the lines necessary to add to HAL to make this work?
For instance if I wanted to use parport 0 and pin 16 on the parport cable for the PWM signal.
Thanks
Please Log in or Create an account to join the conversation.
25 Apr 2013 06:27 #33172
by andypugh
You need a second pwmgen, of course, and the code to set the scale etc.
Replied by andypugh on topic Spindle control for a 2nd spindle
It might be as simple asM68 is what I want...so what are all the lines necessary to add to HAL to make this work?
net laser-pwm motion.analog-out-00 => pwmgen.1.value
The following user(s) said Thank You: mmt
Please Log in or Create an account to join the conversation.
26 Apr 2013 01:55 #33214
by mmt
Replied by mmt on topic Spindle control for a 2nd spindle
Ok Andy I have the M68 code working. Thank you so much.
I think with that it is possible to use M68 for the laser and still use the spindle control.
Right now I can use one or the other. How can I create a second PWM generator and link it that I can use both?
I put the laser code and the spindle code back into hal and it says "Pin 'pwmgen.0.value' (laser) was already linked to signal 'spindle-cmd'
I know it is because it is using the pwm generator for both and the code for the spindle cam first in the hal file so how do i correct this?
Thanks again
I think with that it is possible to use M68 for the laser and still use the spindle control.
Right now I can use one or the other. How can I create a second PWM generator and link it that I can use both?
I put the laser code and the spindle code back into hal and it says "Pin 'pwmgen.0.value' (laser) was already linked to signal 'spindle-cmd'
I know it is because it is using the pwm generator for both and the code for the spindle cam first in the hal file so how do i correct this?
Thanks again
Please Log in or Create an account to join the conversation.
Time to create page: 0.103 seconds