Codesys Omron

4 views
Skip to first unread message

Katariina Washuk

unread,
Aug 3, 2024, 10:14:14 AM8/3/24
to ertepufo

Another thing that you might already be thinking it ... urrm the address on the device is 1001 and the log tells me that it has disabled the device as it cant find it... but oddly i cant seem to have a way of setting the address, when i change it it just changes back.. :-(

Hi,
just download an project which has only the ethercat master in the device tree,
then rightclick on the master and scan the slave and add it that way to the project.
Don't care on addresses on ethercat.

I've been through the process of using the scan, add the device to the project, to get the servo drive into the device tree... it has always detected the servo drive.. so you would think that would help.. but doing it that way seems to differ to going and selecting the Omron drive from the list...

now the next part of your message where you say I need to call the Motion function block in the Ethercat Master context sounds like something I should definitely be doing.. if I knew what that actually was...

also in a funny way by me writing up what I've done... it gives me some clarity and helps prevent me from falling down the "got-ya" holes that seem to litter the landscape (and that's not just Codesys.. its anything.. )

if I just try and download and check that the EtherCat is happy, and after downloading the config, logging and starting the plc/(Pi) the runtime starts up... and then I get an exception, and in the main device log, there is the error about the processor load watchdog plcload=96 maxload =95

Ahhhhhhhhhhhhhhh..... Now it is all starting to become clear. it's not working yet.. but I'm working out how little I know..
So now in the past, I've had a setup working.. and when I achieved that I realized that the green circular arrows are the key to the comms working correctly... so I've always been mindful that if you have orange or red arrow.. you're doomed...

now when I did the previous project (which is all in ladder) I was just adding a little servo to do a feed down on one axis of a grinding machine I was CNC'ing and all I need to do is do a count... and then feed a certain amount.. (in one direction ) and then disengage the servo so the operator can still manually adjust the handle if needed...

now I have a Set of Beckhoff EtherCAT IO and that works lovely... and I had a Savch Drive from china.. which also I managed to get working.. but I did have an issue where the drive would stay enabled.. and I couldn't stop the servo trying to hold position .. and after a while, it could error out... but all of this was done just by me poking numbers into the functions in the ladder... incremental move, etc..

so a few days have passed.. and I've gotten brave enough to move my testing over to the actual machine that this drive is needed for.. and I think I've made some progress.. one is that this Pi is a Multicore one.. and I think it handles the distributed clock better.. as I've got a green tick on the Omron R88D_KN08H_ETC (which was not something I could get to happen on the other setup,

so now the bit I need to get my head around is how I actually use this drive.... in the past I was able to get the drive (savch from china) to respond to the MC_POWER function and get the drive to go on line..

and I've got some code from my last setup where I used to take the actual position from the drive.. and add a number on ... and pass that into the move absolute function block, all done using the axis which was defined under the Savch servo drive...

would the priority of the tasks have a bearing on the way they drive responds to the function block when I try and do a MC_Power... (to enable the drive.. ), do you have an example as too how you would set them ???

Also i hadnt noticed but it was being reported back that there was a unresettable error on the omron drive...
Now the error was error 40, when you read the manual is unhelpfully just listed as a fault with the absolute encoder, which as you can see it updating the position value, sort of makes you wonder what it could be related too...
Well turns out you need too log into the drive setup app to get to the bottom of it... and what has happend is the motor and the drive have fallen out of sinc, and you need to use the encoder reset tool, where all the encoder falues get reset and you would loose your sync (but for me this is not a problem), but its not a hardware fault... its a reset required.. but the other thing thats not also apperent is that you need to power the drive on and off for the update too stick.. so once thats done..we are able to take the drive online and jog from the CX drive app... (which uses USB for comms)

Now the support team took me through the process of making a new program with just the ethercat hardware , and i did some quick testing and ive got too the stage where the device tree has all green and one orange arrow...... so it feels like we are getting close....

I wil add a usb ethernet device tomorrow, and then rejig the project so i only have 3 tasks... (which will take me a bit of doing...cut paste cut paste.. etc :-)
But thats all for now.. await more updates soon...

and the last piece of the puzzle is splitting up the network so the modbus over ethernet and the ethercat are not on the same phisicial adapter. buy adding a USB to ethernet adapter... and then setting that up in a way so i can make it work..

