Implementing Spindle Homing for DELTA C2000 Plus (In)correctly?

More
1 year 7 months ago #323729 by stenly
Yes, exactly. But do you know of any example configs or even discussions on how to implement a homing origin switch? I don't think I have found any.

Please Log in or Create an account to join the conversation.

More
1 year 7 months ago #323977 by smc.collins
are you using this for C axis work or just threading ? if just threading, then, it's already handled in spindle mappings in the base config, you just need to make sure to connect it in the HAL file to the Z/index pin. If it's for C axis live tool type work, that's a bit outside of my experience as I haven't had time to finish my own work towards that myself.
The following user(s) said Thank You: stenly

Please Log in or Create an account to join the conversation.

More
1 year 6 months ago #327276 by stenly
I have managed to make some progress over the past weeks.

I believe I managed to add homing properly to the DeMS300 driver, however I am now facing the issue that the homing mode PDOs 6099, 607C and 609A (respectively homing speed, homing offset and homing accel.) are simply not showing up. Hence why the driver fails to initialize them. Interestingly 6098, the homing method, does show up on
Code:
ethercat pdos
, but the other 3 do not. This makes the drive give the motor a current and fixes it in place, however it is not able to start the homing procedure and just stays in place. The control and status words look entirely correct, so my assumption is that the missing 6099, 607C and 609A PDOs are causing it to be unable to start homing.

As you can see in the driver I modified, those PDOs are commented out at the initialization (on lines 225-227). Uncommenting them has the driver compile successfully, yet it fails to start as it is unable to initialize them. I am not sure how I should initialize them properly. In the header file I changed LCEC_DEMS300_PDOS to 15 as well (it used to be 11).

Do you think the PDO mappings are the problem here? I had no success in establishing a connection over TwinCAT, but I may need to look into that again.

Please Log in or Create an account to join the conversation.

More
1 year 5 months ago #327826 by smc.collins
paste your compiler error, I will make a suggestion that might get me shot, but Chat Gpt4o has been trained on the linuxcnc halcompile syntax, you have to bully it a bit to get it moving but it can help you debug, but share the compiler output I'll see what i can do to help.

Please Log in or Create an account to join the conversation.

More
1 year 4 months ago #330961 by Marko6
Hi stenly,

could you tell me how you got on with it? Also, if you have a working CSV - Ethercat, I would be very happy if you could send it to me. I have some problems getting it to work.

I can get the drive turned on (C2000 + EC01 + PG01L) , but I can't set the speed. I can't find anything that works.

Thanks. BR,
Pavel

Please Log in or Create an account to join the conversation.

  • MKUltra
  • New Member
  • New Member
More
1 year 3 months ago #331181 by MKUltra
Hi I did some corrections for you, definitely will work now

###########################################################
#  cia402.hal – Corrected and functional version
# 
#  • Slave-0..2 = X,Y,Z in CSP (Cyclic Synchronous Position)
#  • Slave-3    = Spindle in CSV (Cyclic Synchronous Velocity)
#  • LinuxCNC 2.9+ · EtherLab lcec · servo-thread 1 ms
###########################################################

######################## 1. Real-time & Userspace Components ###
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
loadrt  cia402 count=4               # 0,1,2 = axes | 3 = spindle

# Scaling for spindle speed command & feedback
loadrt scale            names=spin_cmd_scaler,spin_fb_scaler
loadrt conv_s32_float   names=spin_fb_converter

######################## 2. Add Functions to Servo Thread ###
addf lcec.read-all             servo-thread
addf cia402.0.read-all         servo-thread
addf cia402.1.read-all         servo-thread
addf cia402.2.read-all         servo-thread
addf cia402.3.read-all         servo-thread

# Process spindle feedback
addf spin_fb_converter         servo-thread
addf spin_fb_scaler            servo-thread

addf motion-command-handler    servo-thread
addf motion-controller         servo-thread

# Prepare spindle command
addf spin_cmd_scaler           servo-thread

# Write data back to drives
addf cia402.0.write-all        servo-thread
addf cia402.1.write-all        servo-thread
addf cia402.2.write-all        servo-thread
addf cia402.3.write-all        servo-thread
addf lcec.write-all            servo-thread

######################## 3. Global Settings & Parameters ###
# --- X/Y/Z axes in CSP mode ---
setp cia402.0.csp-mode 1
setp cia402.1.csp-mode 1
setp cia402.2.csp-mode 1

setp cia402.0.pos-scale 26214  # match your encoder counts
setp cia402.1.pos-scale 26214
setp cia402.2.pos-scale 26214

# --- Spindle in CSV mode ---
setp cia402.3.csp-mode   0
setp cia402.3.velo-scale 2048

# Gain for 0.1 RPM units ↔ RPM
setp spin_cmd_scaler.gain 10.0   # 1 RPM → 10 (0.1 RPM units)
setp spin_fb_scaler.gain  0.1    # 10 (0.1 RPM units) → 1 RPM

######################## 4. EtherCAT PDO Mapping ########

## X-Axis (slave-0)
net x-stw    lcec.0.0.cia-statusword      => cia402.0.statusword
net x-opdisp lcec.0.0.opmode-display     => cia402.0.opmode-display
net x-actpos lcec.0.0.actual-position    => cia402.0.drv-actual-position
net x-ctlw   cia402.0.controlword        => lcec.0.0.cia-controlword
net x-opcmd  cia402.0.opmode              => lcec.0.0.opmode
net x-tgtpos cia402.0.drv-target-position => lcec.0.0.target-position

## Y-Axis (slave-1)
net y-stw    lcec.0.1.cia-statusword      => cia402.1.statusword
net y-opdisp lcec.0.1.opmode-display     => cia402.1.opmode-display
net y-actpos lcec.0.1.actual-position    => cia402.1.drv-actual-position
net y-ctlw   cia402.1.controlword        => lcec.0.1.cia-controlword
net y-opcmd  cia402.1.opmode              => lcec.0.1.opmode
net y-tgtpos cia402.1.drv-target-position => lcec.0.1.target-position

## Z-Axis (slave-2)
net z-stw    lcec.0.2.cia-statusword      => cia402.2.statusword
net z-opdisp lcec.0.2.opmode-display     => cia402.2.opmode-display
net z-actpos lcec.0.2.actual-position    => cia402.2.drv-actual-position
net z-ctlw   cia402.2.controlword        => lcec.0.2.cia-controlword
net z-opcmd  cia402.2.opmode              => lcec.0.2.opmode
net z-tgtpos cia402.2.drv-target-position => lcec.0.2.target-position

## Spindle (slave-3)
net s-stw    lcec.0.3.cia-statusword      => cia402.3.statusword
net s-opdisp lcec.0.3.opmode-display     => cia402.3.opmode-display
net s-ctlw   cia402.3.controlword         => lcec.0.3.cia-controlword
net s-opcmd  cia402.3.opmode              => lcec.0.3.opmode

# — Velocity feedback: Drive → HAL → LinuxCNC
net s-vel-raw   lcec.0.3.actual-velocity    => spin_fb_converter.in \
                                             => cia402.3.drv-actual-velocity
net s-vel-float spin_fb_converter.out      => spin_fb_scaler.in

Please Log in or Create an account to join the conversation.

Time to create page: 0.300 seconds
Powered by Kunena Forum