Advanced Search

Search Results (Searched for: stepper spindle)

  • sajurcaju
  • sajurcaju
17 Apr 2025 18:48
Odd estop problem was created by sajurcaju

Odd estop problem

Category: General LinuxCNC Questions

My machine is self designed/built, 3 axis wood router. 2.2kW spindle, conventional steppers, LinuxCNC 2.9something, LMDE6.
G540 motor driver at 48V, software stepping with parallel port(s).

My estop circuit is really simple, there is a NC emergency stop switch with a 5k pullup. For the past couple of months, estop has been randomly triggered with no cause I've been able to find. It could happen in 10 seconds after motion enable, it could run for an hour before being triggered. I can enable LinuxCNC and watch it, 10 seconds to 10 minutes (i.e. random) and it will go into estop, with the motors powered (locked) but not moving.

Estop randomly triggering will only happen when either at least one motor is connected to the g540, or a heavy resistive load (15 Ohms, 2x across where the stepper coils would be). With no load on the g540 estop will stay off. I have looked at the power supply voltages, they are fine during an estop event (using a DVM, not looking for a transient with a scope).

The machine has been working fine before this. The only things I can think of that I've done to the setup:
1. Fried one of the outputs on the motherboard parallel port. Now I have 3 parallel ports, two PCI cards and the motherboard. I'm only using the two PCI cards, but the motherboard parallel is still visible to the system.
2. Replaced the estop cable (!) with nicer wire.

What I've tried:
1. Replaced the estop cable again. I realized that the first replacement was no longer twisted pair. I replaced it again with shielded cable, shield connected at the box containing the g540 and power supplies. Interference seems unlikely since the switch is a short.
2. Cleaned the switch contacts, which didn't help. Jumpered the switch, which didn't help.
3. Removed the C10 breakout board. One parallel port goes directly to the g540, the other went to the C10. There were only two switches connected to the C10, the estop (!) and the electrical touch probe, I just hardwired them to the parallel port. Appeared to greatly improve the problem (a lot longer between estops), but now it's back to 10 sec - 10 min.
4. Greatly improved cooling on the g540.

I don't really see how the g540 can be causing this estop problem. The only estop connection to the g540 is estop OUT from the computer. Symptoms, however, seem like the g540 has something to do with it. I did check the 48V is rock steady through an estop. Note that the g540 stays powered up (motors still powered) when an estop happens. I can reset the estop and it will be fine again for 10 sec 10 min. This doesn't sound like a thermal problem.

Any advice?
Thanks, Steve

 
  • theslawek
  • theslawek
09 Apr 2025 17:45

Need help making rotary axis behave like second spindle

Category: Advanced Configuration

I have a turning application that's better suited towards a constant RPM on the rotary. I have my A axis functioning fine right now with position control.

I'd love to be able to just issue a M3 S1000 $1 instead of playing with the inverse time mode approaches.

I've searched the forum and tried several things without luck. Honestly, anything HAL related is an instant headache nightmare for me. Believe it or not, I'm an embedded programmer and did ladder logic in college, but the HAL stuff just does NOT click for me. I'd be willing to pay for someone's time to figure this out for me. I have a project for my church that is way behind.

I'm using Probe Basic for the GUI. I'd be willing to give up some GUI control as long as I can issue gcode commands.

Attached are my current INI and primary HAL.

Tried: 
- Changing control_type from 1 to 0, but had no idea what else to do
- Considered the rosekins but that doesn't really apply to my needs

Other forum posts I've read:
C Axis as Second Spindle - LinuxCNC
Using A axis as second spindle with stepper motor - LinuxCNC
Lathe spindle question turning and milling. - LinuxCNC

Thank you.
  • irwinger
  • irwinger
03 Apr 2025 20:40

Spindle control not showing in Axis window...

Category: Basic Configuration

Coming back to my CNC wood router after a good year off (controller PC hard drive died and I got busy renovating my house). I have a new hard drive, doubled the memory (16G), fresh and latest install downloaded last week from here (linuxcnc.org) and I have everything back 'moving and stopping'... except the spindle.

I have an old TB6560 3-axis, chinese controller board (Wantai) driven from my parallel port. It has the outputs for the 3 axes (yes - that is plural for axis - I looked it up) and a spindle on/off control output that I use to control a relay that switches the 120VAC to the Dewalt router.

Back in the 'old days' (when this system worked), there was a section just below the jog/home/tool touchoff buttons where I could turn the spindle on and off. It's not there any more. I've been trying to use Google Gemini and ChatGPT for help (and they are surprisingly helpful if the question is worded well), but I'm just not getting it to work.

I'm using steppers and configured my pins using StepConf. I set the pin for the spindle as parallel port pin 9. But I'm not seeing a [SPINDLE] section in the .ini file nor am I seeing any spindle references in the .HAL file. I can't control the spindle speed (it's a router), only whether it's on or off.

Anyone out there with a good idea of where to start?

Thanks
Arden
  • ffffrf
  • ffffrf
03 Apr 2025 00:56

Using a servo as a spindle and positional axis - keep getting vague errors

Category: Advanced Configuration

