Advanced Search

Search Results (Searched for: stepper spindle)

  • Hakan
  • Hakan
30 Oct 2025 21:18

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

Phuu, I have no idea why it didn't work right away. I am happy that some patience paid off.

You have some settings in the example hal file
setp cia402pv.Spindle.velo-scale 2000
setp cia402pv.Spindle.acceleration 100
setp cia402pv.Spindle.deceleration 100
setp cia402pv.Spindle.quickstop-acceleration 300
quickstop isn't used (yet), but the other values you need to adapt to your liking.
velo-scale is how many steps there are per revolution. It is probably the encoder resolution for you.
Gearing goes into that number as well.
That number also affects the velocity feedback.
Accelerations are revs/s^2. Easiest is maybe to use halshow and set different values while testing start and stop.
 
  • Will_cnc
  • Will_cnc
30 Oct 2025 20:33
Replied by Will_cnc on topic Stepper online A6 Servo motor as Spindle motor

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

Big thanks for your help Hakan

I have retyped a few of the lines in  the Hal file and 

LINUX NOW OPENS AND THE SPINDLE RUNS !!! 

Next issues to solve 
Correct spindle speed ratio
When assigning the spindle to run at a certain speed the scaling is definitely off and is very slow . 
the belt setup is 2:1 how do I configure to this ? 

The spindle also does display that actual speed via the encoder signal any tips on how to change this ? 

Main issue: 
In getting the spindle to run it has caused the rest of the machine to jitter and run what seems like out of sync again 
changing the following " refClockSyncCycles="-5">" fixed the issue last time 
what else could now be causing the issue ? 
Many thanks 
Will 
  • Hakan
  • Hakan
30 Oct 2025 20:16

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

That looks perfectly fine.
 What's the problem when this is called inside your hal file?
Let's try that. Add the line
show all
after the
loadrt cia402pv names=cia402pv.Spindle
line. It should show many more pins, also the cia402pv pins.
  • Will_cnc
  • Will_cnc
30 Oct 2025 19:38
Replied by Will_cnc on topic Stepper online A6 Servo motor as Spindle motor

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

cnc@raspberrypi:~$ % halrun
halcmd: loadrt cia402pv names=cia402pv.Spindle
Note: Using POSIX realtime
halcmd: show all
bash: fg: %: no such job
bash: halcmd:: command not found
bash: Note:: command not found
bash: halcmd:: command not found
cnc@raspberrypi:~$ halrun
halcmd: loadrt cia402pv names=cia402pv.Spindle
Note: Using POSIX realtime
halcmd: show all
Loaded HAL Components:
ID Type Name PID State
4 RT cia402pv ready
2 User halcmd2602 2602 ready

Component Pins:
Owner Type Dir Value Name
4 float IN 0 cia402pv.Spindle.acceleration
4 u32 OUT 0x00000000 cia402pv.Spindle.controlword
4 float IN 0 cia402pv.Spindle.deceleration
4 s32 OUT 0 cia402pv.Spindle.drv-acceleration
4 s32 IN 0 cia402pv.Spindle.drv-actual-position
4 s32 IN 0 cia402pv.Spindle.drv-actual-velocity
4 s32 OUT 0 cia402pv.Spindle.drv-deceleration
4 bit OUT FALSE cia402pv.Spindle.drv-fault
4 s32 OUT 0 cia402pv.Spindle.drv-quickstop-deceleration
4 s32 OUT 0 cia402pv.Spindle.drv-target-position
4 s32 OUT 0 cia402pv.Spindle.drv-target-velocity
4 bit IN FALSE cia402pv.Spindle.enable
4 bit IN FALSE cia402pv.Spindle.fault-reset
4 bit I/O FALSE cia402pv.Spindle.home
4 s32 OUT 0 cia402pv.Spindle.opmode
4 bit OUT FALSE cia402pv.Spindle.opmode-cyclic-position
4 bit OUT FALSE cia402pv.Spindle.opmode-cyclic-velocity
4 s32 IN 0 cia402pv.Spindle.opmode-display
4 bit OUT FALSE cia402pv.Spindle.opmode-homing
4 bit OUT FALSE cia402pv.Spindle.opmode-no-mode
4 bit OUT FALSE cia402pv.Spindle.opmode-profile-velocity
4 float IN 0 cia402pv.Spindle.pos-cmd
4 float OUT 0 cia402pv.Spindle.pos-fb
4 float IN 0 cia402pv.Spindle.quickstop-acceleration
4 s32 OUT 0 cia402pv.Spindle.read-all.time
4 bit IN FALSE cia402pv.Spindle.run
4 bit OUT FALSE cia402pv.Spindle.stat-at-speed
4 bit OUT FALSE cia402pv.Spindle.stat-fault
4 bit OUT FALSE cia402pv.Spindle.stat-homed
4 bit OUT FALSE cia402pv.Spindle.stat-homing
4 bit OUT FALSE cia402pv.Spindle.stat-op-enabled
4 bit OUT FALSE cia402pv.Spindle.stat-quick-stop
4 bit OUT FALSE cia402pv.Spindle.stat-quick-stop-valid
4 bit OUT FALSE cia402pv.Spindle.stat-remote
4 bit OUT FALSE cia402pv.Spindle.stat-switched-on
4 bit OUT FALSE cia402pv.Spindle.stat-switchon-disabled
4 bit OUT FALSE cia402pv.Spindle.stat-switchon-ready
4 bit OUT FALSE cia402pv.Spindle.stat-target-reached
4 bit OUT FALSE cia402pv.Spindle.stat-voltage-enabled
4 bit OUT FALSE cia402pv.Spindle.stat-warning
4 bit OUT FALSE cia402pv.Spindle.stat-zero-speed
4 u32 IN 0x00000000 cia402pv.Spindle.statusword
4 float IN 0 cia402pv.Spindle.velocity-cmd
4 float OUT 0 cia402pv.Spindle.velocity-fb
4 s32 OUT 0 cia402pv.Spindle.write-all.time

