@Collins,
very nice, my only other bitch is that, encoder and position feedback are not interrupt driven but polled, this creates issues with positional accuracy at very high speeds and very high accuracy.
I don't really get the outcome of the problem. Is this related to a PID controller that's going wild using high speeds?
@Aleksam,
Yes, that's exactly how it should be.
You can setup multiple thread's attached to work with a certain memory region to create hal pins in.
Each thread can run on it's own assigned cpu.
Then when using a interpreter with multiple sub-interpreters, we can likely run this from userland.
Then the position command's of the interpreter's will be passed to a buffer to be executed by
motion components.
** Current status **
As the current status is testing real hardware with ethercat. No interpreter's are running yet.
Only a few realtime thread's are running over some hal pins, to test and verify all is working.
I realized that the original linuxcnc-ethercat source code is not able to parse the command:
"$ ethercat xml" output.
This command gives a xml ethercat bus configuration or esi file output in the terminal.
You should expect that using this as configurator is the ultimate solution. This way could setup the hal pins automaticly for each slave.
As i am diving deeper into the etherlab's source code, we can ask for the slave list in c++ by scanning the network :
// Scan network
ec_slave_info_t slave_info;
for (uint16_t slave_pos = 0;; slave_pos++) {
if (ecrt_master_get_slave(master, slave_pos, &slave_info)) {
break; // No more slaves
}
printf("Slave %d: Name: %s, Vendor ID: 0x%08X, Product Code: 0x%08X\n",
slave_pos, slave_info.name, slave_info.vendor_id, slave_info.product_code);
}
Output:
Slave 0: Name: EK1100 EtherCAT Coupler (2A E-Bus), Vendor ID: 0x00000002, Product Code: 0x044C2C52
Slave 1: Name: EL2124 4K. Dig. Ausgang 5V, 20mA, Vendor ID: 0x00000002, Product Code: 0x084C3052
Slave 2: Name: EL2124 4K. Dig. Ausgang 5V, 20mA, Vendor ID: 0x00000002, Product Code: 0x084C3052
Slave 3: Name: EL2124 4K. Dig. Ausgang 5V, 20mA, Vendor ID: 0x00000002, Product Code: 0x084C3052
Slave 4: Name: EL1004 4K. Dig. Eingang 24V, 3ms, Vendor ID: 0x00000002, Product Code: 0x03EC3052
Slave 5: Name: EL2808 8K. Dig. Ausgang 24V, 0.5A, Vendor ID: 0x00000002, Product Code: 0x0AF83052
Slave 6: Name: EL2794 4K. Dig. Ausgang 24V AC/DC, 2A, kurzschlussfest, Vendor ID: 0x00000002, Product Code: 0x0AEA3052
Then there are more commands to use, to retrieve more info.
The idea is then to automaticly create the ethercat hal pin's at runtime, conform the network scanning.
For example, this is a
handmade setup file
to setup the slave's, add hal pin's etc. It's a lot off work to do.
For new users this can be difficult task.
However it works fine and gives a complete overview how ethercat interact's with the outside world.
Will try to automate the ethercat configuration process for hal pins.