Custom EtherCAT device
26 May 2023 19:51 #272225
by rodw
Replied by rodw on topic Custom EtherCAT device
Dominc's cia402 comp is here github.com/dbraun1981/hal-cia402
It correctly sequences the startup steps and provides a method for homing. I think he had absolute encoders on his drives to his solution home to.
The homing method does not work using internal homing where home sensors are attached to the drive.
The solution is to rewrite the homing sequence in homing.c so that all the intermediate steps done by Linuxcnc homing are skipped and just wait until the drive says I am homed.
Homing is now a replaceable module set in the InI file or on the linuxcnc command line and you can write your own homing module so homing.c is not modified
Start here: linuxcnc.org/docs/2.9/html/man/man9/homecomp.9.html
It correctly sequences the startup steps and provides a method for homing. I think he had absolute encoders on his drives to his solution home to.
The homing method does not work using internal homing where home sensors are attached to the drive.
The solution is to rewrite the homing sequence in homing.c so that all the intermediate steps done by Linuxcnc homing are skipped and just wait until the drive says I am homed.
Homing is now a replaceable module set in the InI file or on the linuxcnc command line and you can write your own homing module so homing.c is not modified
Start here: linuxcnc.org/docs/2.9/html/man/man9/homecomp.9.html
The following user(s) said Thank You: Aciera
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 661
- Thank you received: 113
26 May 2023 20:49 #272228
by smc.collins
Replied by smc.collins on topic Custom EtherCAT device
they have entire reference designs and most of those mcu are below $30, thats hardly expensive, unless you expect free
Please Log in or Create an account to join the conversation.
27 May 2023 06:10 #272247
by RDA
Replied by RDA on topic Custom EtherCAT device
Expensive is subjective I guess. I would say also that it is expensive and not for a hobbyist.
If the price is let’s say 30$ then it’s roughly double compared to LAN9252 paired with an MCU.
Then as it’s BGA packaged you probe need to get the whole pcb bought as assembled, that’s going to increase you cost even more. So let’s say you can do the LAN9252 version for 50$ and the TI version ends up at 100$ (imaginary numbers), at that point I would call it expensive (the TI dev kit is around 300$, LAN9252 ~166$).
Looking at just the chip price doesn’t matter if you don’t consider all the other things you need to take care to be actually able to use it.
If the price is let’s say 30$ then it’s roughly double compared to LAN9252 paired with an MCU.
Then as it’s BGA packaged you probe need to get the whole pcb bought as assembled, that’s going to increase you cost even more. So let’s say you can do the LAN9252 version for 50$ and the TI version ends up at 100$ (imaginary numbers), at that point I would call it expensive (the TI dev kit is around 300$, LAN9252 ~166$).
Looking at just the chip price doesn’t matter if you don’t consider all the other things you need to take care to be actually able to use it.
Please Log in or Create an account to join the conversation.
27 May 2023 07:10 #272249
by Tady
Replied by Tady on topic Custom EtherCAT device
Aslo I live in centeal Europe and I source all of my parts from Farnell. And they don't source them.
For now I'm sticking with the LAN chip but I think this one is not souited for motion control (I read it somewhere) but I will try to interface it with an Sanyo Denky analog driver just for fun...
For now I'm sticking with the LAN chip but I think this one is not souited for motion control (I read it somewhere) but I will try to interface it with an Sanyo Denky analog driver just for fun...
Please Log in or Create an account to join the conversation.
27 May 2023 07:45 #272250
by RDA
Replied by RDA on topic Custom EtherCAT device
I dont know why the LAN9252 would not be suitable for motion control? Well the chip alone is not, but paired with a microcontroller and you can do “whatever” you want.
Unlike the TI and Axis chips, you need to pair the LAN chip with a MCU for anything else than simple IO.
The TI and Axis chips combine the ethercat gateway and MCU so they are faster but the LAN through SPI will be fast enough for any “normal” project.
Unlike the TI and Axis chips, you need to pair the LAN chip with a MCU for anything else than simple IO.
The TI and Axis chips combine the ethercat gateway and MCU so they are faster but the LAN through SPI will be fast enough for any “normal” project.
Please Log in or Create an account to join the conversation.
27 May 2023 09:43 #272254
by Tady
Replied by Tady on topic Custom EtherCAT device
I'm in early stages of coding this but I did some measurements of the time it takes and I couldn't get it under 1ms.. More like 1.7ms cycle time.. I did try overclocking the SPI from 18MHz to 36MHz and there wasn't any improvement... I will try a different IC just fir the heck of it. The LAN IC dies support up to 50MHz. I'm curently using pooling mode for testing, but I did see different projects that tried using DMA but were unsuccessful ..
Please Log in or Create an account to join the conversation.
27 May 2023 12:01 #272262
by RDA
Replied by RDA on topic Custom EtherCAT device
I’m now writing this the third time as previous posts lost in bit space because of a forum error…
You should be able to get much faster (sub ms) speeds. You can see some hackaday benchmarks from here:
hackaday.io/project/181058-ethercat-serv...an9252-spi-with-soes
Maybe push the SPI speed to 50Mhz?:
microchip.my.site.com/s/article/My-SPI-a...o-do-to-improve-this
You should also check out SOES if you didn’t already know about it:
github.com/OpenEtherCATsociety/SOES
As far as I know LAN9252 does not support DMA.
Good luck with the project.
You should be able to get much faster (sub ms) speeds. You can see some hackaday benchmarks from here:
hackaday.io/project/181058-ethercat-serv...an9252-spi-with-soes
Maybe push the SPI speed to 50Mhz?:
microchip.my.site.com/s/article/My-SPI-a...o-do-to-improve-this
You should also check out SOES if you didn’t already know about it:
github.com/OpenEtherCATsociety/SOES
As far as I know LAN9252 does not support DMA.
Good luck with the project.
The following user(s) said Thank You: Tady
Please Log in or Create an account to join the conversation.
27 May 2023 12:09 #272263
by Tady
Replied by Tady on topic Custom EtherCAT device
Yes I saw this... I think the problem is the library.. I tried EasyCat on arduino platform and I ported the code to STM32. The first thing that I saw is that SPI_Transmit (or spi.write in arduino ) gets called each time for ever y single byte.. This has to be a bottleneck.
So my work starts here. If there will be no improvement I will use abothwr stack. But rhis one is veryyyy simple.
I can't push it to 50MHz because the current MCU that I used only supports 18MHz (manual overclocking gets it up to 36 but stability can be an issue)
Thank you for the links and the debate
So my work starts here. If there will be no improvement I will use abothwr stack. But rhis one is veryyyy simple.
I can't push it to 50MHz because the current MCU that I used only supports 18MHz (manual overclocking gets it up to 36 but stability can be an issue)
Thank you for the links and the debate
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 661
- Thank you received: 113
27 May 2023 16:39 - 27 May 2023 16:42 #272271
by smc.collins
Replied by smc.collins on topic Custom EtherCAT device
they have c2000 dev boards starting at $49, with ethercat onboard and a entire rtos library with encoder i2c etc for those boards.
check mouser and digikey
look at the launchxl boards they are designed specifically for robotics motor control etc.
check mouser and digikey
look at the launchxl boards they are designed specifically for robotics motor control etc.
Last edit: 27 May 2023 16:42 by smc.collins.
Please Log in or Create an account to join the conversation.
27 May 2023 19:35 #272284
by rodw
Replied by rodw on topic Custom EtherCAT device
There is something very wrong with the implementation if this is truly the results you experienced. I went to an Ethercat seminar recently and it can handle 1000 I/0's in 30 usec
Tady post=272254 userid=23955I'm in early stages of coding this but I did some measurements of the time it takes and I couldn't get it under 1ms.. More like 1.7ms cycle time.. I did try overclocking the SPI from 18MHz to 36MHz and there wasn't any improvement... I will try a different IC just fir the heck of it. The LAN IC dies support up to 50MHz. I'm curently using pooling mode for testing, but I did see different projects that tried using DMA but were unsuccessful ..
Attachments:
Please Log in or Create an account to join the conversation.
Time to create page: 0.465 seconds