Pin Aliases:
Alias Original Name

Signals:
Type Value Name (linked to)

Parameters:
Owner Type Dir Value Name
4 bit RW TRUE cia402pv.Spindle.auto-fault-reset
4 bit RW TRUE cia402pv.Spindle.csp-mode
4 float RW 1 cia402pv.Spindle.pos-scale
4 bit RW FALSE cia402pv.Spindle.pv-mode
4 s32 RW 0 cia402pv.Spindle.read-all.tmax
4 bit RO FALSE cia402pv.Spindle.read-all.tmax-increased
4 float RW 1 cia402pv.Spindle.velo-scale
4 s32 RW 0 cia402pv.Spindle.write-all.tmax
4 bit RO FALSE cia402pv.Spindle.write-all.tmax-increased

Parameter Aliases:
Alias Original Name

Exported Functions:
Owner CodeAddr Arg FP Users Name
00004 7fff005c2a20 7fff005f0120 YES 0 cia402pv.Spindle.read-all
00004 7fff005c1e04 7fff005f0120 YES 0 cia402pv.Spindle.write-all

Realtime Threads:
Period FP Name ( Time, Max-Time )

halcmd: Note: Using POSIX realtime
cnc@raspberrypi:~$
  • Hakan
  • Hakan
30 Oct 2025 19:20

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

It's like cia402pv isn't loaded.
Try a new thing. The halrun utility, load the cia402pv component manually.
% halrun 
halcmd: loadrt cia402pv names=cia402pv.Spindle
Note: Using POSIX realtime
halcmd: show all
This hopefully should work and produce a long list of pins and functions.
  • Will_cnc
  • Will_cnc
30 Oct 2025 18:23
Replied by Will_cnc on topic Stepper online A6 Servo motor as Spindle motor

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

I have changed the loadrt line slightly  and receive a different error ? 


RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
LINUXCNC - 2.9.6
Machine configuration directory is '/home/cnc/linuxcnc/configs/probe_basic_dev'
Machine configuration file is 'EL8_machine.ini'
INIFILE=/home/cnc/linuxcnc/configs/probe_basic_dev/EL8_machine.ini
VERSION=1.1
PARAMETER_FILE=linuxcnc.var
TPMOD=
HOMEMOD=el8_homecomp
TASK=milltask
HALUI=halui
DISPLAY=probe_basic
COORDINATES=X Y Z
KINEMATICS=trivkins coordinates=XYZ
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
linuxcnc TPMOD=tpmod HOMEMOD=el8_homecomp EMCMOT=motmod
Found file(REL): ./hallib/EL8_machine.hal
Shutting down and cleaning up LinuxCNC...
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

Debug file information:
Note: Using POSIX realtime
HAL: ERROR: function 'cia402pv.Spindle.read-all' not found
./hallib/EL8_machine.hal:18: addf failed
2975
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime
 
  • Hakan
  • Hakan
30 Oct 2025 15:10

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

But there must be a reason that linuxcnc won't find it.
It looks okay in your files.
Response is exactly like it is commented out.
I tested to comment out the loadrt line and got exactly this
Found file(REL): ./cia402pv.hal
HAL: ERROR: function 'cia402pv.Spindle.read-all' not found
./cia402pv.hal:27: addf failed
I also tested to mis-spell cia402pv.Spindl in the loadrt line and got the same error.
Also mis-spelling on the addf line give the same error.
There is some mis-spelling between the loadrt and the addf lines
but I don't see what it is.

From the output messages this is the hal file linuxcnc uses
./hallib/EL8_machine.hal
That's the one you showed, right?

I don't know. Can you retype those two lines?
  • Will_cnc
  • Will_cnc
