Ethercat compatible Encoder board tentative STM32F4 + LAN9252

More
10 months 2 weeks ago - 10 months 2 weeks ago #340242 by vibram
well done its working !
I need the distributed clocks working if i want it to be compatible with LinuxCNC ?
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 #340247 by Hakan
You can choose between free-run and DC-sync (and SM-sync but noone uses that).
But you are not set up for any of that at the moment.
Let's start with free-run
Add this to eeprom-generator
 
The 000 is the one I have in mind, but have both of them in there.
Save all, burn eeprom, compile and upload firmware in the usual way.
In ethercat-conf.xml leave out the <dcConf ... > statement for the slave. That makes it use free-run mode.
It should now work in free run mode. 
 
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 #340254 by vibram
It's already working in free run mode, I can see my encoder value in twincat such as in your 3rd video :)

ethercat-conf.xml

You mean the linuxcnc file? 
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 #340256 by Hakan
Yes, I thought you wanted to use it in linuxcnc. That's how.
I'll tell you about dc synchronization tomorrow. It's a bit more writing and more code.
 
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 #340268 by vibram
I will also need to build a specific file for linuxcnc to recognize the board right? Is there any documentation about this?

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

More
10 months 2 weeks ago #340274 by Hakan
You can drown in documentation here github.com/linuxcnc-ethercat/linuxcnc-ethercat

But you should treat is any new EtherCAT board, no-one knows you made it.
Code:
lcec_configgen
usually gives a good starting point. And then you add pdos and sdos 
as you progress with the project. The naming/numbering scheme is pretty obvious when you see one.

Some general items you should have is 
Code:
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000" syncToRefClock="True">
or if syncToRefClock isn't recognized
Code:
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="-1000">
That "1000" is how frequent the clocks in the DC slaves are synchronized by the master. I use every 1000 cycle ( 1 sec)
In between the slaves calculate drift and offset themselves and run pretty darn accurate so it isn't necessary to do it more often than that. I Haven't seen a penalty for too seldom or too often so the important thing it's there.

And when you use DC sync for the slave, which you soon can do, you add this line to the slave.
Code:
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
300 is the important, means DC synchronization. 000 means free-run, as does removing the dcConf statetment, and 200 means SM2 synchronization. Those are the common modes, there are also 700, 100 and other modes, but the manual or the ESI file will tell you. 

 
The following user(s) said Thank You: vibram

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

Time to create page: 0.109 seconds
Powered by Kunena Forum