Hello,

  I have a little lathe that was originally using a bldc motor. I wanted to change it out with a servo motor and use it both in positional mode, but also with turning. I went through the basic configurations in pncconf using my mesa 7i96s and got it to work as a turning machine with a stepgen spindle. 

  I read about the possibility of using mux2 to switch between the two modes but I am stuck getting strange errors like command 176, etc. I cant figure out how to debug or what I need to change in my INI and HAL (I have two hal files I am using). I am wondering if someone could look over my files and see if I am missing something obvious? I keep staring at it and am getting nowhere...

I config'd it as an XZ lathe with stepgen spindle originally. I have to HAL files I use: C+turning and the mux HAL

My current issue is as follows: The program compiles and opens. I then home axis, which causes my X and Z axis to home. I can now move those freely. However, when I go to try and move the C axis, I get "error on joint 2" and on terminal it just gives all sorts of "command" errors that I cant seem to debug further. Has anyone experienced this?

Main HAL:
# Generated by PNCconf at Wed Apr  2 16:24:00 2025
# Using LinuxCNC version:  Master (2.9)
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_eth board_ip="10.10.10.10" config="num_encoders=1 num_pwmgens=1 num_stepgens=5 sserial_port_0=0xxxxxxx" 
setp    hm2_7i96s.0.pwmgen.pwm_frequency 20000
setp    hm2_7i96s.0.pwmgen.pdm_frequency 6000000
setp    hm2_7i96s.0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.z,pid.s,pid.c
loadrt near

addf hm2_7i96s.0.read          servo-thread
addf motion-command-handler   servo-thread
addf motion-controller        servo-thread
addf pid.x.do-pid-calcs       servo-thread
addf pid.z.do-pid-calcs       servo-thread
addf pid.s.do-pid-calcs       servo-thread
addf pid.c.do-pid-calcs servo-thread
addf near.0                   servo-thread
addf hm2_7i96s.0.write         servo-thread
setp hm2_7i96s.0.dpll.01.timer-us -50
setp hm2_7i96s.0.stepgen.timer-number 1

# external output signals

# --- X-ENABLE ---
net x-enable  =>     hm2_7i96s.0.ssr.00.out-00

# --- Z-ENABLE ---
net z-enable  =>     hm2_7i96s.0.ssr.00.out-01


# external input signals

# --- MIN-HOME-X ---
net min-home-x     <=  hm2_7i96s.0.inm.00.input-00-not

# --- MAX-HOME-Z ---
net max-home-z     <=  hm2_7i96s.0.inm.00.input-01-not

# --- ESTOP-EXT ---
net estop-ext     <=  hm2_7i96s.0.inm.00.input-02


#*******************
#  AXIS X JOINT 0
#*******************

setp   pid.x.Pgain     [JOINT_0]P
setp   pid.x.Igain     [JOINT_0]I
setp   pid.x.Dgain     [JOINT_0]D
setp   pid.x.bias      [JOINT_0]BIAS
setp   pid.x.FF0       [JOINT_0]FF0
setp   pid.x.FF1       [JOINT_0]FF1
setp   pid.x.FF2       [JOINT_0]FF2
setp   pid.x.deadband  [JOINT_0]DEADBAND
setp   pid.x.maxoutput [JOINT_0]MAX_OUTPUT
setp   pid.x.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp   pid.x.maxerror 0.012700

net x-index-enable  =>  pid.x.index-enable
net x-enable        =>  pid.x.enable
net x-pos-cmd       =>  pid.x.command
net x-pos-fb        =>  pid.x.feedback
net x-output        <=  pid.x.output

# Step Gen signals/setup

setp   hm2_7i96s.0.stepgen.00.dirsetup        [JOINT_0]DIRSETUP
setp   hm2_7i96s.0.stepgen.00.dirhold         [JOINT_0]DIRHOLD
setp   hm2_7i96s.0.stepgen.00.steplen         [JOINT_0]STEPLEN
setp   hm2_7i96s.0.stepgen.00.stepspace       [JOINT_0]STEPSPACE
setp   hm2_7i96s.0.stepgen.00.position-scale  [JOINT_0]STEP_SCALE
setp   hm2_7i96s.0.stepgen.00.step_type        0
setp   hm2_7i96s.0.stepgen.00.control-type     1
setp   hm2_7i96s.0.stepgen.00.maxaccel         [JOINT_0]STEPGEN_MAXACCEL
setp   hm2_7i96s.0.stepgen.00.maxvel           [JOINT_0]STEPGEN_MAXVEL
setp   hm2_7i96s.0.stepgen.00.step.invert_output   true

# ---closedloop stepper signals---

net x-pos-cmd    <= joint.0.motor-pos-cmd
net x-vel-cmd    <= joint.0.vel-cmd
net x-output     => hm2_7i96s.0.stepgen.00.velocity-cmd
net x-pos-fb     <= hm2_7i96s.0.stepgen.00.position-fb
net x-pos-fb     => joint.0.motor-pos-fb
net x-enable     <= joint.0.amp-enable-out
net x-enable     => hm2_7i96s.0.stepgen.00.enable

# ---setup home / limit switch signals---

net min-home-x     =>  joint.0.home-sw-in
net min-home-x     =>  joint.0.neg-lim-sw-in
net x-pos-limit     =>  joint.0.pos-lim-sw-in

#*******************
#  AXIS Z JOINT 1
#*******************

