Ethercat compatible Encoder board tentative STM32F4 + LAN9252

More
10 months 2 weeks ago #340189 by vibram
This is always the issue when you know nothing and you use AIimage missing /media/kunena/emoticons/devil.png
Thank you i will try to start again from your repo and adapt the SPI. However, I also tried somehardware modification on the board, not sure it still works correctly.

 

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

More
10 months 2 weeks ago - 10 months 2 weeks ago #340209 by Hakan
It's better I give you a hand in those situations. So you have a version you always can come back to that works.
And then you can be creative on top of that get lost from there.
But what you have described you want to do, you are more or less finished already.
There is of course the whole packaging story, Din-rail? box, other? external power supply, connectors, photo-diodes on encoder input?
Stacking of several units? Can you perhaps use the 16-bit counters and have several counters on board? Is there a MCU with several 32-bit encoders you can use/switch to. Just because it works doesn't mean it is finished. For sure it can be optimized.
Right now it runs in free-run mode, should probably go over to DC-sync mode and there is a bit of programming for that. Same HW though.

Microchip has come out with several schematics for their evaluation boards, here is one ww1.microchip.com/downloads/en/DeviceDoc...PIO16.Mode.Rev.A.pdf Here is another ww1.microchip.com/downloads/aemDocuments...DIG-IO-EVB-REV-B.pdf and you find schematics in my KiCaD files.
Last edit: 10 months 2 weeks ago by Hakan.
The following user(s) said Thank You: besriworld

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

More
10 months 2 weeks ago #340236 by vibram
Hello
Thank you for pushing me :)

I took back your project and build with the SPI2, flash you r eeprom and it worked well, im in OP mode in free run.

As I'm a beginner, my goal is to have a working base (basically yours...) and edit in order to adapt my needs.
Now I have the SPI working well, I will try to integrate my encoder from thise base

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

More
10 months 2 weeks ago #340237 by meister
A little tip for non-Windows users: you don't need TwinCat to read, write, edit or convert .bin/.xml esi files.

github.com/multigcs/esitool
The following user(s) said Thank You: vibram

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

More
10 months 2 weeks ago - 10 months 2 weeks ago #340238 by vibram
Hello,
I updated the GIT.
I managed to flash my eeprom correctly however with the current I-m stuck in with this compilation issue:
Code:
ecat_slv.c.text.RXPDO_update+0x1c): undefined reference to `rxpdo' I just cleaned the cb_get_inputs(void) and cb_set_outputs(void) compared to the working code and put my eeprom file in folder soes-esi In order to compile i can add this in main.cpp [code]// Definition of rxpdo needed when MAX_MAPPINGS_SM2 is 0 uint8_t rxpdo_buffer[512]; uint8_t *rxpdo = rxpdo_buffer; but if i do so, I-m stuck in ERR PREOP step
[/code]
Last edit: 10 months 2 weeks ago by vibram.

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

More
10 months 2 weeks ago - 10 months 2 weeks ago #340241 by Hakan
I saw that one, that was a new one to me.
How about not solving it, and instead go around it?
Add a PDO say scale as rxpdo? I mean anything useful, you don't need to do anything with it, just a place holder.
Then you don't need that declaration in main.cpp.
I have always had rxpdos so had not encountered that before.
I can try to see what's going on in the code a bit later.

Meister, I think it is how you go from the comfort zone with Twincat to the deep waters in linux.
I read and write eeprom with "ethercat sii_read" and "ethercat sii_write", the EEPROM_generator
gives me directly the eeprom to download in bin format. The tool you refer to can be used
to take an arbitrary xml file and turn into eeprom format for downloading. It's very useful,
one of the tools to keep in the toolchest.
Last edit: 10 months 2 weeks ago by Hakan.
The following user(s) said Thank You: vibram

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

Time to create page: 0.070 seconds
Powered by Kunena Forum