XBF-PN04B and XBF-PN08B Encoder Configuration and XPM_ENCRD function block
The XBF-PN04B and XBF-PN08B have a built-in encoder input.
-
This input can have various types of encoders connected to it.
-
The XG-PM program is used to configured the type of encoder connected.
-
There is an option to have the Z-pulse of the encoder to reset the encoder value.
-
The XPM_ENCRD function block is used to read the current encoder value.
-
The following examples can be found in OnlineHelp_ECAT_Example.
-
XPM_ECON does not need to be executed to use the built-in encoder.
Element Name | Element Type | Description |
---|---|---|
REQ | Input | Encoder position will be read when REQ is TRUE. Stops reading when REQ is FALSE. |
BASE | Input | Base number of the motion controller. Set 0 to the Base number. |
SLOT | Input | Slot number of the motion controller. Set to the slot number of the XBF-PN04B or XBF-PN08B module. |
ENC | Input | Encoder number. Always set to 0 for XBF-PN04B and XBF-PN08B |
DONE | Output | Status that function block is done. |
STAT | Output | Current status of the function block. Non-zero numbers will be an error or warning. |
ENC_VAL | Output | Current encoder value. |
The Encoder configuration is found in the Common Parameter window of the XG-PM program.
-
This example uses a TRD-SHR2000V5D encoder. See section 2.1 for wiring information.
-
This example is found in the OnlineHelp_XGPM_example in the OnlineHelp_ECAT_example.zip file.
Step | Action |
---|---|
1 |
In XG-PM, double-click on the Common Parameter item in the Workspace window.
|
2 |
Choose Enc1 pulse input type. This example shows 3-Phase A/B (x1) setup. See Encoder Input Pulse Options for explanation of pulse input options.
|
3 |
Set the Enc1 z-phase clear setting. Setting to Enable will reset the encoder value on a z-pulse.
|
4 |
Set the Enc1 max and Enc1 min values.
|
5 |
Set the Enc1 avr. count. This is to set the number of times for averaging the input value of the encoder to reduce encoder input speed deviation when synchronous operation with encoder as main axis.
|
This example uses a TRD-SHR2000V5D encoder with 5VDC output power supply.
CW/CCW 1 Multiplier
-
If Phase B is a low signal and Phase A is a high signal, count is increased.
-
If Phase B is a high signal and Phase A is a low signal, count is decreased.
Addition/Cutback | Phase A Input Pulse High | Phase A Input Pulse Low |
---|---|---|
Phase B input pulse High | - | Cutback count |
Phase B input pulse Low | Addition count | - |
PULSE/DIR 1 Multiplier
If Phase A input pulse is increasing, count is changed as follows:
-
If Phase B input pulse is Off, count is increased.
-
If Phase B input pulse is On, count is decreased.
Addition/Cutback | Increasing Phase A Input Pulse | Decreasing Phase A Input Pulse |
---|---|---|
Phase B input pulse Off | Addition count | - |
Phase B input pulse On | Cutback count | - |
PULSE/DIR 2 Multiplier
If Phase A input pulse is increasing or decreasing, count is modified as follows:
-
If Phase B input pulse is Off, count is increased.
-
If Phase B input pulse is On, count is decreased,
Addition/Cutback | Increasing Phase A Input Pulse | Decreasing Phase A Input Pulse |
---|---|---|
Phase B input pulse Off | Addition count | Addition count |
Phase B input pulse On | Cutback count | Cutback count |
PHASE A/B 1 Multiplier
-
If Phase A input pulse occurs before Phase B input pulse, count is increased when Phase A pulse increases.
-
If Phase B input pulse occurs before Phase A input pulse, count is decreased when Phase A pulse decreases.
PHASE A/B 2 Multiplier
-
If Phase A increases/decreases, count is increased.
-
If Phase A input is faster than Phase B input at the Phase, count is decreased.
PHASE A/B 4 Multiplier
-
If Phase A input pulse and Phase B input pulse are increased/decreased, count is increased.
-
If Phase A input is faster than Phase B at the phase, count is increased.
-
If Phase B input is faster than Phase A at the phase, count is decreased.
XPM_ENCRD Example Results
LP611