setp   pid.z.Pgain     [JOINT_1]P
setp   pid.z.Igain     [JOINT_1]I
setp   pid.z.Dgain     [JOINT_1]D
setp   pid.z.bias      [JOINT_1]BIAS
setp   pid.z.FF0       [JOINT_1]FF0
setp   pid.z.FF1       [JOINT_1]FF1
setp   pid.z.FF2       [JOINT_1]FF2
setp   pid.z.deadband  [JOINT_1]DEADBAND
setp   pid.z.maxoutput [JOINT_1]MAX_OUTPUT
setp   pid.z.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp   pid.z.maxerror 0.012700

net z-index-enable  =>  pid.z.index-enable
net z-enable        =>  pid.z.enable
net z-pos-cmd       =>  pid.z.command
net z-pos-fb        =>  pid.z.feedback
net z-output        <=  pid.z.output

# Step Gen signals/setup

setp   hm2_7i96s.0.stepgen.01.dirsetup        [JOINT_1]DIRSETUP
setp   hm2_7i96s.0.stepgen.01.dirhold         [JOINT_1]DIRHOLD
setp   hm2_7i96s.0.stepgen.01.steplen         [JOINT_1]STEPLEN
setp   hm2_7i96s.0.stepgen.01.stepspace       [JOINT_1]STEPSPACE
setp   hm2_7i96s.0.stepgen.01.position-scale  [JOINT_1]STEP_SCALE
setp   hm2_7i96s.0.stepgen.01.step_type        0
setp   hm2_7i96s.0.stepgen.01.control-type     1
setp   hm2_7i96s.0.stepgen.01.maxaccel         [JOINT_1]STEPGEN_MAXACCEL
setp   hm2_7i96s.0.stepgen.01.maxvel           [JOINT_1]STEPGEN_MAXVEL
setp   hm2_7i96s.0.stepgen.01.step.invert_output   true

# ---closedloop stepper signals---

net z-pos-cmd    <= joint.1.motor-pos-cmd
net z-vel-cmd    <= joint.1.vel-cmd
net z-output     => hm2_7i96s.0.stepgen.01.velocity-cmd
net z-pos-fb     <= hm2_7i96s.0.stepgen.01.position-fb
net z-pos-fb     => joint.1.motor-pos-fb
net z-enable     <= joint.1.amp-enable-out
net z-enable     => hm2_7i96s.0.stepgen.01.enable

# ---setup home / limit switch signals---

net max-home-z     =>  joint.1.home-sw-in
net z-neg-limit     =>  joint.1.neg-lim-sw-in
net max-home-z     =>  joint.1.pos-lim-sw-in


#*******************
#  AXIS C JOINT 2
#*******************
setp   pid.c.Pgain     [JOINT_2]P
setp   pid.c.Igain     [JOINT_2]I
setp   pid.c.Dgain     [JOINT_2]D
setp   pid.c.bias      [JOINT_2]BIAS
setp   pid.c.FF0       [JOINT_2]FF0
setp   pid.c.FF1       [JOINT_2]FF1
setp   pid.c.FF2       [JOINT_2]FF2
setp   pid.c.deadband  [JOINT_2]DEADBAND
setp   pid.c.maxoutput [JOINT_2]MAX_OUTPUT
setp   pid.c.error-previous-target true
setp   pid.c.maxerror 0.012700

net c-index-enable  =>  pid.c.index-enable
net c-axis-pos-cmd => pid.c.command
net c-pos-fb        =>  pid.c.feedback
net c-output        <=  pid.c.output

# ---closedloop stepper setup---

net c-vel-cmd    <= joint.2.vel-cmd
net c-output     => hm2_7i96s.0.stepgen.04.velocity-cmd
net c-pos-fb     <= hm2_7i96s.0.stepgen.04.position-fb
net c-pos-fb     => joint.2.motor-pos-fb
net c-enable     <= joint.2.amp-enable-out
net spindle-enable => pid.c.enable



#*******************
#  SPINDLE
#*******************

setp   pid.s.Pgain     [SPINDLE_0]P
setp   pid.s.Igain     [SPINDLE_0]I
setp   pid.s.Dgain     [SPINDLE_0]D
setp   pid.s.bias      [SPINDLE_0]BIAS
setp   pid.s.FF0       [SPINDLE_0]FF0
setp   pid.s.FF1       [SPINDLE_0]FF1
setp   pid.s.FF2       [SPINDLE_0]FF2
setp   pid.s.deadband  [SPINDLE_0]DEADBAND
setp   pid.s.maxoutput [SPINDLE_0]MAX_OUTPUT
setp   pid.s.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp   pid.s.maxerror 0.012700

net spindle-index-enable  =>  pid.s.index-enable
net spindle-enable        =>  pid.s.enable
net spindle-vel-cmd-rpm     => pid.s.command
net spindle-vel-fb-rpm      => pid.s.feedback
net spindle-output        <=  pid.s.output

# Step Gen signals/setup

setp   hm2_7i96s.0.stepgen.04.dirsetup        [SPINDLE_0]DIRSETUP
setp   hm2_7i96s.0.stepgen.04.dirhold         [SPINDLE_0]DIRHOLD
setp   hm2_7i96s.0.stepgen.04.steplen         [SPINDLE_0]STEPLEN
setp   hm2_7i96s.0.stepgen.04.stepspace       [SPINDLE_0]STEPSPACE
setp   hm2_7i96s.0.stepgen.04.position-scale  [SPINDLE_0]STEP_SCALE
setp   hm2_7i96s.0.stepgen.04.step_type        0
setp   hm2_7i96s.0.stepgen.04.control-type     1
setp   hm2_7i96s.0.stepgen.04.maxaccel         [SPINDLE_0]STEPGEN_MAXACCEL
setp   hm2_7i96s.0.stepgen.04.maxvel           [SPINDLE_0]STEPGEN_MAXVEL
setp   hm2_7i96s.0.stepgen.04.step.invert_output   true

