Hal to Registers. Come in, Registers. Over.
03 Sep 2023 15:54 #279729
by rwistort
Hal to Registers. Come in, Registers. Over. was created by rwistort
Hello
In my most recent project, I'm having trouble getting my ethercat joints to work.
Not exactly the rarest of problems, I know, but bear with me.
To illustrate the problem, lets look at the contents of the control and status registers, and then compare with the hal values driving/driven by them. You can see that:
lcec.0.hip.control* pins are non-zero, but the control register is zero.
Conversely, status register is non-zero, but lcec.0.hip.status* are zero.
This can't be right.
Let me back up.
My OS is from the 2.8.4 iso. My latency and jitter are good.
I compile linuxcnc from source.
uname -a gives:
Linux charles1 4.19.0-24-rt-amd64 #1 SMP PREEMPT RT Debian 4.19.282-1 (2023-04-29) x86_64 GNU/Linux
My Estun Pronet 04AEA-EC drives worked well in a previous lcec project, using the same hardware (WS, dedicated ethernet card, mesa card, etc) as I use now.
At that time, I built the etherCat master from source, and wrote a custom driver for my Estun servos.
This time around, I installed the Master from packages, using rodw's step-by-step on this forum, but I'm trying to use the generic driver, because I lost my old driver code in a catastrophe.
My cabling seems to be OK. Using the front-panel controls, I can jog the motors.
I can also use the ethercat command to apply a sequence of values to the control register, traversing the state machine into the enabled state, with the motor 'locked' on or off.
Here is a fragment of my hal file:
Here is my xml:
I use shell commands to configure my drive's PDOs before starting linuxcnc:
After configuring my drive, my slave 'looks right' to me:
There are some messages in dmesg which may be of interest:
I sure would like to get these motors working.
Can anyone help?
Thanks,
Reid
In my most recent project, I'm having trouble getting my ethercat joints to work.
Not exactly the rarest of problems, I know, but bear with me.
To illustrate the problem, lets look at the contents of the control and status registers, and then compare with the hal values driving/driven by them. You can see that:
lcec.0.hip.control* pins are non-zero, but the control register is zero.
Conversely, status register is non-zero, but lcec.0.hip.status* are zero.
This can't be right.
reid@charles1:~/linuxcnc-dev/configs/b3pr$ ethercat -p0 -t uint16 upload 0x6040 0 # control register
0x0000 0
reid@charles1:~/linuxcnc-dev/configs/b3pr$ ethercat -p0 -t uint16 upload 0x6041 0 # status register
0x0650 1616
reid@charles1:~/linuxcnc-dev/configs/b3pr$ halcmd show pin lcec
Component Pins:
Owner Type Dir Value Name
43 bit OUT FALSE lcec.0.all-op
43 bit IN TRUE lcec.0.hip.control-0 <== lcec.j1.control.switch-on
43 bit IN TRUE lcec.0.hip.control-1 <== lcec.j1.control.enable-voltage
43 bit IN FALSE lcec.0.hip.control-10
43 bit IN FALSE lcec.0.hip.control-11
43 bit IN FALSE lcec.0.hip.control-12
43 bit IN FALSE lcec.0.hip.control-13
43 bit IN FALSE lcec.0.hip.control-14
43 bit IN FALSE lcec.0.hip.control-15
43 bit IN TRUE lcec.0.hip.control-2 <== lcec.j1.control.quick-stop
43 bit IN FALSE lcec.0.hip.control-3 <== motion-enable
43 bit IN FALSE lcec.0.hip.control-4
43 bit IN FALSE lcec.0.hip.control-5
43 bit IN FALSE lcec.0.hip.control-6
43 bit IN FALSE lcec.0.hip.control-7 <== lcec.j1.control.fault-reset
43 bit IN FALSE lcec.0.hip.control-8
43 bit IN FALSE lcec.0.hip.control-9
43 s32 OUT 0 lcec.0.hip.pos-act ==> pos-fb-s32.j1
43 s32 IN 0 lcec.0.hip.pos-cmd <== pos-cmd-s32.j1
43 bit OUT FALSE lcec.0.hip.slave-online
43 bit OUT FALSE lcec.0.hip.slave-oper
43 bit OUT FALSE lcec.0.hip.slave-state-init
43 bit OUT FALSE lcec.0.hip.slave-state-op
43 bit OUT FALSE lcec.0.hip.slave-state-preop
43 bit OUT FALSE lcec.0.hip.slave-state-safeop
43 bit OUT FALSE lcec.0.hip.status-0
43 bit OUT FALSE lcec.0.hip.status-1
43 bit OUT FALSE lcec.0.hip.status-10
43 bit OUT FALSE lcec.0.hip.status-11
43 bit OUT FALSE lcec.0.hip.status-12
43 bit OUT FALSE lcec.0.hip.status-13
43 bit OUT FALSE lcec.0.hip.status-14
43 bit OUT FALSE lcec.0.hip.status-15
43 bit OUT FALSE lcec.0.hip.status-2
43 bit OUT FALSE lcec.0.hip.status-3
43 bit OUT FALSE lcec.0.hip.status-4
43 bit OUT FALSE lcec.0.hip.status-5
43 bit OUT FALSE lcec.0.hip.status-6
43 bit OUT FALSE lcec.0.hip.status-7
43 bit OUT FALSE lcec.0.hip.status-8
43 bit OUT FALSE lcec.0.hip.status-9
43 s32 OUT 0 lcec.0.hip.torq-act
43 s32 IN 0 lcec.0.hip.torq-offset
43 bit OUT TRUE lcec.0.link-up
43 s32 OUT 0 lcec.0.read.time
43 u32 OUT 0x00000001 lcec.0.slaves-responding
43 bit OUT FALSE lcec.0.state-init
43 bit OUT FALSE lcec.0.state-op
43 bit OUT TRUE lcec.0.state-preop
43 bit OUT FALSE lcec.0.state-safeop
43 s32 OUT 0 lcec.0.write.time
43 bit OUT FALSE lcec.all-op
40 u32 OUT 0x00000001 lcec.conf.master-count
40 u32 OUT 0x00000001 lcec.conf.slave-count
43 bit OUT TRUE lcec.link-up
43 s32 OUT 17506 lcec.read-all.time
43 u32 OUT 0x00000001 lcec.slaves-responding
43 bit OUT FALSE lcec.state-init
43 bit OUT FALSE lcec.state-op
43 bit OUT TRUE lcec.state-preop
43 bit OUT FALSE lcec.state-safeop
43 s32 OUT 29960 lcec.write-all.time
reid@charles1:~/linuxcnc-dev/configs/b3pr$ ethercat slaves
0 0:0 PREOP E ESTUN ProNet
Let me back up.
My OS is from the 2.8.4 iso. My latency and jitter are good.
I compile linuxcnc from source.
uname -a gives:
Linux charles1 4.19.0-24-rt-amd64 #1 SMP PREEMPT RT Debian 4.19.282-1 (2023-04-29) x86_64 GNU/Linux
My Estun Pronet 04AEA-EC drives worked well in a previous lcec project, using the same hardware (WS, dedicated ethernet card, mesa card, etc) as I use now.
At that time, I built the etherCat master from source, and wrote a custom driver for my Estun servos.
This time around, I installed the Master from packages, using rodw's step-by-step on this forum, but I'm trying to use the generic driver, because I lost my old driver code in a catastrophe.
My cabling seems to be OK. Using the front-panel controls, I can jog the motors.
I can also use the ethercat command to apply a sequence of values to the control register, traversing the state machine into the enabled state, with the motor 'locked' on or off.
Here is a fragment of my hal file:
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadusr -W lcec_conf b3pr_ethercat.xml
loadrt lcec
addf lcec.read-all servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf lcec.write-all servo-thread
Here is my xml:
<masters>
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
<slave idx="0" type="generic" vid="1546" configPdos="true" name="hip">
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
<syncManager idx="0" dir="out"/>
<syncManager idx="1" dir="in"/>
<syncManager idx="2" dir="out">
<pdo idx="1602">
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="control" halType="bit"/>
<pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="pos-cmd" halType="s32"/>
<pdoEntry idx="60B2" subIdx="00" bitLen="16" halPin="torq-offset" halType="s32"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1A02">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="status" halType="bit"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="pos-act" halType="S32"/>
<pdoEntry idx="6077" subIdx="00" bitLen="16" halPin="torq-act" halType="S32"/>
</pdo>
</syncManager>
</slave>
</master>
</masters>
I use shell commands to configure my drive's PDOs before starting linuxcnc:
#!/bin/bash
# this script configures PDO mapping for a Pronet drive using ethercat commands.
# Based on akd_free_pdo.sh from Sebastien BLANCHET on the linuxcnc ethercat forum. Should be in ~/Downloads.
# See "PDO mapping process" on p12 of Estun ethercat manual.
POS=-p0 # joint 1 'hip'
# clear RxPDO
ethercat $POS --type uint8 download 0x1C12 0 0 # clear RxPDO counter
ethercat $POS --type uint8 download 0x1600 0 0 # clear RxPDO0
ethercat $POS --type uint8 download 0x1601 0 0 # clear RxPDO1
ethercat $POS --type uint8 download 0x1602 0 0 # clear RxPDO2
ethercat $POS --type uint8 download 0x1603 0 0 # clear RxPDO3
# define RxPdo
ethercat $POS --type uint32 download 0x1602 1 0x60400010 # control word (index+subindex+bitlength)
ethercat $POS --type uint32 download 0x1602 2 0x607A0020 # pos-cmd
ethercat $POS --type uint32 download 0x1602 3 0x60B20010 # torque-offset
ethercat $POS --type uint8 download 0x1602 0 3 # number of var in this PDO
ethercat $POS --type uint16 download 0x1C12 1 0x1602 # list RxPdo
ethercat $POS --type uint8 download 0x1C12 0 1 # number of RxPdo
#---------------------------------------
# clear TxPdo
ethercat $POS --type uint8 download 0x1C13 0 0 # clear TxPDO counter
ethercat $POS --type uint8 download 0x1A00 0 0 # clear TxPDO0
ethercat $POS --type uint8 download 0x1A01 0 0 # clear TxPDO1
ethercat $POS --type uint8 download 0x1A02 0 0 # clear TxPDO2
ethercat $POS --type uint8 download 0x1A03 0 0 # clear TxPDO3
# define TxPdo
ethercat $POS --type uint32 download 0x1A02 1 0x60410010 # status word (index+subindex+bitlength)
ethercat $POS --type uint32 download 0x1A02 2 0x60640020 # pos-act
ethercat $POS --type uint32 download 0x1A02 3 0x60770010 # torque-actual
ethercat $POS --type uint8 download 0x1A02 0 3 # number of var in this PDO
ethercat $POS --type uint16 download 0x1C13 1 0x1A02 # list TxPdo
ethercat $POS --type uint8 download 0x1C13 0 1 # number of TxPdo
ethercat rescan
sleep 5
ethercat cstruct $POS
#---------------------------------------
# reset fault
ethercat $POS -t uint16 download 0x6040 0 0x0080 # rising edge
ethercat $POS -t uint16 download 0x6040 0 0x0000
# mode-of-operation 8=CSV
ethercat $POS --type uint8 download 0x6060 0 8
# velocity-offset = 0
ethercat $POS --type int32 download 0x60B1 0 0
# quick-stop-option-code = 0: motor stops freely
ethercat $POS --type uint16 download 0x605A 0 0
echo " STATUS word: `ethercat $POS -t uint16 upload 0x6041 0 `"
After configuring my drive, my slave 'looks right' to me:
reid@charles1:~/linuxcnc-dev/configs/b3pr$ ethercat slaves
0 0:0 PREOP + ESTUN ProNet
reid@charles1:~/linuxcnc-dev/configs/b3pr$ ethercat cstruct
/* Master 0, Slave 0, "ESTUN ProNet"
* Vendor ID: 0x0000060a
* Product code: 0x00000001
* Revision number: 0x00000001
*/
ec_pdo_entry_info_t slave_0_pdo_entries[] = {
{0x6040, 0x00, 16},
{0x607a, 0x00, 32},
{0x60b2, 0x00, 16},
{0x6041, 0x00, 16},
{0x6064, 0x00, 32},
{0x6077, 0x00, 16},
};
ec_pdo_info_t slave_0_pdos[] = {
{0x1602, 3, slave_0_pdo_entries + 0},
{0x1a02, 3, slave_0_pdo_entries + 3},
};
ec_sync_info_t slave_0_syncs[] = {
{0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
{1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
{2, EC_DIR_OUTPUT, 1, slave_0_pdos + 0, EC_WD_ENABLE},
{3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE},
{0xff}
};
reid@charles1:~/linuxcnc-dev/configs/b3pr$ ethercat pdos
SM0: PhysAddr 0x1000, DefaultSize 128, ControlRegister 0x36, Enable 1
SM1: PhysAddr 0x1080, DefaultSize 128, ControlRegister 0x32, Enable 1
SM2: PhysAddr 0x1100, DefaultSize 6, ControlRegister 0x74, Enable 1
RxPDO 0x1602 ""
PDO entry 0x6040:00, 16 bit, ""
PDO entry 0x607a:00, 32 bit, ""
PDO entry 0x60b2:00, 16 bit, ""
SM3: PhysAddr 0x1d00, DefaultSize 6, ControlRegister 0x30, Enable 1
TxPDO 0x1a02 ""
PDO entry 0x6041:00, 16 bit, ""
PDO entry 0x6064:00, 32 bit, ""
PDO entry 0x6077:00, 16 bit, ""
There are some messages in dmesg which may be of interest:
# when I boot (and the ethercat master is started):
# (I've pared this listing way back)
# I think this stuff might be normal ?
reid@charles1:~/linuxcnc-dev/configs/b3pr$ sudo dmesg
[ 14.683973] ec_master: loading out-of-tree module taints kernel.
[ 14.684280] ec_master: module verification failed: signature and/or required key missing - tainting kernel
[ 14.693550] EtherCAT: Master driver 1.5.2 unknown
[ 14.693640] EtherCAT: 1 master waiting for devices.
[ 14.715881] ec_generic: EtherCAT master generic Ethernet device module 1.5.2 unknown
[ 14.715902] EtherCAT: Accepting 68:05:CA:8A:B4:79 as main device for master 0.
[ 14.715931] ec_generic: Binding socket to interface 3 (enp11s2).
[ 14.748730] EtherCAT 0: Starting EtherCAT-IDLE thread.
# when I power up my servo drive:
# (I think these errors are because the drive powers up un-configured ?)
reid@charles1:~/linuxcnc-dev/configs/b3pr$ sudo dmesg
[347388.517587] e1000: enp11s2 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX
[347388.525123] EtherCAT 0: Link state of ecm0 changed to UP.
[347388.533112] EtherCAT 0: 1 slave(s) responding on main device.
[347388.533115] EtherCAT 0: Slave states on main device: INIT.
[347388.533487] EtherCAT 0: Scanning bus.
[347388.588712] EtherCAT ERROR 0-0: SDO upload 0x0000:00 aborted.
[347388.588715] EtherCAT ERROR 0-0: SDO abort message 0x06020000: "This object does not exist in the object directory".
[347388.588716] EtherCAT ERROR 0-0: Failed to read number of mapped PDO entries.
[347388.588717] EtherCAT ERROR 0-0: Failed to read mapped PDO entries for PDO 0x0000.
[347388.607462] EtherCAT ERROR 0-0: SDO upload 0x0000:00 aborted.
[347388.607464] EtherCAT ERROR 0-0: SDO abort message 0x06020000: "This object does not exist in the object directory".
[347388.607465] EtherCAT ERROR 0-0: Failed to read number of mapped PDO entries.
[347388.607466] EtherCAT ERROR 0-0: Failed to read mapped PDO entries for PDO 0x0000.
[347388.607468] EtherCAT 0: Bus scanning completed in 72 ms.
[347388.607469] EtherCAT 0: Using slave 0 as DC reference clock.
[347388.613165] EtherCAT 0: Slave states on main device: PREOP.
# when I configure my drive using the script above:
reid@charles1:~/linuxcnc-dev/configs/b3pr$ sudo dmesg
[347555.253993] EtherCAT 0: Scanning bus.
[347555.303228] EtherCAT 0: Bus scanning completed in 48 ms.
[347555.303229] EtherCAT 0: Using slave 0 as DC reference clock.
# now that the drive is powered on and configured, I start linuxcnc:
reid@charles1:~/linuxcnc-dev/configs/b3pr$ sudo dmesg
[347619.191020] EtherCAT: Requesting master 0...
[347619.191023] EtherCAT: Successfully requested master 0.
[347619.191429] EtherCAT 0: Domain0: Logical address 0x00000000, 16 byte, expected working counter 3.
[347619.191431] EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 16 byte, type LRW.
[347619.191439] EtherCAT 0: Master thread exited.
[347619.191441] EtherCAT 0: Starting EtherCAT-OP thread.
[347619.191475] EtherCAT WARNING 0: 112 datagrams TIMED OUT!
[347622.741162] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[347622.742159] EtherCAT ERROR 0-0: AL status message 0x001E: "Invalid input configuration".
[347622.744157] EtherCAT 0-0: Acknowledged state PREOP.
I sure would like to get these motors working.
Can anyone help?
Thanks,
Reid
Please Log in or Create an account to join the conversation.
09 Sep 2023 16:25 #280336
by rwistort
Replied by rwistort on topic Hal to Registers. Come in, Registers. Over.
“Calm down,” I told myself. “Inhale. Relax. Take a break.”
Start over.
Everyone on the forum seems to understand 'configuration' better than I do.
Suppose I buy a used servo drive on eBay.
My first move is to reset it to the factory settings, using the front panel and no software whatsoever.
My second move is to 'configure' it at runtime using the xml I feed to lcec_conf. I have dozens of samples to choose from on the forum, and it usually boils down to a pdo section, plus a dozen or so sdoconfigs.
And that should do it, right? It's only so hard to tweak xml, and factory settings usually aren't far off.
Or is there more to it?
Do I need, for example, to start with the ESI file in Twincat, and pre-configure the driver in windows?
What happens if I skip this step?
Or, I should say, What can go wrong?
Is there an equivalent linux command I can issue, like "loadMfgXmlIntoDrive -p0", maybe?
I would think that the ESI values are pretty similar to the factory settings?
What's going on here?
Too many trees, and not enough forest.
Reid
Start over.
Everyone on the forum seems to understand 'configuration' better than I do.
Suppose I buy a used servo drive on eBay.
My first move is to reset it to the factory settings, using the front panel and no software whatsoever.
My second move is to 'configure' it at runtime using the xml I feed to lcec_conf. I have dozens of samples to choose from on the forum, and it usually boils down to a pdo section, plus a dozen or so sdoconfigs.
And that should do it, right? It's only so hard to tweak xml, and factory settings usually aren't far off.
Or is there more to it?
Do I need, for example, to start with the ESI file in Twincat, and pre-configure the driver in windows?
What happens if I skip this step?
Or, I should say, What can go wrong?
Is there an equivalent linux command I can issue, like "loadMfgXmlIntoDrive -p0", maybe?
I would think that the ESI values are pretty similar to the factory settings?
What's going on here?
Too many trees, and not enough forest.
Reid
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
10 Sep 2023 08:17 - 10 Sep 2023 08:20 #280383
by endian
Replied by endian on topic Hal to Registers. Come in, Registers. Over.
I can recommend you from beginning configure stuff over twincat3, check how it works and what is in the mapping PDOs and what is in the SDO at start up ... I attached below festo manual for cmmt which is very helpfull for starting on a green meadow...1 and 2 chapter is for IPC in the ethercat network thats are not usefull for you... your learing stuff starting from 3 chapter in the .pdf
learn what is what, what is in which format, what is in which data format, what have to be setted up at startup etc...
download .esi file from vendor site and put it to the " C:\TwinCAT\3.1\Config\Io\EtherCAT " in win machine with installed twincat3...
there is active scan button and twincat will find your slave and it will get it to online... you have to active DC for synchro and deactivate lag monitoring function in encoder of slave ...after it you will control your slave and see what and how everything change in the online PDO...
There you can customize the PDOs in a few clicks and hook up online in the fastest and easiest way without all errors around lcec and no eeprom overwrite in the slaves ...
check attachement, learn how to over twincat3, create custom generic .xml for your slave ... if it is cia 402 format of control used db1981
learn it no copy´n´paste it
learn what is what, what is in which format, what is in which data format, what have to be setted up at startup etc...
download .esi file from vendor site and put it to the " C:\TwinCAT\3.1\Config\Io\EtherCAT " in win machine with installed twincat3...
there is active scan button and twincat will find your slave and it will get it to online... you have to active DC for synchro and deactivate lag monitoring function in encoder of slave ...after it you will control your slave and see what and how everything change in the online PDO...
There you can customize the PDOs in a few clicks and hook up online in the fastest and easiest way without all errors around lcec and no eeprom overwrite in the slaves ...
check attachement, learn how to over twincat3, create custom generic .xml for your slave ... if it is cia 402 format of control used db1981
learn it no copy´n´paste it
Last edit: 10 Sep 2023 08:20 by endian. Reason: adding and editing chapters
Please Log in or Create an account to join the conversation.
12 Sep 2023 04:12 #280521
by rwistort
Replied by rwistort on topic Hal to Registers. Come in, Registers. Over.
Many thanks.
It sounds like my understanding was flawed, so I'm going to try it your way.
Twincat seems to be a lot like Mortal Kombat: an alien world with danger around every corner.
I managed to install it, copied the esi files, installed the ethercat driver, got it to scan, set up a project, and set up some pdos. I can watch them change in free run mode when I turn the motor rotor by hand.
I lost a lot of blood getting that far.
When I 'activate configuration,' it won't let me because -- you're gonna laugh -- my CPU is too feeble. Does not support virtualization.
So while I shop for (yet) another computer, can I ask:
Is it possible to configure my drive from free run mode?
When I replace the windows twincat cable with the linuxcnc ethercat cable, I see that 'ethercat -p0 pdos' shows the values I've set up in twincat. Does this mean the drive is 'configured' and ready for action in linuxcnc? (didn't get to that today).
The configured settings don't survive a power shutdown, though. Should they?
I am in a better place, but still have a ways to go.
Reid
It sounds like my understanding was flawed, so I'm going to try it your way.
Twincat seems to be a lot like Mortal Kombat: an alien world with danger around every corner.
I managed to install it, copied the esi files, installed the ethercat driver, got it to scan, set up a project, and set up some pdos. I can watch them change in free run mode when I turn the motor rotor by hand.
I lost a lot of blood getting that far.
When I 'activate configuration,' it won't let me because -- you're gonna laugh -- my CPU is too feeble. Does not support virtualization.
So while I shop for (yet) another computer, can I ask:
Is it possible to configure my drive from free run mode?
When I replace the windows twincat cable with the linuxcnc ethercat cable, I see that 'ethercat -p0 pdos' shows the values I've set up in twincat. Does this mean the drive is 'configured' and ready for action in linuxcnc? (didn't get to that today).
The configured settings don't survive a power shutdown, though. Should they?
I am in a better place, but still have a ways to go.
Reid
Please Log in or Create an account to join the conversation.
12 Sep 2023 07:04 #280528
by endian
Replied by endian on topic Hal to Registers. Come in, Registers. Over.
they should if it was not configured or from default was different from your setup...
You can prepared drive in many ways... I do not know what you like but I am prefering premapping it over .xml file and all stuff has in nice single pile... but you can create same bash script with premapping ethercat commands and run it just before you startup the lcnc like you have above...
premapping over .xml file below - you have to tell slave how and with what you will communicate together -
without premapping
syntax you will have to understand yourself
regards S.
You can prepared drive in many ways... I do not know what you like but I am prefering premapping it over .xml file and all stuff has in nice single pile... but you can create same bash script with premapping ethercat commands and run it just before you startup the lcnc like you have above...
premapping over .xml file below - you have to tell slave how and with what you will communicate together -
<slave idx="1" type="generic" vid="0000006A" pid="00414b44" configPdos="true">
<!-- Clear SM PDOs -->
<sdoConfig idx="1C12" subIdx="00">
<sdoDataRaw data="00"/>
</sdoConfig>
<!-- Clear SM PDOs -->
<sdoConfig idx="1C13" subIdx="00">
<sdoDataRaw data="00"/>
</sdoConfig>
<!-- Clear RX PDO1 -->
<sdoConfig idx="1A00" subIdx="00">
<sdoDataRaw data="00"/>
</sdoConfig>
<!-- Map status word to RX-PDO1 -->
<!-- 0x6041 0010 -->
<sdoConfig idx="1A00" subIdx="01">
<sdoDataRaw data="10 00 41 60"/>
</sdoConfig>
<!-- Map position feedback to RX-PDO1 -->
<!-- 0x6064 0020 -->
<sdoConfig idx="1A00" subIdx="02">
<sdoDataRaw data="20 00 64 60"/>
</sdoConfig>
<!-- Set RX-PDO1 count to 2 -->
<sdoConfig idx="1A00" subIdx="00">
<sdoDataRaw data="02"/>
</sdoConfig>
<!-- Clear RX-PDO2 -->
<sdoConfig idx="1A01" subIdx="00">
<sdoDataRaw data="00"/>
</sdoConfig>
<!-- Map Analog Input to RX-PDO2 -->
<!-- 0x3470 0410 -->
<sdoConfig idx="1A01" subIdx="01">
<sdoDataRaw data="10 04 70 34"/>
</sdoConfig>
<!-- Map Digital Inputs to RX-PDO2 -->
<!-- 0x60FD 0020 -->
<sdoConfig idx="1A01" subIdx="02">
<sdoDataRaw data="20 00 FD 60"/>
</sdoConfig>
<!-- Set RX-PDO2 count to 2 -->
<sdoConfig idx="1A01" subIdx="00">
<sdoDataRaw data="02"/>
</sdoConfig>
<!-- Clear RX-PDO3 -->
<sdoConfig idx="1A02" subIdx="00">
<sdoDataRaw data="00"/>
</sdoConfig>
<!-- Clear RX-PDO4 -->
<sdoConfig idx="1A03" subIdx="00">
<sdoDataRaw data="00"/>
</sdoConfig>
<!-- Clear TX-PDO1 -->
<sdoConfig idx="1600" subIdx="00">
<sdoDataRaw data="00"/>
</sdoConfig>
<!-- Map control word to TX-PDO1 -->
<!-- 0x6040 0010 -->
<sdoConfig idx="1600" subIdx="01">
<sdoDataRaw data="10 00 40 60"/>
</sdoConfig>
<!-- Map position command to TX-PDO1 -->
<!-- 0x607A 0020 -->
<sdoConfig idx="1600" subIdx="02">
<sdoDataRaw data="20 00 7A 60"/>
</sdoConfig>
<!-- Set TX-PDO1 count to 2 -->
<sdoConfig idx="1600" subIdx="00">
<sdoDataRaw data="02"/>
</sdoConfig>
<!-- Clear TX-PDO2 -->
<sdoConfig idx="1601" subIdx="00">
<sdoDataRaw data="00"/>
</sdoConfig>
<!-- Map Analog Out to TX-PDO2 -->
<!-- 0x3470 0310 -->
<sdoConfig idx="1601" subIdx="01">
<sdoDataRaw data="10 03 70 34"/>
</sdoConfig>
<!-- Map Digital Out to TX-PDO2 -->
<!-- 0x60FE 0120 -->
<sdoConfig idx="1601" subIdx="02">
<sdoDataRaw data="20 01 FE 60"/>
</sdoConfig>
<!-- Set TX-PDO2 count to 2 -->
<sdoConfig idx="1601" subIdx="00">
<sdoDataRaw data="02"/>
</sdoConfig>
<!-- Clear TX-PDO3 -->
<sdoConfig idx="1602" subIdx="00">
<sdoDataRaw data="00"/>
</sdoConfig>
<!-- Clear TX-PDO4 -->
<sdoConfig idx="1603" subIdx="00">
<sdoDataRaw data="00"/>
</sdoConfig>
<!-- Download PDO 0x1C12:01 index -->
<!-- 0x1600 -->
<sdoConfig idx="1C12" subIdx="01">
<sdoDataRaw data="00 16"/>
</sdoConfig>
<!-- Download PDO 0x1C12:02 index -->
<!-- 0x1601 -->
<sdoConfig idx="1C12" subIdx="02">
<sdoDataRaw data="01 16"/>
</sdoConfig>
<!-- Download PDO 0x1C12 count -->
<sdoConfig idx="1C12" subIdx="00">
<sdoDataRaw data="02"/>
</sdoConfig>
<!-- Download PDO 0x1C13:01 index -->
<!-- 0x1A00 -->
<sdoConfig idx="1C13" subIdx="01">
<sdoDataRaw data="00 1A"/>
</sdoConfig>
<!-- Download PDO 0x1C13:02 index -->
<!-- 0x1A01 -->
<sdoConfig idx="1C13" subIdx="02">
<sdoDataRaw data="01 1A"/>
</sdoConfig>
<!-- Download PDO 0x1C13 count -->
<sdoConfig idx="1C13" subIdx="00">
<sdoDataRaw data="02"/>
</sdoConfig>
<!-- Set OpMode to Cyclic Synchronous Position -->
<sdoConfig idx="6060" subIdx="00">
<sdoDataRaw data="08"/>
</sdoConfig>
<!-- Set Cycle Time -->
<sdoConfig idx="60C2" subIdx="01">
<sdoDataRaw data="01"/>
</sdoConfig>
<!-- Set Cycle exp -->
<sdoConfig idx="60C2" subIdx="02">
<sdoDataRaw data="FD"/>
</sdoConfig>
<!-- Set Digital Output mask -->
<!-- 0x0003 0001 -->
<sdoConfig idx="60FE" subIdx="02">
<sdoDataRaw data="01 00 03 00"/>
</sdoConfig>
<!-- Set FBUS.PARAM05, enable DS402 scaling -->
<!-- 0x0000 0110 -->
<sdoConfig idx="36E9" subIdx="00">
<sdoDataRaw data="10 01 00 00"/>
</sdoConfig>
<!-- Set Motor Revolutions -->
<!-- 0x0000 0001 -->
<sdoConfig idx="6091" subIdx="01">
<sdoDataRaw data="01 00 00 00"/>
</sdoConfig>
<!-- Set Shaft Revolutions -->
<!-- 0x0000 0001 -->
<sdoConfig idx="6091" subIdx="02">
<sdoDataRaw data="01 00 00 00"/>
</sdoConfig>
<!-- Feed (32 * 10,000 counts/pole-pair) -->
<!-- 0x0004 E200 -->
<!-- <sdoConfig idx="6092" subIdx="01"> <sdoDataRaw data="00 E2 04 00"/> </sdoConfig> -->
<!-- Feed (32*1,000,000 counts/pole) -->
<!-- 0x01E8 4800 -->
<sdoConfig idx="6092" subIdx="01">
<sdoDataRaw data="00 48 E8 01"/>
</sdoConfig>
<!-- Set Shaft Revolutions -->
<!-- 0x0000 0001 -->
<sdoConfig idx="6092" subIdx="02">
<sdoDataRaw data="01 00 00 00"/>
</sdoConfig>
<syncManager idx="0" dir="out"> </syncManager>
<syncManager idx="1" dir="in"> </syncManager>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="TxControlWord" halType="u32"/>
<pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="TxPositionCommand" halType="u32"/>
</pdo>
<pdo idx="1601">
<pdoEntry idx="3470" subIdx="03" bitLen="16" halPin="AnalogOutput" halType="float"/>
<pdoEntry idx="60FE" subIdx="01" bitLen="32" halType="complex">
<complexEntry bitLen="16"/>
<complexEntry bitLen="1" halPin="DOUT1" halType="bit"/>
<complexEntry bitLen="1" halPin="DOUT2" halType="bit"/>
<complexEntry bitLen="14"/>
</pdoEntry>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="RxStatusWord" halType="u32"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="RxPositionFeedback" halType="float"/>
</pdo>
<pdo idx="1a01">
<pdoEntry idx="3470" subIdx="04" bitLen="16" halPin="AnalogInput" halType="float"/>
<pdoEntry idx="60FD" subIdx="00" bitLen="32" halType="complex">
<!-- Not sure why, but the DINs are in the 17-24 bit range -->
<complexEntry bitLen="16"/>
<complexEntry bitLen="1" halPin="DIN1" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN2" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN3" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN4" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN5" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN6" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN7" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN8" halType="bit"/>
<complexEntry bitLen="8"/>
</pdoEntry>
</pdo>
</syncManager>
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="125000"/>
</slave>
without premapping
<slave idx="1" type="generic" vid="0000006A" pid="00414b44" configPdos="true">
<!-- Set OpMode to Cyclic Synchronous Position -->
<sdoConfig idx="6060" subIdx="00">
<sdoDataRaw data="08"/>
</sdoConfig>
<!-- Set Cycle Time -->
<sdoConfig idx="60C2" subIdx="01">
<sdoDataRaw data="01"/>
</sdoConfig>
<!-- Set Cycle exp -->
<sdoConfig idx="60C2" subIdx="02">
<sdoDataRaw data="FD"/>
</sdoConfig>
<!-- Set Digital Output mask -->
<!-- 0x0003 0001 -->
<sdoConfig idx="60FE" subIdx="02">
<sdoDataRaw data="01 00 03 00"/>
</sdoConfig>
<!-- Set FBUS.PARAM05, enable DS402 scaling -->
<!-- 0x0000 0110 -->
<sdoConfig idx="36E9" subIdx="00">
<sdoDataRaw data="10 01 00 00"/>
</sdoConfig>
<!-- Set Motor Revolutions -->
<!-- 0x0000 0001 -->
<sdoConfig idx="6091" subIdx="01">
<sdoDataRaw data="01 00 00 00"/>
</sdoConfig>
<!-- Set Shaft Revolutions -->
<!-- 0x0000 0001 -->
<sdoConfig idx="6091" subIdx="02">
<sdoDataRaw data="01 00 00 00"/>
</sdoConfig>
<sdoConfig idx="6092" subIdx="01">
<sdoDataRaw data="00 48 E8 01"/>
</sdoConfig>
<!-- Set Shaft Revolutions -->
<!-- 0x0000 0001 -->
<sdoConfig idx="6092" subIdx="02">
<sdoDataRaw data="01 00 00 00"/>
</sdoConfig>
<syncManager idx="0" dir="out"> </syncManager>
<syncManager idx="1" dir="in"> </syncManager>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="TxControlWord" halType="u32"/>
<pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="TxPositionCommand" halType="u32"/>
</pdo>
<pdo idx="1601">
<pdoEntry idx="3470" subIdx="03" bitLen="16" halPin="AnalogOutput" halType="float"/>
<pdoEntry idx="60FE" subIdx="01" bitLen="32" halType="complex">
<complexEntry bitLen="16"/>
<complexEntry bitLen="1" halPin="DOUT1" halType="bit"/>
<complexEntry bitLen="1" halPin="DOUT2" halType="bit"/>
<complexEntry bitLen="14"/>
</pdoEntry>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="RxStatusWord" halType="u32"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="RxPositionFeedback" halType="float"/>
</pdo>
<pdo idx="1a01">
<pdoEntry idx="3470" subIdx="04" bitLen="16" halPin="AnalogInput" halType="float"/>
<pdoEntry idx="60FD" subIdx="00" bitLen="32" halType="complex">
<!-- Not sure why, but the DINs are in the 17-24 bit range -->
<complexEntry bitLen="16"/>
<complexEntry bitLen="1" halPin="DIN1" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN2" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN3" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN4" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN5" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN6" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN7" halType="bit"/>
<complexEntry bitLen="1" halPin="DIN8" halType="bit"/>
<complexEntry bitLen="8"/>
</pdoEntry>
</pdo>
</syncManager>
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="125000"/>
</slave>
syntax you will have to understand yourself
regards S.
Please Log in or Create an account to join the conversation.
12 Sep 2023 18:54 #280571
by endian
Replied by endian on topic Hal to Registers. Come in, Registers. Over.
PS
but twincat3 is really helpfull for one simple reason - startup section which showing us what is neccessary put to the mapping SDOs, in which format and in which position... see printscreen below in attachement ...
If you did know full syntax (what probably nobody from us), you can spent tons of time of configuring servo driver without any feedback..(as me, please do not repeat my mistakes) ... because drivers which I had in my workshop have not proper manual and nowhere nothing wasnt ... check my other posts too ....
regards
but twincat3 is really helpfull for one simple reason - startup section which showing us what is neccessary put to the mapping SDOs, in which format and in which position... see printscreen below in attachement ...
If you did know full syntax (what probably nobody from us), you can spent tons of time of configuring servo driver without any feedback..(as me, please do not repeat my mistakes) ... because drivers which I had in my workshop have not proper manual and nowhere nothing wasnt ... check my other posts too ....
regards
Please Log in or Create an account to join the conversation.
20 Sep 2023 18:46 #281249
by rwistort
Replied by rwistort on topic Hal to Registers. Come in, Registers. Over.
Whew!
I read thru a hundred links, changed my code a hundred times, and eventually got it working.
I wish I could say there was a particular 'aha moment' when I knew I'd fixed it, but I tried so many variations that I'm a little fuzzy on which fix, exactly, worked.
Understanding the drive's 'startup' tab in Twincat certainly helps.
In the end, I scraped together a custom driver for my Pronet drives by cloning the Omron driver code. Personally, I find that the C code is more transparent than the xml, and my hal is much cleaner. Plus, it worked!
So now I have 6 out of 7 motors on my robot working! That's the good news.
The bad news:
That last motor has a Kollmorgen AKD ethercat drive, and it uses the same register designations and state machine as my Pronets.
I used Kollmorgen's 'workbench' app to set up the driver, and it jumped through every hoop, no problem.
I checked that it works in Twincat using my PDOs and pdoEntries.
Then I cloned my lcec_pronet driver into a new lcec_akd driver and, of course, it didn't work.
Here is what I get when I start linuxcnc with the AKD drive:That all looks normal to me. (I get the 'did not sync' message even for the working Pronet drive)
In the xml I use to start the driver, the dcConf and watchdog lines (which 'came with' the Omron example) are -required- for the Pronet driver to work. For the AKD, the watchdog line hangs the system (force reboot!) and the dcConf doesn't seem to make any difference.
By hacking, I've watched the control and status words as they go from hal to pin to register, and from register to pin to hal. The state machine gets stuck, though, at switch_on_disabled, so the motor never enables.
(Using Kollmorgen's workbench app, connected thru a (separate from ethercat) service port, this seems to correspond to an internal software_enable signal that the fieldbus is supposed to preempt. ??)
The rest of the PDO entries don't update at all:
pos_cmd doesn't make it to register 0x607A and
Turning the rotor shaft changes 0x6063, but not the hal pin.
Any ideas?
Reid
I read thru a hundred links, changed my code a hundred times, and eventually got it working.
I wish I could say there was a particular 'aha moment' when I knew I'd fixed it, but I tried so many variations that I'm a little fuzzy on which fix, exactly, worked.
Understanding the drive's 'startup' tab in Twincat certainly helps.
In the end, I scraped together a custom driver for my Pronet drives by cloning the Omron driver code. Personally, I find that the C code is more transparent than the xml, and my hal is much cleaner. Plus, it worked!
So now I have 6 out of 7 motors on my robot working! That's the good news.
The bad news:
That last motor has a Kollmorgen AKD ethercat drive, and it uses the same register designations and state machine as my Pronets.
I used Kollmorgen's 'workbench' app to set up the driver, and it jumped through every hoop, no problem.
I checked that it works in Twincat using my PDOs and pdoEntries.
Then I cloned my lcec_pronet driver into a new lcec_akd driver and, of course, it didn't work.
Here is what I get when I start linuxcnc with the AKD drive:
reid@charles1:~/linuxcnc-dev/configs/lcec$ sudo dmesg
[69600.776306] EtherCAT: Requesting master 0...
[69600.776309] EtherCAT: Successfully requested master 0.
[69600.776712] EtherCAT 0: Domain0: Logical address 0x00000000, 16 byte, expected working counter 3.
[69600.776714] EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 16 byte, type LRW.
[69600.776724] EtherCAT 0: Master thread exited.
[69600.776726] EtherCAT 0: Starting EtherCAT-OP thread.
[69600.776829] EtherCAT WARNING 0: 186 datagrams UNMATCHED!
[69606.171811] EtherCAT WARNING 0-0: Slave did not sync after 5000 ms.
[69606.177810] EtherCAT 0: Domain 0: Working counter changed to 2/3.
[69606.199312] EtherCAT 0: Slave states on main device: OP.
[69607.179801] EtherCAT 0: Domain 0: Working counter changed to 3/3.
reid@charles1:~/linuxcnc-dev/configs/lcec$ ethercat slaves
0 0:0 OP + AKD EtherCAT Drive (CoE)
reid@charles1:~/linuxcnc-dev/configs/lcec$ ethercat -p0 pdos
SM0: PhysAddr 0x1800, DefaultSize 1024, ControlRegister 0x26, Enable 1
SM1: PhysAddr 0x1c00, DefaultSize 1024, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1100, DefaultSize 0, ControlRegister 0x24, Enable 1
RxPDO 0x1602 ""
PDO entry 0x607a:00, 32 bit, ""
PDO entry 0x6040:00, 16 bit, ""
PDO entry 0x60b2:00, 16 bit, ""
SM3: PhysAddr 0x1140, DefaultSize 0, ControlRegister 0x20, Enable 1
TxPDO 0x1a02 ""
PDO entry 0x6041:00, 16 bit, ""
PDO entry 0x6063:00, 32 bit, ""
PDO entry 0x6077:00, 16 bit, ""
In the xml I use to start the driver, the dcConf and watchdog lines (which 'came with' the Omron example) are -required- for the Pronet driver to work. For the AKD, the watchdog line hangs the system (force reboot!) and the dcConf doesn't seem to make any difference.
<masters>
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="10">
<slave idx="0" type="Akd" name="hip">
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
<!--<watchdog divider="2498" intervals="1000"/>-->
</slave>
</master>
</masters>
By hacking, I've watched the control and status words as they go from hal to pin to register, and from register to pin to hal. The state machine gets stuck, though, at switch_on_disabled, so the motor never enables.
(Using Kollmorgen's workbench app, connected thru a (separate from ethercat) service port, this seems to correspond to an internal software_enable signal that the fieldbus is supposed to preempt. ??)
The rest of the PDO entries don't update at all:
pos_cmd doesn't make it to register 0x607A and
Turning the rotor shaft changes 0x6063, but not the hal pin.
Any ideas?
Reid
Please Log in or Create an account to join the conversation.
22 Sep 2023 12:16 #281366
by rodw
Replied by rodw on topic Hal to Registers. Come in, Registers. Over.
Sounds like that pin need to be connected to joint.N.amp-enable-out
Please Log in or Create an account to join the conversation.
23 Sep 2023 04:06 #281426
by rwistort
Replied by rwistort on topic Hal to Registers. Come in, Registers. Over.
Thanks, Rod, but that 'software enable' signal is not a hal pin that I can just connect. It's a virtual signal referenced in the enable logic Kollmorgen displays in its workbench app.
That said, my guess is that enabling my AKD drive will be 'easy' once communication is established. Getting pos_fb to change when I turn the motor rotor would be a start.
I'm pretty sure I've got a better chance of getting help if I stick to the generic driver, rather than rolling my own, so I started from scratch again and, in the xml below, the group of sdoconfig's at the top exactly match the sequence shown in Twincat's driver startup tab, and the pdos in the syncManager section match that sequence. This corresponds to the 'premapping over .xml' method suggested by Foxington on 9/12 in this thread.When I start linuxcnc, here is (part of) what dmesg gives me (with ethercat debug 1). You can see that the index, subindex, and size columns correspond to the sdoconfigs, but the data column seems wildly wrong.
The dmesg listing ends with the following, and I'd like to ask, again, if the 'slave did not sync' message is worth worrying about.After linuxcnc starts up, ethercat slaves gives:
0 0:0 OP + AKD EtherCAT Drive (CoE)
Finally, can someone comment on the use of the "configPdos=true" token in the <slave> line?
It seems to me that, when I configure the PDOs explicitly using sdoconfigs, it should be redundant to configure them -again- in the <syncManager> section.
(when I changed it, it didn't make a difference)
Thanks,
Reid
That said, my guess is that enabling my AKD drive will be 'easy' once communication is established. Getting pos_fb to change when I turn the motor rotor would be a start.
I'm pretty sure I've got a better chance of getting help if I stick to the generic driver, rather than rolling my own, so I started from scratch again and, in the xml below, the group of sdoconfig's at the top exactly match the sequence shown in Twincat's driver startup tab, and the pdos in the syncManager section match that sequence. This corresponds to the 'premapping over .xml' method suggested by Foxington on 9/12 in this thread.
<masters>
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
<!-- trying to get AKD working-->
<slave idx="0" type="generic" vid="0x6a" pid="0x00414B44" configPdos="true" name="hip"> <!-- vid 0x6a=106=akd 1546=pronet -->
<sdoConfig idx="1C12" subIdx="00"><sdoDataRaw data="00"/></sdoConfig> <!-- clear SM pdos 1C12 -->
<sdoConfig idx="1C13" subIdx="00"><sdoDataRaw data="00"/></sdoConfig> <!-- clear SM pdos 1C13 -->
<sdoConfig idx="1A00" subIdx="00"><sdoDataRaw data="00"/></sdoConfig> <!-- clear PDO 1A00 entries -->
<sdoConfig idx="1A00" subIdx="01"><sdoDataRaw data="10 00 41 60"/></sdoConfig> <!-- PDO entry -->
<sdoConfig idx="1A00" subIdx="00"><sdoDataRaw data="01"/></sdoConfig> <!-- set PDO 1A00 entries -->
<sdoConfig idx="1A01" subIdx="00"><sdoDataRaw data="00"/></sdoConfig> <!-- clear PDO 1A01 entries -->
<sdoConfig idx="1A02" subIdx="00"><sdoDataRaw data="00"/></sdoConfig> <!-- clear PDO 1A02 entries -->
<sdoConfig idx="1A02" subIdx="01"><sdoDataRaw data="10 00 41 60"/></sdoConfig> <!-- PDO entry -->
<sdoConfig idx="1A02" subIdx="02"><sdoDataRaw data="20 00 64 60"/></sdoConfig> <!-- PDO entry -->
<sdoConfig idx="1A02" subIdx="03"><sdoDataRaw data="10 00 77 60"/></sdoConfig> <!-- PDO entry -->
<sdoConfig idx="1A02" subIdx="00"><sdoDataRaw data="03"/></sdoConfig> <!-- set PDO 1A02 entries -->
<sdoConfig idx="1A03" subIdx="00"><sdoDataRaw data="00"/></sdoConfig> <!-- clear PDO 1A03 entries -->
<sdoConfig idx="1600" subIdx="00"><sdoDataRaw data="00"/></sdoConfig> <!-- clear PDO 1600 entries -->
<sdoConfig idx="1600" subIdx="01"><sdoDataRaw data="10 00 40 60"/></sdoConfig> <!-- PDO entry -->
<sdoConfig idx="1600" subIdx="00"><sdoDataRaw data="01"/></sdoConfig> <!-- set PDO 1600 entries -->
<sdoConfig idx="1601" subIdx="00"><sdoDataRaw data="00"/></sdoConfig> <!-- clear PDO 1601 entries -->
<sdoConfig idx="1602" subIdx="00"><sdoDataRaw data="00"/></sdoConfig> <!-- clear PDO 1602 entries -->
<sdoConfig idx="1602" subIdx="01"><sdoDataRaw data="10 00 40 60"/></sdoConfig> <!-- PDO entry -->
<sdoConfig idx="1602" subIdx="02"><sdoDataRaw data="20 00 7A 60"/></sdoConfig> <!-- PDO entry -->
<sdoConfig idx="1602" subIdx="03"><sdoDataRaw data="10 00 B2 60"/></sdoConfig> <!-- PDO entry -->
<sdoConfig idx="1602" subIdx="00"><sdoDataRaw data="03"/></sdoConfig> <!-- set PDO 1602 entries -->
<sdoConfig idx="1603" subIdx="00"><sdoDataRaw data="00"/></sdoConfig> <!-- clear PDO 1603 entries -->
<sdoConfig idx="1C12" subIdx="01"><sdoDataRaw data="02 16"/></sdoConfig> <!-- clear SM pdos 1C12 -->
<sdoConfig idx="1C12" subIdx="00"><sdoDataRaw data="01"/></sdoConfig> <!-- set PDO count 1C12 -->
<sdoConfig idx="1C13" subIdx="01"><sdoDataRaw data="02 1A"/></sdoConfig> <!-- clear SM pdos 1C13 -->
<sdoConfig idx="1C13" subIdx="00"><sdoDataRaw data="01"/></sdoConfig> <!-- set PDO count 1C13 -->
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
<syncManager idx="0" dir="out"/>
<syncManager idx="1" dir="in"/>
<syncManager idx="2" dir="out">
<pdo idx="1602">
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="control" halType="bit"/>
<pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="pos-cmd" halType="s32"/>
<pdoEntry idx="60B2" subIdx="00" bitLen="16" halPin="torq-offset" halType="s32"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1A02">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="status" halType="bit"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="pos-act" halType="S32"/>
<pdoEntry idx="6077" subIdx="00" bitLen="16" halPin="torq-act" halType="S32"/>
</pdo>
</syncManager>
<sdoConfig idx="6060" subIdx="00"><sdoDataRaw data="08"/></sdoConfig> <!-- opmode 8-csp -->
</slave>
</master>
</masters>
[276816.051747] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1C12, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051750] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1C13, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051753] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1A00, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051755] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1A00, subindex = 0x01, data = 0x000000006f725719, size = 4)
[276816.051758] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1A00, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051760] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1A01, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051762] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1A02, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051765] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1A02, subindex = 0x01, data = 0x000000006f725719, size = 4)
[276816.051767] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1A02, subindex = 0x02, data = 0x000000006f725719, size = 4)
[276816.051769] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1A02, subindex = 0x03, data = 0x000000006f725719, size = 4)
[276816.051771] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1A02, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051774] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1A03, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051776] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1600, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051778] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1600, subindex = 0x01, data = 0x000000006f725719, size = 4)
[276816.051780] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1600, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051783] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1601, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051785] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1602, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051787] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1602, subindex = 0x01, data = 0x000000006f725719, size = 4)
[276816.051789] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1602, subindex = 0x02, data = 0x000000006f725719, size = 4)
[276816.051792] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1602, subindex = 0x03, data = 0x000000006f725719, size = 4)
[276816.051794] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1602, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051797] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1603, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051799] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1C12, subindex = 0x01, data = 0x000000006f725719, size = 2)
[276816.051801] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1C12, subindex = 0x00, data = 0x000000006f725719, size = 1)
[276816.051804] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1C13, subindex = 0x01, data = 0x000000006f725719, size = 2)
[276816.051806] EtherCAT DEBUG 0 0:0: ecrt_slave_config_sdo(sc = 0x0000000062016c10, index = 0x1C13, subindex = 0x00, data = 0x000000006f725719, size = 1)
The dmesg listing ends with the following, and I'd like to ask, again, if the 'slave did not sync' message is worth worrying about.
[278877.196732] EtherCAT DEBUG 0-0: Sync after 4992 ms: 3433498 ns
[278877.197730] EtherCAT DEBUG 0-0: Sync after 4992 ms: 3433498 ns
[278877.198730] EtherCAT DEBUG 0-0: Sync after 4992 ms: 3433498 ns
[278877.199730] EtherCAT DEBUG 0-0: Sync after 4996 ms: 3433498 ns
[278877.200730] EtherCAT DEBUG 0-0: Sync after 4996 ms: 3433498 ns
[278877.201729] EtherCAT DEBUG 0-0: Sync after 4996 ms: 3433498 ns
[278877.202730] EtherCAT DEBUG 0-0: Sync after 4996 ms: 3433498 ns
[278877.203732] EtherCAT WARNING 0-0: Slave did not sync after 5000 ms.
[278877.203733] EtherCAT DEBUG 0-0: ref_time=748754634520539000
[278877.203734] EtherCAT DEBUG 0-0: app_time=748754640099714290
[278877.203734] EtherCAT DEBUG 0-0: start_time=748754640199714290
[278877.203735] EtherCAT DEBUG 0-0: cycle=1000000
[278877.203736] EtherCAT DEBUG 0-0: shift_time=0
[278877.203737] EtherCAT DEBUG 0-0: remainder=175290
[278877.203738] EtherCAT DEBUG 0-0: start=748754640200539000
[278877.203739] EtherCAT DEBUG 0-0: Setting DC cyclic operation start time to 748754640200539000.
[278877.204732] EtherCAT DEBUG 0-0: Setting DC AssignActivate to 0x0300.
[278877.210731] EtherCAT 0: Domain 0: Working counter changed to 2/3.
[278877.212733] EtherCAT DEBUG 0-0: Now in SAFEOP.
[278877.222730] EtherCAT DEBUG 0-0: Now in OP. Finished configuration.
[278877.231305] EtherCAT 0: Slave states on main device: OP.
[278878.211729] EtherCAT 0: Domain 0: Working counter changed to 3/3.
0 0:0 OP + AKD EtherCAT Drive (CoE)
Finally, can someone comment on the use of the "configPdos=true" token in the <slave> line?
It seems to me that, when I configure the PDOs explicitly using sdoconfigs, it should be redundant to configure them -again- in the <syncManager> section.
(when I changed it, it didn't make a difference)
Thanks,
Reid
Please Log in or Create an account to join the conversation.
27 Sep 2023 02:27 #281686
by rwistort
Replied by rwistort on topic Hal to Registers. Come in, Registers. Over.
What do you get when you cross a black hole with a can of worms?
A time sucking worm-hole to 0x0666:0.
I was about to burn out when I stumbled upon a sample AKD configuration on the Driver Forum.
It worked. It solved my problem. And it helped me to understand.
A grateful thanks to sockheaven for posting his work in the driver forum .
And to foxington. I can tell you've been there.
I'm in a better place now.
Reid
A time sucking worm-hole to 0x0666:0.
I was about to burn out when I stumbled upon a sample AKD configuration on the Driver Forum.
It worked. It solved my problem. And it helped me to understand.
A grateful thanks to sockheaven for posting his work in the driver forum .
And to foxington. I can tell you've been there.
I'm in a better place now.
Reid
Please Log in or Create an account to join the conversation.
Time to create page: 0.101 seconds