Ethercat for VESC

General topics and discussions about the VESC and its development.
erwincoumans
Posts: 25
Joined: 16 Dec 2015, 02:16

Ethercat for VESC

Postby erwincoumans » 26 Nov 2016, 20:08

Did anyone try connecting to VESC using Ethercat?

The Ethercat shorter cycle times would allow VESC to be used in robotics applications, it is superior to CANBUS.

There are some affordable solutions by Infineon Technologies and Microchip (LAN9252).
One easy integration would be connecting an Ethercat client to the VESC motor controller over SPI...

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: Ethercat for VESC

Postby benjamin » 29 Nov 2016, 15:06

I have actually thought about connecting VESCs over ethernet for robotics applications, but by using the 100-pin version of the stm32f4 and an ethernet switch such as this one:
http://www.microchip.com/wwwproducts/en/KSZ8863
It can be connected directly to the RMII interface of the stm32f4 and to two transformers for the ethernet cables - making it possible to chain all VESCs without having individual cables and a switch. The propagation delay would be low because the switches won't buffer lots of packets, and the speed is high. I haven't seen the LAN9252 before, but it seems to have an MII interface, and since it is for ethercat it might be a better solution.

guoping
Posts: 2
Joined: 08 Apr 2017, 16:02

Re: Ethercat for VESC

Postby guoping » 08 Apr 2017, 16:11

Hi erwincoumans, I also want to connect VESC using Ethercat.
One easy integration would be connecting an Ethercat client to the VESC motor controller over SPI...

Did you try to connect vesc to ethercat client over SPI? Does it work?

JTAG
Posts: 11
Joined: 05 Apr 2016, 13:08
Location: Leeuwarden

Re: Ethercat for VESC

Postby JTAG » 08 Apr 2017, 22:28

I plan to work on exactly this once the sources are released. I already made a universal slave based on the LAN9252 and SOES:
https://github.com/DieBieEngineering/DieBieSlave

And made it work with a nun-chuck, everthing is working flawless so far:
https://github.com/DieBieEngineering/Di ... e-Firmware

I will make a video of the universal slave and nunchuck working with TwinCAT somewhere next week.

I hear/sense so much need for affordable universal motor drivers from the robotics faculty where I work that it would be almost a crime not to add EtherCAT to the VESC :D .

guoping
Posts: 2
Joined: 08 Apr 2017, 16:02

Re: Ethercat for VESC

Postby guoping » 09 Apr 2017, 09:00

JTAG wrote:I plan to work on exactly this once the sources are released. I already made a universal slave based on the LAN9252 and SOES:
https://github.com/DieBieEngineering/DieBieSlave

And made it work with a nun-chuck, everthing is working flawless so far:
https://github.com/DieBieEngineering/Di ... e-Firmware

I will make a video of the universal slave and nunchuck working with TwinCAT somewhere next week.

I hear/sense so much need for affordable universal motor drivers from the robotics faculty where I work that it would be almost a crime not to add EtherCAT to the VESC :D .


Great. Looking forward to your video demo. Do you have a rough idea of how fast your DieBieSlave can go (e.g. 1kHz with 48 Bytes input (sensory feedback from VESC to high level controller) and 16 Bytes output (from high level controller to VESC))? I want to use VESC for impedance/position/force control (depends on robot state).

Frederir
Posts: 4
Joined: 05 Apr 2017, 09:25

Re: Ethercat for VESC

Postby Frederir » 09 Apr 2017, 11:34

JTAG wrote: I already made a universal slave based on the LAN9252 and SOES


In the Github's readme you say : " Whilst the ET1100 has a transparant interface to its internal RAM over SPI the LAN9252 has not and needs some form of adres translation that prevents large chunks of (PDO) data to be written in a single block, this prevents the use of DMA syncing between uC and LAN9252. The only alternative is rather software labour intensive (the adres translation needs to be done in software) compared to its DMA alternative. This is no deal breaker for sensor acquisition (sensors need very little processor power) but will be a drawback in realtime systems like motor controllers."

After a quick look to datasheet it seem possible to interface the host bus on LAN9252 to FMC in mode PC Card controller present in STM32F42xx or STM32F43xx. It would allow DMA access and higher bandwidth between the LAN9252 and the uC.

What do you think ?

JTAG
Posts: 11
Joined: 05 Apr 2016, 13:08
Location: Leeuwarden

Re: Ethercat for VESC

Postby JTAG » 09 Apr 2017, 19:31

Frederir wrote:"After a quick look to datasheet it seem possible to interface the host bus on LAN9252 to FMC in mode PC Card controller present in STM32F42xx or STM32F43xx. It would allow DMA access and higher bandwidth between the LAN9252 and the uC."
What do you think ?


I don't know what you mean by "to interface the host bus on LAN9252 to FMC in mode PC Card controller present in...."

http://ww1.microchip.com/downloads/en/A ... 01907C.pdf figure 11 to 14 explains the difference.

There might be an obvious optimisation I missed that enable me to use DMA for PDO updating :roll: , please tell me if you see it.

Frederir
Posts: 4
Joined: 05 Apr 2017, 09:25

Re: Ethercat for VESC

Postby Frederir » 09 Apr 2017, 22:06

JTAG wrote:
I don't know what you mean by "to interface the host bus on LAN9252 to FMC in mode PC Card controller present in...."

http://ww1.microchip.com/downloads/en/A ... 01907C.pdf figure 11 to 14 explains the difference.

There might be an obvious optimisation I missed that enable me to use DMA for PDO updating :roll: , please tell me if you see it.



My understanding was the impossibility of using DMA is related to the SPI interface. And I was wondering if using a parallel bus (HBI indexed mode 16 bit in LAN9252 vocabulary) Figure 7 in the application note you mentioned would lift this impossibility. I need to look into it further.

JTAG
Posts: 11
Joined: 05 Apr 2016, 13:08
Location: Leeuwarden

Re: Ethercat for VESC

Postby JTAG » 09 Apr 2017, 23:49

As far as I understood all ways of interfacing need this weird way of indirect addressing, but please tell me I missed something :roll: , I would really like to use the LAN9252 in a more efficient way. The two integrated Phy's make pcb design and component count so so much more pleasant/compact to design.

Frederir
Posts: 4
Joined: 05 Apr 2017, 09:25

Re: Ethercat for VESC

Postby Frederir » 10 Apr 2017, 12:21

JTAG wrote:As far as I understood all ways of interfacing need this weird way of indirect addressing, but please tell me I missed something :roll: , I would really like to use the LAN9252 in a more efficient way. The two integrated Phy's make pcb design and component count so so much more pleasant/compact to design.


Reading the LAN9252 datasheet and AN1907 and AN1995 I can say it's not entirely clear in my head. :?

But in AN1907 it is said in 1.4.3.2.1 when in HBI "The EtherCAT Process RAM can be accessed directly through FIFOs and the FIFOs are accessed when reading or writing at address 18h-1Bh."

Still not clear if DMA is usable in this situation.

F.


Return to “General”

Who is online

Users browsing this forum: No registered users and 6 guests