Semi-Manual Lathe
07 Jan 2014 04:29 - 07 Jan 2014 04:30 #42403
by lelef
Semi-Manual Lathe was created by lelef
Hallo,
I've found this configuration for lathe with custom panel
panel
files
If I've understood it works with a spindle controlled by software.
My spidle has only on off via software ,I've modified the configuration files to have right readings of my spindle speed
but I've problems to make the .ngc files rigt for my lathe
I think that I've to remove or change some instructions but it's really difficult
I've found this configuration for lathe with custom panel
panel
files
If I've understood it works with a spindle controlled by software.
My spidle has only on off via software ,I've modified the configuration files to have right readings of my spindle speed
but I've problems to make the .ngc files rigt for my lathe
I think that I've to remove or change some instructions but it's really difficult
Last edit: 07 Jan 2014 04:30 by lelef.
Please Log in or Create an account to join the conversation.
07 Jan 2014 08:35 - 07 Jan 2014 08:39 #42418
by andypugh
www.linuxcnc.org/index.php/english/forum...0-lathe-macros#34357
Though that is harder to configure.
That shouldn't really matter, though I strongly advocate setting up software spindle control, it is a great benefit.
Can you describe the hardware setup and the specific problems you have, the more specific you can be the more likely we are to guess right about where the problem is.
Replied by andypugh on topic Semi-Manual Lathe
That's my web site, though I don't use that config any more, I moved on to:I've found this configuration for lathe with custom panel
www.linuxcnc.org/index.php/english/forum...0-lathe-macros#34357
Though that is harder to configure.
,My spidle has only on off via software
That shouldn't really matter, though I strongly advocate setting up software spindle control, it is a great benefit.
Can you describe the hardware setup and the specific problems you have, the more specific you can be the more likely we are to guess right about where the problem is.
Last edit: 07 Jan 2014 08:39 by andypugh.
Please Log in or Create an account to join the conversation.
07 Jan 2014 22:27 #42434
by lelef
Replied by lelef on topic Semi-Manual Lathe
Great work!
The new interface is really cool.
If it is the right way I prefer make work the old one and when I understand how to make it work I could start with the new one.
my harware :
I've retrofitted the lathe to have it for completely manual or cnc use
the pc is new ,minitower with the last version of linuxcnc ,2 lpt port one for a pendant the other for the lathe(I use multiple configurations and I use the same pc for 2 mills and the lathe)
a usb joypad
tha spindle motor is a 3hp and it can be switched on and off by software,no speed control (there is a 6 speed gearbox) and the direction is manual
the spindle has an omron encoder 100 resolution A B Z cannels
the z axis is a 850w dc motor with 200 step omron encoder with a chinese driver, step dir mode
It works with a geared reduction on the treading screw of the lathe ,there is a bakslash compensation in sofware configuration, I've not used a ballscrew because in this way I can disconnect the servo for manual use.
X axis is a quite big stepper (I don't have the tecnical data anymore) with belt driven reduction and ballscrew
the servo and the stepper has 2 different power supply
The new interface is really cool.
If it is the right way I prefer make work the old one and when I understand how to make it work I could start with the new one.
my harware :
I've retrofitted the lathe to have it for completely manual or cnc use
the pc is new ,minitower with the last version of linuxcnc ,2 lpt port one for a pendant the other for the lathe(I use multiple configurations and I use the same pc for 2 mills and the lathe)
a usb joypad
tha spindle motor is a 3hp and it can be switched on and off by software,no speed control (there is a 6 speed gearbox) and the direction is manual
the spindle has an omron encoder 100 resolution A B Z cannels
the z axis is a 850w dc motor with 200 step omron encoder with a chinese driver, step dir mode
It works with a geared reduction on the treading screw of the lathe ,there is a bakslash compensation in sofware configuration, I've not used a ballscrew because in this way I can disconnect the servo for manual use.
X axis is a quite big stepper (I don't have the tecnical data anymore) with belt driven reduction and ballscrew
the servo and the stepper has 2 different power supply
Please Log in or Create an account to join the conversation.
07 Jan 2014 22:41 #42435
by andypugh
Of course, if your machine has a DOL starter this is no advantage.
linuxcnc.org/dapper/index.php/english/fo...gear-detection#39583
Replied by andypugh on topic Semi-Manual Lathe
I have an 8-speed gearbox on my milling machine, and devised a way for LinuxCNC to auto-detect which gear is engages and control the VFD accordingly.tha spindle motor is a 3hp and it can be switched on and off by software,no speed control (there is a 6 speed gearbox) and the direction is manual
Of course, if your machine has a DOL starter this is no advantage.
linuxcnc.org/dapper/index.php/english/fo...gear-detection#39583
Please Log in or Create an account to join the conversation.
07 Jan 2014 22:42 #42436
by andypugh
I forgot to say, I still have manual control of my lathe, but with the lathe macros I have never felt the need to use the manual controls. The macros basically act just like power feeds, except that they auto-restart at the end of each pass
Replied by andypugh on topic Semi-Manual Lathe
I've retrofitted the lathe to have it for completely manual or cnc use
I forgot to say, I still have manual control of my lathe, but with the lathe macros I have never felt the need to use the manual controls. The macros basically act just like power feeds, except that they auto-restart at the end of each pass
Please Log in or Create an account to join the conversation.
07 Jan 2014 23:14 #42437
by lelef
Replied by lelef on topic Semi-Manual Lathe
Theese arethe 2 .hal files that worrks with your routines, in the custom postgui I've not undersand jet what
net surface_speed_in pyvcp.surface_speed => motion.analog-in-00
net feed_per_rev_in pyvcp.feed_per_rev => motion.analog-in-01
net target_x_in pyvcp.target_X => motion.analog-in-03
net target_z_in pyvcp.target_Z => motion.analog-in-04
are for..
core stepper
# core HAL config file for steppers
# first load the core RT modules that will be needed
# kinematics
loadrt trivkins
# motion controller, get name and thread periods from ini file
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES num_aio=8 num_dio=10
#loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
# stepper module, three step generators, all three using step/dir
loadrt stepgen step_type=0,0,0
# counting the spindle counter in software
loadrt counter num_chan=1
# misc blocks needed to do fun things
loadrt ddt count=6
# spindle speed pwm
loadrt pwmgen output_type=0
# spindle speed feedback
loadrt lowpass count=1
loadrt mult2 count=3
loadrt scale count=1
# hook functions to base thread (high speed thread for step generation)
addf stepgen.make-pulses base-thread
# hook functions to servo thread
addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
#######################################################
# add realtime functions to the threads
# first the high speed thread
#######################################################
# update counter
addf counter.update-counters base-thread
# generate spindle pwm
addf pwmgen.make-pulses base-thread
# now the servo thread
########################################################
# capture axis and spindle positions
#addf stepgen.capture-position servo-thread
addf counter.capture-position servo-thread
# process motion commands coming from user space
#addf motion-command-handler servo-thread
# run main motion controller
#addf motion-controller servo-thread
# differentiators to make vel and acc signals
addf ddt.0 servo-thread
addf ddt.1 servo-thread
addf ddt.2 servo-thread
addf ddt.3 servo-thread
addf ddt.4 servo-thread
addf ddt.5 servo-thread
# other misc blocks
addf scale.0 servo-thread
addf pwmgen.update servo-thread
# update output info, axis and spindle
#addf stepgen.update-freq servo-thread
addf lowpass.0 servo-thread
addf mult2.1 servo-thread
addf mult2.2 servo-thread
# connect position commands from motion module to step generator
net Xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net Ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net Zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
# connect position feedback from step generators
# to motion module
net Xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net Ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net Zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
# connect enable signals for step generators
net Xen axis.0.amp-enable-out => stepgen.0.enable
net Yen axis.1.amp-enable-out => stepgen.1.enable
net Zen axis.2.amp-enable-out => stepgen.2.enable
# connect signals to step pulse generator outputs
net Xstep <= stepgen.0.step
net Xdir <= stepgen.0.dir
net Ystep <= stepgen.1.step
net Ydir <= stepgen.1.dir
net Zstep <= stepgen.2.step
net Zdir <= stepgen.2.dir
# set stepgen module scaling - get values from ini file
setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.2.position-scale [AXIS_2]SCALE
# set stepgen module accel limits - get values from ini file
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
#############################################################################
# Spindle Speed
# The spindle goes forward only
net spindle-forward <= motion.spindle-forward
net spindle-forward => pwmgen.0.enable
# PID is not used to give closed-loop spindle speed control, because at the
# highest speeds the software-based counter cannot keep up (note: with 'counter',
# it can)
# Instead, this offset and scale have been determined emperically
# -- if these numbers are accurate, then top speed at this gearing is about
# 1200 rpm
#
# note that this does not depend on the base_period, unlike freqgen
# gain = 1/1128 ~ .00089
# offset = .07
# PWM Measured RPM
# 25% 200
# 50% 482
# 60% 595
setp scale.0.gain .00089
setp scale.0.offset .07
net spindle-speed-cmd <= motion.spindle-speed-out
net spindle-speed-cmd => scale.0.in
net spindle-speed-pwm <= scale.0.out
net spindle-speed-pwm => pwmgen.0.value
# Spindle speed feedback -- spindle-speed-fb-rpm can be metered or scoped
# but beware that at the highest speeds the software-based counter cannot
# keep up, and the speed is estimated incorrectly
# The gain of the lowpass filter is a trade-off: Higher numbers track spindle
# speed better when the speed changes. Lower numbers give a more steady
# estimate of average spindle speed when the speed is nominally constant
setp lowpass.0.gain 0.01
net spindle-speed-fb-raw <= counter.0.velocity
net spindle-speed-fb-raw => lowpass.0.in
net spindle-speed-fb-filtered <= lowpass.0.out
setp mult2.1.in0 60
net spindle-speed-fb-filtered mult2.1.in1
net spindle-speed-fb-rpm mult2.1.out
setp mult2.2.in0 10
net spindle-speed-fb-rpm mult2.2.in1
net spindle-speed-visu mult2.2.out
#############################################################################
custom postgui
net stop-subs pyvcp.stop => halui.program.stop
net spindle-speed-visu => pyvcp.spindle-rpm
net surface_speed_in pyvcp.surface_speed => motion.analog-in-00
net feed_per_rev_in pyvcp.feed_per_rev => motion.analog-in-01
net cut_in pyvcp.cut => motion.analog-in-02
net target_x_in pyvcp.target_X => motion.analog-in-03
net target_z_in pyvcp.target_Z => motion.analog-in-04
net radius_in pyvcp.radius => motion.analog-in-05
net angle_in pyvcp.angle => motion.analog-in-06
net t1-req pyvcp.T1-button => halui.mdi-command-00
net t2-req pyvcp.T2-button => halui.mdi-command-01
net t3-req pyvcp.T3-button => halui.mdi-command-02
net t6-req pyvcp.T6-button => halui.mdi-command-03
net t10-req pyvcp.T10-button => halui.mdi-command-04
net t4-req pyvcp.T4-button => halui.mdi-command-05
net t5-req pyvcp.T5-button => halui.mdi-command-06
net turning-req pyvcp.Turning => halui.mdi-command-07
net facing-req pyvcp.Facing => halui.mdi-command-08
net boring-req pyvcp.Boring => halui.mdi-command-09
net parting-req pyvcp.Parting => halui.mdi-command-10
net threading-req pyvcp.Threading => halui.mdi-command-11
net drilling-req pyvcp.Drilling => halui.mdi-command-12
net chamfer-req pyvcp.Chamfer => halui.mdi-command-13
net radius-req pyvcp.Radius => halui.mdi-command-14
net surface_speed_in pyvcp.surface_speed => motion.analog-in-00
net feed_per_rev_in pyvcp.feed_per_rev => motion.analog-in-01
net target_x_in pyvcp.target_X => motion.analog-in-03
net target_z_in pyvcp.target_Z => motion.analog-in-04
are for..
core stepper
# core HAL config file for steppers
# first load the core RT modules that will be needed
# kinematics
loadrt trivkins
# motion controller, get name and thread periods from ini file
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES num_aio=8 num_dio=10
#loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
# stepper module, three step generators, all three using step/dir
loadrt stepgen step_type=0,0,0
# counting the spindle counter in software
loadrt counter num_chan=1
# misc blocks needed to do fun things
loadrt ddt count=6
# spindle speed pwm
loadrt pwmgen output_type=0
# spindle speed feedback
loadrt lowpass count=1
loadrt mult2 count=3
loadrt scale count=1
# hook functions to base thread (high speed thread for step generation)
addf stepgen.make-pulses base-thread
# hook functions to servo thread
addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
#######################################################
# add realtime functions to the threads
# first the high speed thread
#######################################################
# update counter
addf counter.update-counters base-thread
# generate spindle pwm
addf pwmgen.make-pulses base-thread
# now the servo thread
########################################################
# capture axis and spindle positions
#addf stepgen.capture-position servo-thread
addf counter.capture-position servo-thread
# process motion commands coming from user space
#addf motion-command-handler servo-thread
# run main motion controller
#addf motion-controller servo-thread
# differentiators to make vel and acc signals
addf ddt.0 servo-thread
addf ddt.1 servo-thread
addf ddt.2 servo-thread
addf ddt.3 servo-thread
addf ddt.4 servo-thread
addf ddt.5 servo-thread
# other misc blocks
addf scale.0 servo-thread
addf pwmgen.update servo-thread
# update output info, axis and spindle
#addf stepgen.update-freq servo-thread
addf lowpass.0 servo-thread
addf mult2.1 servo-thread
addf mult2.2 servo-thread
# connect position commands from motion module to step generator
net Xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net Ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net Zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
# connect position feedback from step generators
# to motion module
net Xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net Ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net Zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
# connect enable signals for step generators
net Xen axis.0.amp-enable-out => stepgen.0.enable
net Yen axis.1.amp-enable-out => stepgen.1.enable
net Zen axis.2.amp-enable-out => stepgen.2.enable
# connect signals to step pulse generator outputs
net Xstep <= stepgen.0.step
net Xdir <= stepgen.0.dir
net Ystep <= stepgen.1.step
net Ydir <= stepgen.1.dir
net Zstep <= stepgen.2.step
net Zdir <= stepgen.2.dir
# set stepgen module scaling - get values from ini file
setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.2.position-scale [AXIS_2]SCALE
# set stepgen module accel limits - get values from ini file
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
#############################################################################
# Spindle Speed
# The spindle goes forward only
net spindle-forward <= motion.spindle-forward
net spindle-forward => pwmgen.0.enable
# PID is not used to give closed-loop spindle speed control, because at the
# highest speeds the software-based counter cannot keep up (note: with 'counter',
# it can)
# Instead, this offset and scale have been determined emperically
# -- if these numbers are accurate, then top speed at this gearing is about
# 1200 rpm
#
# note that this does not depend on the base_period, unlike freqgen
# gain = 1/1128 ~ .00089
# offset = .07
# PWM Measured RPM
# 25% 200
# 50% 482
# 60% 595
setp scale.0.gain .00089
setp scale.0.offset .07
net spindle-speed-cmd <= motion.spindle-speed-out
net spindle-speed-cmd => scale.0.in
net spindle-speed-pwm <= scale.0.out
net spindle-speed-pwm => pwmgen.0.value
# Spindle speed feedback -- spindle-speed-fb-rpm can be metered or scoped
# but beware that at the highest speeds the software-based counter cannot
# keep up, and the speed is estimated incorrectly
# The gain of the lowpass filter is a trade-off: Higher numbers track spindle
# speed better when the speed changes. Lower numbers give a more steady
# estimate of average spindle speed when the speed is nominally constant
setp lowpass.0.gain 0.01
net spindle-speed-fb-raw <= counter.0.velocity
net spindle-speed-fb-raw => lowpass.0.in
net spindle-speed-fb-filtered <= lowpass.0.out
setp mult2.1.in0 60
net spindle-speed-fb-filtered mult2.1.in1
net spindle-speed-fb-rpm mult2.1.out
setp mult2.2.in0 10
net spindle-speed-fb-rpm mult2.2.in1
net spindle-speed-visu mult2.2.out
#############################################################################
custom postgui
net stop-subs pyvcp.stop => halui.program.stop
net spindle-speed-visu => pyvcp.spindle-rpm
net surface_speed_in pyvcp.surface_speed => motion.analog-in-00
net feed_per_rev_in pyvcp.feed_per_rev => motion.analog-in-01
net cut_in pyvcp.cut => motion.analog-in-02
net target_x_in pyvcp.target_X => motion.analog-in-03
net target_z_in pyvcp.target_Z => motion.analog-in-04
net radius_in pyvcp.radius => motion.analog-in-05
net angle_in pyvcp.angle => motion.analog-in-06
net t1-req pyvcp.T1-button => halui.mdi-command-00
net t2-req pyvcp.T2-button => halui.mdi-command-01
net t3-req pyvcp.T3-button => halui.mdi-command-02
net t6-req pyvcp.T6-button => halui.mdi-command-03
net t10-req pyvcp.T10-button => halui.mdi-command-04
net t4-req pyvcp.T4-button => halui.mdi-command-05
net t5-req pyvcp.T5-button => halui.mdi-command-06
net turning-req pyvcp.Turning => halui.mdi-command-07
net facing-req pyvcp.Facing => halui.mdi-command-08
net boring-req pyvcp.Boring => halui.mdi-command-09
net parting-req pyvcp.Parting => halui.mdi-command-10
net threading-req pyvcp.Threading => halui.mdi-command-11
net drilling-req pyvcp.Drilling => halui.mdi-command-12
net chamfer-req pyvcp.Chamfer => halui.mdi-command-13
net radius-req pyvcp.Radius => halui.mdi-command-14
Please Log in or Create an account to join the conversation.
07 Jan 2014 23:31 - 07 Jan 2014 23:32 #42438
by lelef
Replied by lelef on topic Semi-Manual Lathe
It is the reason for what I'm studing your macros , I think that with them I should make the lathe full cnc (with ballscrew for the Z) having non needs to use it in manual modeI forgot to say, I still have manual control of my lathe, but with the lathe macros I have never felt the need to use the manual controls. The macros basically act just like power feeds, except that they auto-restart at the end of each pass
Last edit: 07 Jan 2014 23:32 by lelef.
Please Log in or Create an account to join the conversation.
08 Jan 2014 00:15 #42440
by andypugh
The analog-in pins are how the data gets from the pyvcp panel to the G-code routines.
The halui.mdi-command pins are how the buttons run G-code routines.
Most of the changes will be seen as new entries in the INI file, especially in the [HALUI] section.
Replied by andypugh on topic Semi-Manual Lathe
Theese arethe 2 .hal files that worrks with your routines, in the custom postgui I've not undersand jet what
net surface_speed_in pyvcp.surface_speed => motion.analog-in-00
net feed_per_rev_in pyvcp.feed_per_rev => motion.analog-in-01
net target_x_in pyvcp.target_X => motion.analog-in-03
net target_z_in pyvcp.target_Z => motion.analog-in-04
net radius-req pyvcp.Radius => halui.mdi-command-14
The analog-in pins are how the data gets from the pyvcp panel to the G-code routines.
The halui.mdi-command pins are how the buttons run G-code routines.
Most of the changes will be seen as new entries in the INI file, especially in the [HALUI] section.
Please Log in or Create an account to join the conversation.
08 Jan 2014 01:37 #42449
by lelef
Replied by lelef on topic Semi-Manual Lathe
the changes I've put in the.INI are theese
in [DISPLAY]
PYVCP = custompanel.xml
[HALUI]
# add halui MDI commands here (max 64)
MDI_COMMAND = M6 T1 G43
MDI_COMMAND = M6 T2 G43
MDI_COMMAND = M6 T3 G43
MDI_COMMAND = M6 T6 G43
MDI_COMMAND = M6 T10 G43
MDI_COMMAND = M6 T4 G43
MDI_COMMAND = M6 T5 G43
MDI_COMMAND = O<turning> CALL
MDI_COMMAND = O<facing> CALL
MDI_COMMAND = O<boring> call
MDI_COMMAND = O<parting> call
MDI_COMMAND = O<threading> call
MDI_COMMAND = O<drilling> call
MDI_COMMAND = O<chamfer> call
MDI_COMMAND = O<radius> call
in [HAL]
POSTGUI_HALFILE = custom_postgui.hal
in [DISPLAY]
PYVCP = custompanel.xml
[HALUI]
# add halui MDI commands here (max 64)
MDI_COMMAND = M6 T1 G43
MDI_COMMAND = M6 T2 G43
MDI_COMMAND = M6 T3 G43
MDI_COMMAND = M6 T6 G43
MDI_COMMAND = M6 T10 G43
MDI_COMMAND = M6 T4 G43
MDI_COMMAND = M6 T5 G43
MDI_COMMAND = O<turning> CALL
MDI_COMMAND = O<facing> CALL
MDI_COMMAND = O<boring> call
MDI_COMMAND = O<parting> call
MDI_COMMAND = O<threading> call
MDI_COMMAND = O<drilling> call
MDI_COMMAND = O<chamfer> call
MDI_COMMAND = O<radius> call
in [HAL]
POSTGUI_HALFILE = custom_postgui.hal
Please Log in or Create an account to join the conversation.
08 Jan 2014 01:54 #42450
by andypugh
Does it work?
Replied by andypugh on topic Semi-Manual Lathe
the changes I've put in the.INI are theese
Does it work?
Please Log in or Create an account to join the conversation.
Moderators: piasdom
Time to create page: 0.204 seconds