#net machine-is-on           =>  hm2_7i96s.0.stepgen.04.enable
#net spindle-vel-cmd-rps     =>  hm2_7i96s.0.stepgen.04.velocity-cmd
# ---Encoder feedback signals/setup---

setp    hm2_7i96s.0.encoder.00.counter-mode 0
setp    hm2_7i96s.0.encoder.00.filter 1
setp    hm2_7i96s.0.encoder.00.index-invert 0
setp    hm2_7i96s.0.encoder.00.index-mask 0
setp    hm2_7i96s.0.encoder.00.index-mask-invert 0
setp    hm2_7i96s.0.encoder.00.scale  [SPINDLE_0]ENCODER_SCALE

net spindle-revs             <=   hm2_7i96s.0.encoder.00.position
net spindle-vel-fb-rps       <=   hm2_7i96s.0.encoder.00.velocity
net spindle-vel-fb-rpm       <=   hm2_7i96s.0.encoder.00.velocity-rpm
net spindle-index-enable     <=>  hm2_7i96s.0.encoder.00.index-enable

# ---setup spindle control signals---

net spindle-vel-cmd-rps        <=  spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs    <=  spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm        <=  spindle.0.speed-out
net spindle-vel-cmd-rpm-abs    <=  spindle.0.speed-out-abs
net spindle-enable             <=  spindle.0.on
net spindle-cw                 <=  spindle.0.forward
net spindle-ccw                <=  spindle.0.reverse
net spindle-brake              <=  spindle.0.brake
net spindle-revs               =>  spindle.0.revs
net spindle-at-speed           =>  spindle.0.at-speed
net spindle-vel-fb-rps         =>  spindle.0.speed-in
net spindle-index-enable      <=>  spindle.0.index-enable

# ---Setup spindle at speed signals---

net spindle-vel-cmd-rps    =>  near.0.in1
net spindle-vel-fb-rps         =>  near.0.in2
net spindle-at-speed       <=  near.0.out
setp near.0.scale 1.000000
setp near.0.difference 3.333333


#******************************
# connect miscellaneous signals
#******************************

#  ---HALUI signals---

net axis-select-x  halui.axis.x.select
net jog-x-pos      halui.axis.x.plus
net jog-x-neg      halui.axis.x.minus
net jog-x-analog   halui.axis.x.analog
net x-is-homed     halui.joint.0.is-homed
net axis-select-z  halui.axis.z.select
net jog-z-pos      halui.axis.z.plus
net jog-z-neg      halui.axis.z.minus
net jog-z-analog   halui.axis.z.analog
net z-is-homed     halui.joint.1.is-homed
net jog-selected-pos      halui.axis.selected.plus
net jog-selected-neg      halui.axis.selected.minus
net spindle-manual-cw     halui.spindle.0.forward
net spindle-manual-ccw    halui.spindle.0.reverse
net spindle-manual-stop   halui.spindle.0.stop
net machine-is-on         halui.machine.is-on
net jog-speed             halui.axis.jog-speed
net MDI-mode              halui.mode.is-mdi

#  ---coolant signals---

net coolant-mist      <=  iocontrol.0.coolant-mist
net coolant-flood     <=  iocontrol.0.coolant-flood

#  ---probe signal---

net probe-in     =>  motion.probe-input

#  ---motion control signals---

net in-position               <=  motion.in-position
net machine-is-enabled        <=  motion.motion-enabled

#  ---digital in / out signals---

#  ---estop signals---

net estop-out     <=  iocontrol.0.user-enable-out
net estop-ext     =>  iocontrol.0.emc-enable-in

#  ---manual tool change signals---

net tool-change-request    <= iocontrol.0.tool-change
net tool-change-confirmed  => iocontrol.0.tool-changed
net tool-number            <= iocontrol.0.tool-prep-number

#  ---Use external manual tool change dialog---

loadusr -W hal_manualtoolchange
net tool-change-request    =>  hal_manualtoolchange.change
net tool-change-confirmed  <=  hal_manualtoolchange.changed
net tool-number            =>  hal_manualtoolchange.number

#  ---ignore tool prepare requests---
net tool-prepare-loopback   iocontrol.0.tool-prepare      =>  iocontrol.0.tool-prepared

Auxillary HAL
# Include your custom HAL commands here
# This file will not be overwritten when you run PNCconf again
loadrt mux2 count=1
addf mux2.0 servo-thread

# Mux inputs
net c-axis-pos-cmd joint.2.motor-pos-cmd => mux2.0.in0
net spindle-vel-cmd-rpm    => mux2.0.in1


net spindle-enable            => mux2.0.sel
net spindle-enable => hm2_7i96s.0.stepgen.04.enable

# Mux output to stepgen.04
net mux-out mux2.0.out => hm2_7i96s.0.stepgen.04.position-cmd


# Feedback and enable
net c-pos-fb <= hm2_7i96s.0.stepgen.04.position-fb
net c-pos-fb => joint.2.motor-pos-fb

