Ethercat HAL driver

More
17 Dec 2020 17:18 - 17 Dec 2020 17:23 #192260 by jc2ktr

Hello @jc2ktr,

Well, the first thing is to reconfigure the driver in TWINCAT3, that it works in OP and you can move the engines, I attach the program in TWINCAT3 with the modified PDOs according to linuxcnc-ethercat, now you will have to configure the rest yourself, compare and see if you help.


I attach an image of where to change the PDOs, if you change the operating mode you will also have to change them.


I attach an image of where you have the configuration in blue, it is configured in mode 8, (position) you will have to read the manual to see the different modes to see which one interests you the most

Greeting
Chimeno


Hello @ Chimeno,

i´ve tried today to get my Drive in OP-State under Linux without Succes :(
I opend your TwinCAT Project and tried to Compare it with mine, which i will add to my Post also.

What i don´t understand at the moment is, do i have to add every single PDO entry to the PDO Content list in TwinCAT which i want to use under LinuxCNC? For Example the ControlWord includes more than one entries. Do i have to add every single one to the list?

The at the moment Preferred mode is #8 The CSP-Mode. At the moment it is more important that the configuration works somehow.

In the long term i will then See if its suitable.


Thanks
Attachments:
Last edit: 17 Dec 2020 17:23 by jc2ktr. Reason: Edit

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

More
19 Dec 2020 08:45 - 19 Dec 2020 08:47 #192438 by chimeno
Hello @jc2ktr

i´ve tried today to get my Drive in OP-State under Linux without Succes :(

Well, if we get it!!

I opend your TwinCAT Project and tried to Compare it with mine, which i will add to my Post also.

In my project I need to register PDO.

What i don´t understand at the moment is, do i have to add every single PDO entry to the PDO Content list in TwinCAT which i want to use under LinuxCNC? For Example the ControlWord includes more than one entries. Do i have to add every single one to the list?

You just have to add the PDOs you need to use, for example: within the
1600
record
6040 control word
6060 operation mode
607a target position
60ff tarjet velocity


it is best to leave the EC60 device by default, one way to do it is with TWINCAT3, add a new device (don't read it) just register again the default form that comes with TWINCAT3, it should work again and take it to OP then you can use the file of the user @MRBaird that uses the generic form

Greeting
Chimeno
Last edit: 19 Dec 2020 08:47 by chimeno.

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

More
19 Dec 2020 09:52 #192442 by jc2ktr

Hello @jc2ktr

it is best to leave the EC60 device by default, one way to do it is with TWINCAT3, add a new device (don't read it) just register again the default form that comes with TWINCAT3, it should work again and take it to OP then you can use the file of the user @MRBaird that uses the generic form

Greeting
Chimeno


Hello @Chimeno,

I tried to remove the device and add a new device, hope i´ve done it the right way, made Screenshots of how i´ve done it.
The question is, should i activate the Configuration in TwinCAT or is it enough to add it.

Thanks for your patience with me :)
Attachments:

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

More
19 Dec 2020 10:29 #192444 by chimeno
Hello @jc2ktr

I tried to remove the device and add a new device, hope i´ve done it the right way, made Screenshots of how i´ve done it.
The question is, should i activate the Configuration in TwinCAT or is it enough to add it.

If you have to configure the device and activate it, you should have it in NC mode, the device has to go to OP and be able to move the motor.

Thanks for your patience with me :)

Don't worry, I'm like you too, and at the beginning everything costs a lot to understand and work.


Greeting
Chimeno
The following user(s) said Thank You: jc2ktr

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

More
19 Dec 2020 16:05 #192463 by jc2ktr

Hello @jc2ktr

I tried to remove the device and add a new device, hope i´ve done it the right way, made Screenshots of how i´ve done it.
The question is, should i activate the Configuration in TwinCAT or is it enough to add it.

If you have to configure the device and activate it, you should have it in NC mode, the device has to go to OP and be able to move the motor.

Thanks for your patience with me :)

Don't worry, I'm like you too, and at the beginning everything costs a lot to understand and work.

Hi @Chimeno,

i am back under LinuxCNC, most of my EC-Slaves are OP only my ECT-Drive still don't do anything.

Started LinuxCNC and enabled the Machine, after that i've done a dmesg see attachment.

After starting the Ethercat bus it tells me following:

[ 1502.144042] EtherCAT ERROR 0-main-7: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[ 1502.148059] EtherCAT ERROR 0-main-7: AL status message 0x0036: "DC Sync0 Cycle Time".

and later then

[ 1741.894170] EtherCAT ERROR 0-main-7: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[ 1741.898181] EtherCAT 0: Slave states on main device: PREOP, OP + ERROR.
[ 1741.898183] EtherCAT ERROR 0-main-7: AL status message 0x0036: "DC Sync0 Cycle Time".
[ 1741.906199] EtherCAT 0-main-7: Acknowledged state PREOP.


don't know at the moment what this messages try to tell me :(




Greeting
Chimeno

Attachments:

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

More
19 Dec 2020 16:52 - 19 Dec 2020 17:17 #192464 by chimeno
Hello @jc2ktr

can you publish the .xml configuration file? I'll take a look at it

After studying a little, mode 8 is position by synchronism therefore the way to act is this:

0x1A00 TXPDO1
-the status register is 0x6041
-the position is 0x6064

0x1600 RXPDO1
-the control register is 0x6040
-register 0x6060 send operation mode 8
-send position to register 0x607A

Greeting
Chimeno
Last edit: 19 Dec 2020 17:17 by chimeno. Reason: Edit

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

More
19 Dec 2020 19:22 #192470 by jc2ktr
@Chimeno

i added my .XML as attachment.
Attachments:

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

More
19 Dec 2020 21:20 - 19 Dec 2020 21:37 #192480 by chimeno
Hello @jc2ktr

Could it be that registers of more than one bit cannot be registered in bit mode?
you rectified the file you can try??

I am also not very clear about the SDO record in that format is correct, I think it is better to configure the value by PDO and simply register it with HAL
setp lcec.0.7.opmode 8

also the
appTimePeriod
value should be equal to the servo thread value

Greeting
Chimeno
Attachments:
Last edit: 19 Dec 2020 21:37 by chimeno. Reason: Edit

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

More
20 Dec 2020 14:09 #192540 by RobinTheunis
Replied by RobinTheunis on topic Ethercat HAL driver
Hi all,

We have converted our cnc router to ethernet. But we are struggeling quite a bit with the tuning of our machine.
The machine running internal feedback, so no encoders on the stepper motors. We have kept the original drives and used EL2521 to generate the STEP and DIR signals.

The problem that we see is when we increase the MAX_ACCELERATION above a certain point, we are seeing oscillations in the movement. Only decreasing the P values will remove these oscillations which will increase the following error.

Does anyone have an example on a working config for EL2521 or knows what we are doing wrong?

I have included our configs
Attachments:

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

More
20 Dec 2020 14:30 #192541 by jc2ktr

Hello @jc2ktr

Could it be that registers of more than one bit cannot be registered in bit mode?
you rectified the file you can try??

I am also not very clear about the SDO record in that format is correct, I think it is better to configure the value by PDO and simply register it with HAL
setp lcec.0.7.opmode 8

also the
appTimePeriod
value should be equal to the servo thread value

Greeting
Chimeno


Hi @Chimeno,

thanks for your help, that did it, i got all the slaves OP. Can enable the drive and readout the actpos.

But when i try to jog de Axis does not move. Somewhere i missed something to connect in my HAL file.
Attachments:

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

Time to create page: 0.190 seconds
Powered by Kunena Forum