30 Oct 2025 13:26
Replied by Will_cnc on topic Stepper online A6 Servo motor as Spindle motor

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadusr -W lcec_conf ethercat-conf.xml
loadrt lcec
#loadusr -W hal_manualtoolchange
loadrt cia402 count=4
#loadrt mult2
#loadrt mult2 count=4 etc for multiple instances
loadrt cia402pv names=cia402pv.Spindle
  • Will_cnc
  • Will_cnc
30 Oct 2025 13:22
Replied by Will_cnc on topic Stepper online A6 Servo motor as Spindle motor

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

Doesn't appear to be commented out in the Hal file ?
  • Hakan
  • Hakan
30 Oct 2025 12:58

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

Hmm, did you by any chance comment out the loadrt cia402pv line?
  • Will_cnc
  • Will_cnc
30 Oct 2025 12:30
Replied by Will_cnc on topic Stepper online A6 Servo motor as Spindle motor

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

Print file information:
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
LINUXCNC - 2.9.6
Machine configuration directory is '/home/cnc/linuxcnc/configs/probe_basic_dev'
Machine configuration file is 'EL8_machine.ini'
INIFILE=/home/cnc/linuxcnc/configs/probe_basic_dev/EL8_machine.ini
VERSION=1.1
PARAMETER_FILE=linuxcnc.var
TPMOD=
HOMEMOD=el8_homecomp
TASK=milltask
HALUI=halui
DISPLAY=probe_basic
COORDINATES=X Y Z
KINEMATICS=trivkins coordinates=XYZ
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
linuxcnc TPMOD=tpmod HOMEMOD=el8_homecomp EMCMOT=motmod
Found file(REL): ./hallib/EL8_machine.hal
Shutting down and cleaning up LinuxCNC...
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

Debug file information:
Note: Using POSIX realtime
HAL: ERROR: function 'cia402pv.Spindle.read-all' not found
./hallib/EL8_machine.hal:18: addf failed
2439
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime


 
  • Will_cnc
  • Will_cnc
30 Oct 2025 12:25
Replied by Will_cnc on topic Stepper online A6 Servo motor as Spindle motor

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

Hi Hakan
Thanks for the help I have configured to the directory now, but have a new error message ?
  • Hakan
  • Hakan
30 Oct 2025 12:04

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

Be in the directory were you have downloaded cia402pv.comp
and there do "sudo halcompile --install cia402pv.comp"

Easy to spot with the error messages, that helps a lot.
  • Will_cnc
  • Will_cnc
30 Oct 2025 11:01
Replied by Will_cnc on topic Stepper online A6 Servo motor as Spindle motor

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

Print file information:
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
LINUXCNC - 2.9.6
Machine configuration directory is '/home/cnc/linuxcnc/configs/probe_basic_dev'
Machine configuration file is 'EL8_machine.ini'
INIFILE=/home/cnc/linuxcnc/configs/probe_basic_dev/EL8_machine.ini
VERSION=1.1
PARAMETER_FILE=linuxcnc.var
TPMOD=
HOMEMOD=el8_homecomp
TASK=milltask
HALUI=halui
DISPLAY=probe_basic
COORDINATES=X Y Z
KINEMATICS=trivkins coordinates=XYZ
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
linuxcnc TPMOD=tpmod HOMEMOD=el8_homecomp EMCMOT=motmod
Found file(REL): ./hallib/EL8_machine.hal
Shutting down and cleaning up LinuxCNC...
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

Debug file information:
Note: Using POSIX realtime
cia402pv: dlopen: /usr/lib/linuxcnc/modules/cia402pv.so: cannot open shared object file: No such file or directory
./hallib/EL8_machine.hal:9: waitpid failed /usr/bin/rtapi_app cia402pv
./hallib/EL8_machine.hal:9: /usr/bin/rtapi_app exited without becoming ready
./hallib/EL8_machine.hal:9: insmod for cia402pv failed, returned -1
2207
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime
  • Will_cnc
  • Will_cnc
30 Oct 2025 11:00
Replied by Will_cnc on topic Stepper online A6 Servo motor as Spindle motor

Stepper online A6 Servo motor as Spindle motor

Category: General LinuxCNC Questions

sudo halcompile --install cia402pv.comp

cnc@raspberrypi:~$ sudo halcompile --install cia402pv.comp
Traceback (most recent call last):
File "/usr/bin/halcompile", line 1553, in <module>
main()
File "/usr/bin/halcompile", line 1523, in main
process(f, mode, outfile)
File "/usr/bin/halcompile", line 1363, in process
a, b = parse(filename)
^^^^^^^^^^^^^^^
File "/usr/bin/halcompile", line 434, in parse
f = open(filename).read()
^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'cia402pv.comp'
Displaying 31 - 45 out of 167 results.
Time to create page: 0.408 seconds
Powered by Kunena Forum