INI FILE
# Generated by PNCconf at Wed Apr  2 16:24:00 2025
# Using LinuxCNC version:  Master (2.9)
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

[EMC]
MACHINE = Turn+C_lathe
DEBUG = 0
VERSION = 1.1

[DISPLAY]
DISPLAY = axis
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.000000
MAX_SPINDLE_OVERRIDE = 1.000000
MIN_SPINDLE_OVERRIDE = 0.500000
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/maksym/linuxcnc/nc_files
PYVCP = pyvcp-panel.xml
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
LATHE = 1
POSITION_FEEDBACK = ACTUAL
DEFAULT_LINEAR_VELOCITY = 13.333333
MAX_LINEAR_VELOCITY = 41.666667
MIN_LINEAR_VELOCITY = 0.500000
DEFAULT_ANGULAR_VELOCITY = 12.000000
MAX_ANGULAR_VELOCITY = 180.000000
MIN_ANGULAR_VELOCITY = 1.666667
EDITOR = gedit
GEOMETRY = xyz
CYCLE_TIME = 100

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = linuxcnc.var
RS274NGC_STARTUP_CODE = G21 G40 G90 G94 G97 G64 P0.025

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
SERVO_PERIOD = 1000000

[HMOT]
# **** This is for info only ****
CARD0=hm2_7i96s.0

[HAL]
HALUI = halui
HALFILE = Turn+C_lathe.hal
HALFILE = c_axis_mux.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal
SHUTDOWN = shutdown.hal

[HALUI]

[KINS]
JOINTS = 3
KINEMATICS = trivkins coordinates=XZC

[TRAJ]
COORDINATES =  XZC
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 4.17
MAX_LINEAR_VELOCITY = 41.67
NO_FORCE_HOMING = 1

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl

#******************************************
[AXIS_X]
MAX_VELOCITY = 41.666666666666664
MAX_ACCELERATION = 500.0
MIN_LIMIT = -0.0
MAX_LIMIT = 100.0

[JOINT_0]
TYPE = LINEAR
HOME = 20.0
FERROR = 10.0
MIN_FERROR = 1.0
MAX_VELOCITY = 41.666666666666664
MAX_ACCELERATION = 500.0
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 52.08
STEPGEN_MAXACCEL = 625.00
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0.0
# these are in nanoseconds
DIRSETUP   = 10000
DIRHOLD    = 10000
STEPLEN    = 10000
STEPSPACE  = 10000
STEP_SCALE = -800.0
MIN_LIMIT = -0.0
MAX_LIMIT = 100.0
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -13.333333
HOME_LATCH_VEL = -0.500000
HOME_FINAL_VEL = 5.000000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 2
#******************************************

#******************************************
[AXIS_Z]
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
MIN_LIMIT = -432.0
MAX_LIMIT = 0.0

[JOINT_1]
TYPE = LINEAR
HOME = -20.0
FERROR = 10.0
MIN_FERROR = 1.0
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 31.25
STEPGEN_MAXACCEL = 937.50
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0.0
# these are in nanoseconds
DIRSETUP   = 10000
DIRHOLD    = 10000
STEPLEN    = 10000
STEPSPACE  = 10000
STEP_SCALE = 800.0
MIN_LIMIT = -432.0
MAX_LIMIT = 0.0
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -13.333333
HOME_LATCH_VEL = -0.500000
HOME_FINAL_VEL = 5.000000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1
#******************************************
#******************************************
[AXIS_C]
MAX_VELOCITY = 360
MAX_ACCELERATION = 720
MIN_LIMIT = -999999
MAX_LIMIT = 999999
ANGULAR = 1

[JOINT_2]
TYPE = ANGULAR
HOME = 0
FERROR = 5
MIN_FERROR = 1.0
MAX_VELOCITY = 360
MAX_ACCELERATION = 720
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 400
STEPGEN_MAXACCEL = 800
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0.0
# these are in nanoseconds
DIRSETUP   = 10000
DIRHOLD    = 10000
STEPLEN    = 5000
STEPSPACE  = 5000
STEP_SCALE = 27.77778
HOME_SEQUENCE = 0

[SPINDLE_0]
MAX_VELOCITY = 3.3333333333333335
MAX_ACCELERATION = 300.0
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 4.17
STEPGEN_MAXACCEL = 375.00
P = 0.0
I = 0.0
D = 0.0
FF0 = 1.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 2000.0
ENCODER_SCALE = 8000.0
# these are in nanoseconds
DIRSETUP   = 10000
DIRHOLD    = 10000
STEPLEN    = 5000
STEPSPACE  = 5000
STEP_SCALE = -1000.0
  • konrad
  • konrad
31 Mar 2025 14:54
config all good on mesa 7i96s? was created by konrad

config all good on mesa 7i96s?

Category: General LinuxCNC Questions

Hello everyone,I've recently converted a second hand CNC router from Mach3 with ESS to LinuxCNC with a Mesa 7i96s board. I've used PNCconf to generate my initial configuration, but I'd appreciate if someone could review my settings and let me know if everything looks okay.Machine Specs:
  • X460, Y750mm, Z300   
  • 20mm linear rails
  • 10mm pitch ballscrews, 20mm diameter
  • Construction: aluminum profiles bolted to 12mm steel plates, welded gantry sides
  • Motors: Y-axis 6.8Nm stepper, Z + X-axis 3Nm stepper
  • Drives: DM556 V1 48v
  • Spindle: 24K RPM 2.2kW ER20
  • inductive endstops 
  • good latency values mostly sub 3000ns servo