now my Savch engineering friends in china were able to get it working with codesys on the pi and it was very easy for them... but at my end it was a lot more complex.. but here is why.. and maybe this is a lession that we call can learn from ..

so the Ethercat hardware is a bit fussy about sharing.. sharing the network with other devices.. and for all the while i'd had my pi set up with a ethercat IO blovck from beckhoff... and a switch.. and a Modbus over tcpip HMI (from kinco) and a cable coming to my laptop..

and it wasnt quite right.. so more chatting with support.. and more figuring out.. and it turned out i needed to only use the USB to ethernet adapter for the ethernet / modbus over tcpip traffic.. and the ethercat needed to go over the onboard adapter..

all of this is configurable.. and you change the adapter allocation in the device settings for the ethercat / ethernet device.. but could i get it to work how i wanted.. no way... all very odd..
i would get the onboard with one address and the usb adapter with the same address, and all in all i'd end up having to boot the pi with a monitor and keyboard and mod the config to allow programming again ...

so anyway ..the config finally figured out.. i have the onboard adapter set to auto configure ip... and the USB to ethernet on a fixed ip.. that sorted it.. so i can have the usb to ethernet connected into the switch and allow the Modbus over tcpcip to work.. and the onboard is just for the ethercat devices.. (which have a little quirk in my case.. i cant have the ethercat loop through my servo... it needs to end at the servo.... now i know.. its ok.. but that took a bit of figuring out.. )

1) use the Pi with the wifi adapter on board so i can always use a hotspot on my laptop as a way of programming..
2) use a pi shield for ethercat.. -electronic-systems.com/ecommerce/15-ethernet-shield , ive not had it arrive yet.. so cant tell you if its good or not.. but it looks like it should be a big help..

Hi,
Usually this is mit a problem, USB or internal Ethernet Interface.
Both work like charm as long you do not mix up ethercat and other TCP/ip ethernet devices.
For Softmotion the important thing is to have a realtime Patch rt_prempt Patch applied to your Linux kernel. ( Sure this is not needed for Softmotion light)
This etherberry is as far as i know only for making a ethercat Slave on your Raspberry Pi
BR
Edwin

Hi,
Usually this is mit a problem, USB or internal Ethernet Interface.
Both work like charm as long you do mit mix up ethercat and other TCP/ip
ethernet devices.
Die Softmotion the important thing is to have a realtime Patch rt_prempt
Patch applied to your Linux kernel.
This etherberry is as far as i know only for making a ethercat Slave of
your Raspberry Pi

The Pi4 might also have better performance using usb adapters since it has a dedicated USB hub chip that connects to the processor using dedicated PCIE lanes rather than the previous Pi's which have had a combo ethernet/usb hub chip. In addition to the USB 3.0 ports.

So we can see that even if the Ethernet Dual v1.1 can function as an Ethercat master your available bandwidth is down quite a bit. It is however a 'cleaner' solution than usb dongles. Perhaps it would be fine for your other ethernet needs. Maybe using a usb-ethernet adapter for programming.

But supposedly an Ethercat Master doesn't need any special hardware but an Ethercat Slave needs an Ethercat ASIC which is why if you want to make a Raspberry Pi and Ethercat slave you need something like the Etherberry Dual.

Doing some light reading it seems that the Etherberry 1.1 and 1.6 both use a chip with an integrated Ethercat Slave ASIC. The LAN9252. The LAN9252 is capable of 100Mbps but that might be limited by your SPI speed.

Reading the eeprom documentation on the LAN9252 will disconnect from the Ethercat network if 32 RX errors occur. You also can't get access to the programming software from Beckhoff without having an Ethercat vendor ID.

Edit: I also ran across another module that you could connect up that is capable of supporting real time communication using profinet, ethernet, and in a future update ethercat. The different between the 001 and 002 parts seems to be that from the manufacturer the 002 part is individually packaged while the 001 is shipped in cases that contain 30.

Also important to note that while this module has been certified if you're selling devices that contain it I believe the device as a whole still needs certification. Having a certified module just makes that cheaper and easier. You also shouldn't be getting this information from me.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages