Open scottlaird opened 4 months ago
Okay, fixed the bug in lcec_configgen
(it only recognized new slaves after it saw the device name in ethercat -v slaves
, and the Rovix doesn't have a name.). I also added multi-channel support to lcec_configgen
, so here's what I see:
<slave idx="22" type="basic_cia402" vid="0x00000227" pid="0x00000005" name="D23">
<modParam name="ciaChannels" value="6"/>
<modParam name="ch1enablePP" value="true"/>
<modParam name="ch1enableHM" value="true"/>
<modParam name="ch1enableCSP" value="true"/>
<modParam name="ch1enableActualFollowingError" value="true"/>
<modParam name="ch1enableFollowingErrorWindow" value="true"/>
<modParam name="ch1enableHomeAccel" value="true"/>
<modParam name="ch1enableProfileAccel" value="true"/>
<modParam name="ch1enableProfileDecel" value="true"/>
<modParam name="ch1enableProfileMaxVelocity" value="true"/>
<modParam name="ch1enableProfileVelocity" value="true"/>
<modParam name="ch1enableVelocityDemand" value="true"/>
<modParam name="ch1enableVelocitySensorSelector" value="true"/>
<modParam name="ch2enablePP" value="true"/>
<modParam name="ch2enableHM" value="true"/>
<modParam name="ch2enableCSP" value="true"/>
<modParam name="ch2enableActualFollowingError" value="true"/>
<modParam name="ch2enableFollowingErrorWindow" value="true"/>
<modParam name="ch2enableHomeAccel" value="true"/>
<modParam name="ch2enableProfileAccel" value="true"/>
<modParam name="ch2enableProfileDecel" value="true"/>
<modParam name="ch2enableProfileMaxVelocity" value="true"/>
<modParam name="ch2enableProfileVelocity" value="true"/>
<modParam name="ch2enableVelocityDemand" value="true"/>
<modParam name="ch2enableVelocitySensorSelector" value="true"/>
<modParam name="ch3enablePP" value="true"/>
<modParam name="ch3enableHM" value="true"/>
<modParam name="ch3enableCSP" value="true"/>
<modParam name="ch3enableActualFollowingError" value="true"/>
<modParam name="ch3enableFollowingErrorWindow" value="true"/>
<modParam name="ch3enableHomeAccel" value="true"/>
<modParam name="ch3enableProfileAccel" value="true"/>
<modParam name="ch3enableProfileDecel" value="true"/>
<modParam name="ch3enableProfileMaxVelocity" value="true"/>
<modParam name="ch3enableProfileVelocity" value="true"/>
<modParam name="ch3enableVelocityDemand" value="true"/>
<modParam name="ch3enableVelocitySensorSelector" value="true"/>
<modParam name="ch4enablePP" value="true"/>
<modParam name="ch4enableHM" value="true"/>
<modParam name="ch4enableCSP" value="true"/>
<modParam name="ch4enableActualFollowingError" value="true"/>
<modParam name="ch4enableFollowingErrorWindow" value="true"/>
<modParam name="ch4enableHomeAccel" value="true"/>
<modParam name="ch4enableProfileAccel" value="true"/>
<modParam name="ch4enableProfileDecel" value="true"/>
<modParam name="ch4enableProfileMaxVelocity" value="true"/>
<modParam name="ch4enableProfileVelocity" value="true"/>
<modParam name="ch4enableVelocityDemand" value="true"/>
<modParam name="ch4enableVelocitySensorSelector" value="true"/>
<modParam name="ch5enablePP" value="true"/>
<modParam name="ch5enableHM" value="true"/>
<modParam name="ch5enableCSP" value="true"/>
<modParam name="ch5enableActualFollowingError" value="true"/>
<modParam name="ch5enableFollowingErrorWindow" value="true"/>
<modParam name="ch5enableHomeAccel" value="true"/>
<modParam name="ch5enableProfileAccel" value="true"/>
<modParam name="ch5enableProfileDecel" value="true"/>
<modParam name="ch5enableProfileMaxVelocity" value="true"/>
<modParam name="ch5enableProfileVelocity" value="true"/>
<modParam name="ch5enableVelocityDemand" value="true"/>
<modParam name="ch5enableVelocitySensorSelector" value="true"/>
<modParam name="ch6enablePP" value="true"/>
<modParam name="ch6enableHM" value="true"/>
<modParam name="ch6enableCSP" value="true"/>
<modParam name="ch6enableActualFollowingError" value="true"/>
<modParam name="ch6enableFollowingErrorWindow" value="true"/>
<modParam name="ch6enableHomeAccel" value="true"/>
<modParam name="ch6enableProfileAccel" value="true"/>
<modParam name="ch6enableProfileDecel" value="true"/>
<modParam name="ch6enableProfileMaxVelocity" value="true"/>
<modParam name="ch6enableProfileVelocity" value="true"/>
<modParam name="ch6enableVelocityDemand" value="true"/>
<modParam name="ch6enableVelocitySensorSelector" value="true"/>
</slave>
Note, there are updates on #180. Specifically, the Rovix is giving somewhat odd EtherCAT errors right now:
[191031.899201] EtherCAT WARNING 0-26: PDOs configured for SM2, but slave does not provide the sync manager information!
[191031.899207] EtherCAT WARNING 0-26: PDOs configured for SM3, but slave does not provide the sync manager information!
[191031.899208] EtherCAT ERROR 0-26: Failed to determine PDO sync manager for FMMU!
I'll look into it once I've made progress on other devices. I suspect that the Rovix's EtherCAT code is a bit flaky.
Ah, I think I figured it out -- this device don't have configurable PDOs. Which is weird for a CiA 402 device, but it's probably easy enough to handle.
No, that's not the problem either. From the Etherlab FAQ (wayback machine), it looks like the SII is set up wrong for the device. It looks like it can be rebuilt via TwinCAT from the ESI XML.
We don't have the ESI XML either.
It's probably possible to create a correct SII config by hand, but I don't have the tools for that today.
FWIW, here's a hexdump of the SII (fetched via ethercat sii_read
):
0000000 0e89 cc80 1388 0000 0000 8000 0000 008a
0000010 0227 0000 0005 0000 0001 0000 0000 0000
0000020 0000 0000 0000 0000 0000 0000 0000 0000
0000030 1000 0080 1400 0080 000c 0000 0000 0000
0000040 0000 0000 0000 0000 0000 0000 0000 0000
*
0000070 0000 0000 0000 0000 0000 0000 000f 0001
0000080
siitool decodes that as:
Error, SII probably malformed. No 0xffff at the end found
First print preamble and config
Preamble:
PDI Control: ................ 0x0e89
PDI Config: ................. 0xcc80
Sync Impulse Length: ........ 50000 ns (raw: 0x1388)
PDI Config 2: ............... 0x0000
Configured Station Alias: ... 0x0000
Checksum of Preamble: ....... 0x008a (ok)
Identity:
Vendor ID: ................ 0x00000227
Product ID: ............... 0x00000005
Revision ID: .............. 0x00000001
Serial Number: ............ 0x00000000
Default mailbox settings:
Bootstrap Mailbox:
Received Mailbox Offset: .. 0x0000
Received Mailbox Size: .... 0
Send Mailbox Offset: ...... 0x0000
Send Mailbox Size: ........ 0
Mailbox Settings:
Received Mailbox Offset: .. 0x1000
Received Mailbox Size: .... 128
Send Mailbox Offset: ...... 0x1400
Send Mailbox Size: ........ 128
Supported Mailboxes:
CoE ....................... True
EoE ....................... False
FoE ....................... True
SoE ....................... False
VoE ....................... False
EEPROM size: ................ 2048 bytes
Version: .................... 1
Appending a pair of FF
bytes to the end seems to have fixed the siitool
warnings. I was able to write that back to the device successfully via sii_write
, but it's still giving the same errors, and comparing to other devices the SII data is tiny. There should be a block for FMMU and maybe a block for SyncManager, and they just don't exist here. I may try to cobble them together at some point, but its tricky when there's no manufacturer data available.
Support the Rovix ESD-A6 stepper drive. This is a 6-channel, open-loop, 24V stepper drive, on loan from @DesertShedStudio.
There is no documentation for this online, and there aren't a ton of them around, but it's a simple multi-axis controller, so it's probably a good test case.
First impressions aren't great;
ethercat slaves
shows it as:Running
ethercat pdos -p 22
shows nothing.Running
lcec_configgen
also shows nothing, not even a generic entry. I see debugging in my near future. As a workaround,ethercat upload -p 22 0x6502 0
gives 0xa1, which is (binary) 1010_0001, which means that it claims to supportpp
,hm
, andcsp
modes. Interesting, this is the first device I've seen (out of a very small sample) that doesn't support any velocity modes.Fortunately,
ethercat sdos
looks like it works:This is from a Korean company, but the SDO descriptions are all in English, which is nice. It also looks like they're using 3D printer-ish stepper drives, which isn't surprising. Honestly, this is more of a 3D printer drive than something that you'd use on a CNC, but that's fine. Kind of interesting, actually.