The “BOTH_LIMITS” error can be related to that limits switches are not powered with 24V. As standard at PSI, limits are feed from 24V outputs, normally an EL2819 terminal. Basically the outputs needs then to be set to 1 in order to power the switches. Check the schematics in order to find out which output that powers the switches for a certain axis and then use one the following approaches to set it to 1:
Define the output in axis yaml file:
axis:
id: 1 # Axis id
...
feedSwitchesOutput: ec0.s5.binaryOutput02 # Ethercat entry for feed switches
...
By using the command Cfg.WriteEcEntryEcPath(ec<master_id>.s<slave_id>.binaryOutput<id>,<value>):
ecmcConfigOrDie "Cfg.WriteEcEntryEcPath(ec0.s5>.binaryOutput02,1)"
A position lag error (following error) can be generated in the following situations:
Before increase current to the motor, make sure that both motor and drive can handle the higher current. Extra care needs to be taken for vacuum applications.
Check the scaling documentation here. One way to test if the scaling is correct is to set all controller parameters (except Kff) to 0 and then initiate a move. Basically the actual position of the axis should follow the setpoint closely with the same slope. If the slope differs, then the scaling factors are wrong.
If a stepper motor stalls because of too high velocity there’s a few thing that can be done in order to improve the ability to reach higher velocities:
Before increase current to the motor, make sure that both motor and drive can handle the higher current. Extra care needs to be taken for vacuum applications.
The velocity setpoint of drives covers a certain velocity range:
If a velocity outside the velocity range is requested, the velocity setpoint will be saturated and the requested velocity will not be reached resulting in a position lag error.
For EL70xx drives the velocity range can be configured to other values than the default +-2000full-steps/s. See el70x1 speed range for setting other velocity range.
First check the dedicated hardware drive panel for diagnostics and errors/warnings. For EL70x1 drive diagnostics, check el70x1.
Possible reasons:
This procedure is for experts only. You run the risk of destroying expansive devices! Limit switches are not obeyed! YOU HAVE BEEN WARNED!
For this however, the IOC needs to be reconfigured to not link the hardware to an axis!
dbgrep "*s007*"
-Drv01-Cmd
and -Drv01-Spd
-Drv01-Cmd
to 1
and check the amplifier did enable, if you don’t know how to check for an enabled amplifier, you should not use this command!-Drv01-Spd
. Depending on the scaling, the number might be in the range of 1..1000.Sometimes two limit switches are needed, but only one can be linked in the yaml configuration. A use case could be if two axes have overlapping ranges and a switch is used to prevent them from colliding.
In order to configurethis a PLC needs to be added where the two limits switches are combined with a “and” (for normally closed switches) into one bit by the use of the simulation entries (ec
Example (use ec0.s2.ZERO.31 as combined limit switch):
# Master 0
# Drive slave 3 (can be any slave)
# Bit 31
# Switch 1: ec0.s5.binaryInput01
# Switch 2: ec0.s5.binaryInput02
ec0.s3.ZERO:=ec_wrt_bit(ec0.s3.ZERO,ec0.s5.binaryInput01 and ec0.s5.binaryInput02,31);
Then use as forward or backward bit in yaml:
input:
limit:
forward: ec0.s2.ZERO.31 # In PLC "ec0.s5.binaryInput01 and ec0.s5.binaryInput02"
backward: ....