PNCconf Settings:
  • Step On-Time: 5000 nanoseconds
  • Maximum Velocity: 3000 mm/min
  • Maximum Acceleration: 400 mm/sec²
Key Config Values from INI File:
  • X travel: -2.0mm to 460.0mm (STEP_SCALE = -200.0)
  • Y travel: -2.0mm to 750.0mm (STEP_SCALE = 200.0)
  • Z travel: -300.0mm to 0.01mm (STEP_SCALE = -400.0)
  • Step timing: DIRSETUP/DIRHOLD = 10000ns, STEPLEN/STEPSPACE = 5000ns
Questions:
  1. I see a
    z-neg-limit
    signal in my HAL file that doesn't seem to be connected to anything - is this a problem?
  2. Are my velocity and acceleration values reasonable for this type of machine?
  3. Any other issues or recommendations before I start cutting?

changes/upgrades
As I am already in the process of messing with the machine, would you recommend any meaningful upgrades or changes to it? I will mostly mill soft materials like wood but also want to try aluminium. 
  1. should I change the microstepping ( it is 10x at the moment)
  2. other stepper motor or drivers?
  3. switch to s curve compact fork?
I've attached HAL and INI files below for reference. Thanks in advance for any advice!

 
  • Routerworks
  • Routerworks
28 Mar 2025 14:23
Replied by Routerworks on topic Need help setting up XYYZA for stepper motors

Need help setting up XYYZA for stepper motors

Category: General LinuxCNC Questions

Many thanks to both.  Good catch 16, 17 not 016, 017.  That eliminated that problem then it said pin 16 was already in use.  I ommitted the "spindle out pin 16 and 17" then it worked.  
4th Axis Mill opened up.
Can't find control for the A axis and some of the other directional keys have been switched around.  Where would I correct them.
Mandy, Many, Many thanks,

Routerworks
  • PCW
  • PCW's Avatar
27 Mar 2025 18:12 - 27 Mar 2025 18:21

Need help setting up XYYZA for stepper motors

Category: General LinuxCNC Questions

setp stepgen.4.position-scale [JOINT_4]SCALE
setp stepgen.4.steplen 1
setp stepgen.4.stepspace 0
setp stepgen.4.dirhold 40000
setp stepgen.4.dirsetup 40000
setp stepgen.4.maxaccel [JOINT_3]STEPGEN_MAXACCEL
net zpos-cmd joint.4.motor-pos-cmd => stepgen.4.position-cmd
net zpos-fb stepgen.4.position-fb => joint.4.motor-pos-fb
net zstep <= stepgen.4.step
net zdir <= stepgen.4.dir
net zenable joint.3.amp-enable-out => stepgen.4.enable

net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in

The red text probably should be:
setp stepgen.4.maxaccel [JOINT_4]STEPGEN_MAXACCEL
net apos-cmd joint.4.motor-pos-cmd => stepgen.4.position-cmd
net apos-fb stepgen.4.position-fb => joint.4.motor-pos-fb
net astep <= stepgen.4.step
net adir <= stepgen.4.dir
net aenable joint.4.amp-enable-out => stepgen.4.enable

Note that you also need to connect the astep and adir signals to the appropriate
parallel port pins similar to this (z highlighted ):

setp parport.0.pin-01-out-invert 1
net estop-out => parport.0.pin-01-out
net xstep => parport.0.pin-02-out
setp parport.0.pin-02-out-reset 1
net xdir => parport.0.pin-03-out
net y0step => parport.0.pin-04-out
setp parport.0.pin-04-out-reset 1
net y0dir => parport.0.pin-05-out
net zstep => parport.0.pin-06-out
setp parport.0.pin-06-out-reset 1
net zdir => parport.0.pin-07-out

net y1step => parport.0.pin-08-out
setp parport.0.pin-08-out-reset 1
net y1dir => parport.0.pin-09-out
net spindle-cw => parport.0.pin-14-out
net spindle-pwm => parport.0.pin-16-out
net xenable => parport.0.pin-17-out
 
  • aharner
  • aharner
24 Mar 2025 20:43

Connecting Mesa 7i76 to Sprint 1200 DC Controller

Category: General LinuxCNC Questions

Good evening.  I am not sure if this is the right area to ask this question, but here goes.  I am converting a Novaturn lathe that has a Sprint 1200 (400) DC motor controller and I am using a Mesa 7i76U to handle the connections.  I have the steppers moving properly, the e stop and limits working properly but am very apprehensive about connecting to the Sprint 1200 because I dont want to damage anything.  Anyway, after days of reading, testing, and more reading I am finally reaching out for help.  Does anyone know the correct wiring to connect the 7i76 (TB4) spindle connectors to the appropriate Sprint connectors?  I need to be able to turn the motor on, adjust speed, etc.  The motor does not reverse.  The contacts on the Sprint are (1) +10, (2) MIN, (3) I/P, 4 COM, (5) RUN, (6) TACH, (7) COM.  Any guidance would be appreciated.
  • gm001
  • gm001
21 Mar 2025 05:21
Hardware advice was created by gm001

Hardware advice

Category: Computers and Hardware

Hi everyone,
I'm hoping that someone can help me get my head wrapped around this, and point me in the right direction.  I've spent over a dozen hours reading through threads on this forum and elsewhere - yet, I can't figure out how to proceed.

