I am trying to add an encoder into an AxisGroup so I can use it for a Master for a Gear and I am getting a bit stuck.
Could someone please explain the Module Parameters to me such as "dwRatioTechUnitsDenom" etc.
Also how would i then set up the Encoder as the Master?
Late reply but I'll post anyway to help others in the same situation who comes to this forum.
Why not solve this using a Free Encoder object?
It doesn't matter if the encoder value comes from a high speed counter of an I/O-node or if it comes from a true EtherCAT encoder, they both end up in the Free Encoder anyway.
Setting up a Free Encoder
Right click SoftMotion General Axis Pool, choose Add Device, select Free Encoders and finally SMC_FreeEncoder. Make sure you select the correct version matching your runtime target (check "Display all versions" at the bottom if you want older versions to appear).
Rename your newly free encoder to something fitting, in this example I'll call it EncMaster.
EncMaster wants the encoder input in EncMaster.diEncoderPosition. Either map this directly in the I/O-mapping of your slave, or you can copy it by code at the start of the motion cycle.
Double click the EncMaster to access the settings, use the first tab SoftMotion: Encoder to setup scaling for your encoder just as if it was a motor. If you want to use it for following, then I'd suggest you set it up with the same values you are using for the motor that will be slaving to it.
Please note you need to select the correct bitwidth of the encoder, otherwise rollover/offset won't work.
In the tab I/O-mapping, make sure Bus cycle task is set to your Motion task.
Done! You can now use EncMaster as an axis reference for gearing operations and much more.
Actual position/velocity (in your preferred user units) can be read from EncMaster.fActPosition or EncMaster.fActVelocity just as for any motor.
Beijer Electronics Automation AB
I am trying to do something similar where I am connecting a external encoder to use as positioning. I was trying to use the same setup that you described. When you say you have to map the diEncoderPosition either in the I/O mapping or by code, do you map it to the target position of the slave?
No, that's not what I mean.
I'll try to explain it some more by doing a practical example.
Let's say you have a simple incremental encoder in your machine.
You connect this to a Beckhoff EL5152 module which has a EK1100 bus node.
The encoder value can now be retrieved from that slave.
But in order for it to be used as a FreeEncoder, you need to somehow copy that encoder value from the Beckhoff slave into the FreeEncoder's .diEncoderPosition input.
There are two ways of doing this.
1) Map it directly to the FreeEncoder in the EtherCAT I/O Mapping tab of the EK1100. In my post above, I would map it directly to EncMaster.diEncoderPosition.
2) Map it to a variable of your own choice, then manually copy that variable into EncMaster.diEncoderPosition every motion cycle by code.
The 2nd choice might be more useful since you have a chance to alter the value if needed (f ex. byteswap, or you get the value in 3 bytes and need to combine them yourself etc. etc).
Also, this will only create a proper encoder object.
If you want to slave against it, then look up the PLCOpen MC_GearIn and MC_GearOut instructions.
One last thing:
When selecting the bitwidth of the encoder in the FreeEncoder settings, always choose the same OR LOWER setting, otherwise rollovers won't be handled properly.
F ex: If you have a 29bit encoder source value, you should set bitwidth to 24, otherwise you will get an error on rollover.
Beijer Electronics Automation AB
What is the purpose of free encoder?.Can anyone help me out to solve the below issue? The issue is that the internal encoder overflows even we reset its position(If we continuously run it in the same direction)
Originally created by: ph0010421
I'm currently struggling with this.
I have added an EtherCAT slave (a TR Electronics EtherCAT encoder).
In the CoE Online Window, I can see the Timestamp and Position change.
I've mapped the Position to the FreeEncoder's diActPosition but it is always zero.
Maybe someone has a suggestion?
Copy the rawdata to the EncoderAxis:
Thank you Edwin for the fast response.
I need to use the free encoder as a master axis (MC_Cam In for example).
Will this method work?
yes this will work use the encoder axis like a regular axis.
Great. Thank you. Excellent support.
I know thi is an old thread, but I have another issue on this case.
I've configured whit success one free encoder as a master by a gear function (I also tried awith a cam).
My problem now are the acceleration and deceleration ramps, how can I fix a ramp values to limit the acceleration and deceleration on a free encoder?
hm.. maybe I do not understand the problem.
On an Encoder the ramps are given by the input/speed/ of the encoder signal, right?
Maybe you want to filter These values?
See the chapter here:
https://help.codesys.com/webapp/sm-edt- ... on=188.8.131.52
Log in to post a comment.