My machine is a Bridgeport Series I CNC (Boss 6) mill - and it's sitting in my shop in original condition.  I'm new to CNC (having only dabbled with my Ender 3 3D printer).  However, a close friend of mine who's helping me has a couple of HAAS mills and is a guru with Autodesk Fusion.

I've investigated numerous options for updating this machine.  The more I study this, the more confused I've become!  The simplest answer for a person like me seems to be to install an Acorn board.  I'd rather not.  I don't want to get vendor-locked (more than I have to).  The thought of a company going under and leaving me in the position of having to gut the machine and start over is not appealing.  I don't want to pay a subscription.  I like the openness and configurability of LinuxCNC, and I'm a big fan and daily user of Linux (Red Hat Academy instructor).

My goals:
* Get the old Bridgeport back to making chips again.
* Have the ability to both use this machine as a CNC, and as a glorified manual machine (using LinuxCNC as a DRO).
* Not spend thousands of Dollars on this project (if possible!).

My thoughts:
* Mount a 12" touchsceen monitor in the original control panel housing for interacting with LinuxCNC.
* Hang a pendant on the side of the original control panel housing.
* Pick up a Huanyang VFD for the spindle drive (these seem to be well-supported and well regarded?).
* Replace the ancient original Bridgeport steppers with modern closed-loop NEMA 34's (1100-1200 oz in).

My questions:
* What should I run LinuxCNC on?  I've got a spare RPi 4 sitting in my drawer.  I've got a couple of Supermicro Intel Atom-based ITX server motherboards lying around.  What's the most intelligent way to go?
* It seems that a parallel port interface is the "old-school" way of doing things.  Now, it seems that most prefer an Ethernet interface.  Is there a disadvantage of going one way or another?
* Since I have to replace the steppers anyway, is it foolish to go with a "traditional" setup rather than Ethercat?  It seems like Ethercat will be considerably more expensive (like twice the price or more) - but is it worth the price?
* Everyone seems to agree that Mesa boards are the "gold standard."  How do Pico Systems' boards compare?  Jon Elson lives like 20 miles from my house.  Does anyone have experience with his customer service?  Is it foolish to consider anything other than a Mesa?
* If I go with a Mesa setup, which direction should I go?  If I use the RPi, I could go with the 7C80 or 7C81 - I could also run an Ethernet setup.  If I use the server motherboard, I could go with a parallel port setup or an Ethernet setup.  Is there an advantage of going one way or another, here?
* If I go with a given Mesa board, what else will I need to buy?  It seems that some of the Mesa cards (like the 7C80 and the 7I95T) will hook directly to the stepper drives, while others require a separate daughter card (BoB)?
* What hardware (if any) would I need in order to use the encoders on the steppers as a DRO?  Will any of my hardware selection above affect my ability to have this feature?
* Will a cheap Amazon/Aliexpress stepper motor/drive/power supply set work, or will I need to buy the stepper drives separately?  If I need a particular stepper drive, should I go with a Gecko or something else?
* If I run a touchscreen and a pendant, is there any reason why I will need a keyboard hooked up to this machine (once it is configured)?

Sorry for all of the (possibly stupid) questions.  The DIY CNC and especially the LinuxCNC ecosystem is far more vast than I imagined.  I really did attempt to "do my homework" before asking.  There just seems to be a lot of somewhat conflicting information (possibly, due to changing technologies and best practices over the years?).

Thanks for any advice that you can provide to me!
  • richcolvin
  • richcolvin's Avatar
20 Mar 2025 16:54
C Axis as Second Spindle was created by richcolvin

C Axis as Second Spindle

Category: General LinuxCNC Questions

I am looking for guidance on how to setup the C axis as a second spindle.  This is for a rose engine lathe (otbok.info/index.php?n=Main.RoseEngineLathe) where we need to use:
  1. the Spindle to rotate the piece, and
  2. the C axis to rotate the rosettes used to impart the design
We turn these quite slowly, certainly less than 10 RPM, and at times speeds approaching 3 or 4 minutes per revolution.  Thusly we are using stepper motors for both axes.

The end goal is to drive the spindle and the C axis simultaneously, but specifying a relationship percentage for their rotational speeds.  For example, 
RPM of the C-axis = x% of RPM of the Spindle
Is there some documentation I can read which describes 
  1. How to setup LinuxCNC to treat the C-axis as a secondary spindle, and
  2. The G-code I would use.
Apologies if this is already been asked and answered:  I searched the forum and could not find it.
  • unknown
  • unknown
19 Mar 2025 12:24
Replied by unknown on topic EtherCAT Closed-Loop Drive Options for Lathe

EtherCAT Closed-Loop Drive Options for Lathe

Category: EtherCAT

Personally I would close the feed back loop with linear encoders, this will give actual feed back position, with a mesa FPGA this is a very well worn track with plenty of info available. Same for the spindle and encoder that also employs an index.
Sorry I'm too broke to have experience with Ethercat so really can't make a comment that maybe of use.
What kind of lathe are you working with ?
I'm kind of lucky with my Frankenstein Myford ML7\Super 7 in that I have plenty of room for the stepper motors, the only issue was the X axis, but I was able to use 10mm ballscrew and unlike most other lathes the nut is fixed to the carriage casting rather than running under the cross slide.

And for my techno babble mate, lathes conventionally use a XZ setup, Z being the carriage and X being the cross slide.
Also very few lathes, I can't think any that the average Joe would have access to lathes that use linear rails, mostly dove tails for cross slide and top slide and either plain rectangular ways for the bed,eg Myford, rectangular single prism, think 7x14 mini lathe or dual prism for the more industrial type. These are just the ones I can of off the top of my head.

Sorry to the OP for getting a bit off track.
  • scda
  • scda's Avatar
17 Mar 2025 14:29

caxis.comp with stepper motor / gear connection to spindle

Category: HAL

Luckly I installed a disk brake on my lathe's spindle during the retrofit (brake is operated with pressurized air). This works pretty well for holding the spindle during cutting in a specific angle.
  • spumco
  • spumco
16 Mar 2025 23:54

caxis.comp with stepper motor / gear connection to spindle

Category: HAL

Not a problem, hope it was helpful.

Regarding spindle orient... I'd hoped to use orient for my lathe as a 'poor-man's c-axis' once I realized that caxis.comp wasn't doing what I wanted.

I quickly realized that is orient by itself won't hold a position.  You either need a spindle brake, or you need a servo drive that is in position mode (internally).  Servo drives in velocity-mode don't necessarily hold a position rigidly, but LCNC is perfectly capable of treating a position-mode servo drive as a spindle.

LCNC can orient a plain old VFD to a pretty exact position, but that does no good if you're trying to use live tools once the spindle is in the appropriate position.

I think you're on the right track for your first steps.  Get the spindle working as well as you can, then add the orient function.  Orient is simple in concept, but tuning and nailing the position can be tricky and time-consuming.  Especially if you have a heavy spindle/chuck.

Something else to consider... your spindle encoder need not be super-high resolution for spindle/orient functions, but for eventual c-axis work the higher the resolution the better.  And that can become a rabbit-hole when trying to balance high encoder speeds with high resolution... while remaining budget friendly.
  • scda
  • scda's Avatar
16 Mar 2025 21:08

caxis.comp with stepper motor / gear connection to spindle

Category: HAL

Thanks a lot for the detailed reply. Really appreciated.

I know that this is not an official LCNC function. I was expecting this to be troublesome, but with your feedback, I might consider leaving it be for the moment.
If I find time I will try to understand ACIERA's setup and try this out.

I might just setup spindle orient function for now. This should be fairly straight forward.

Cheers,
Dave
  • spumco
  • spumco
16 Mar 2025 18:30

caxis.comp with stepper motor / gear connection to spindle

Category: HAL

Caxis.comp was originally written by Andy Pugh to control a single motor for velocity and positioning mode (spindle & c-axis).  I don't think it was intended to control two separate motors.

It's not part of the mainline LCNC components, nor are there many people using it... so I don't think you're going to find a wealth of info on implementation.  For your situation, there may be better approaches to managing your dual-motor arrangement.

The main hurdle to overcome for any spindle/axis (dual or single motor) is how to manage the axis encoder.  Once you switch from axis to velocity mode the axis will generate a following error when LCNC sees the 'axis' encoder moving away from the commanded position.  So we have to 'trick' LCNC and adjust the encoder value somehow.
  • caxis.comp does this by intercepting the encoder output, and then subtracting the encoder change from the encoder starting value before sending that to the axis PID feedback input.
  • Another method is to disconnect the encoder output from the axis feedback in spindle mode
The problem with #2 above is that when the encoder is re-connected (switch to axis mode) there is a significant following error instantly present.  The switching scheme @Aciera came up with a while back for his lathe (using a single motor) looks like this:
  • Step 0
    • LCNC starts up with main spindle motor disabled
    • Home C-axis before any spindle moves (at start of LCNC session). 
  • Step 1
    • Command C-axis to C0
    • Disconnect spindle encoder
    • Enable spindle mode
      • in Aciera's case that means switching his drive from position to velocity mode
      • for a two-motor arrangement that means retracting the axis motor and enabling the main spindle motor via M-codes & digital inputs/outputs
  • Step 2 - Run spindle as a spindle
  • Step 3
    • Use orient.comp to orient the spindle to 0
    • Disable the spindle motor
    • Enable the axis motor
    • Reconnect the spindle encoder
If everything is adjusted properly (orient offset, C0 actual position, etc.) there should be a very small difference between Orient-0 and Caxis-0, resulting in (hopefully) a small twitch of the spindle at most.

For the past year I've been fiddling with caxis.comp and have recently come to the conclusion that it isn't going to work for me.  There are a couple of annoying things I don't like (can't disconnect the spindle easily to manually rotate the chuck), but the serious problem I found was that spindle synchronized motion wasn't working properly.

Something - and I'm not smart enough to figure out exactly what it was - in the caxis.comp scheme was causing erratic behavior (big motion jumps) during tapping and threading commands.  Once I removed caxis.comp and use the spindle as just a spindle the tapping/threading stuff started working as expected.  So now I'm re-doing a bunch of stuff in my config and will eventually wind up with something very similar to Aciera's arrangement.

So to sum up, I'd suggest abandoing caxis.comp for your dual-motor lathe and search for Aciera's config.  I know he posted his files in the past year or so, although I think he's been working on a glitch with the encoder disconnect function recently.
Displaying 31 - 45 out of 145 results.
Time to create page: 0.527 seconds
Powered by Kunena Forum