Beckhoff Twincat

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

BECKHOFF TWINCAT

Beckhoff servo motor is one of the unique servo motors which consist of only one cable
both for power and control lines which is called as one cable technology. The control is
based on PC and by using PLC or Drive or both. The communication interface between
motor and PC is by using EtherCAT communication protocol by using CANopen over
EtherCAT (CoE) protocol.
The TwinCAT3.1 is a software which is used to control and operate the Beckhoff Servo
motor. The EFFICA robot is a 6-axis robot using the Beckhoff servo motors and it is just
PC based control by using TwinCAT3 software.

Firstly, we have to create a PLC project. For that at the top right corner, click Files >>
New >> New PLC project and then a new Solution Explorer

The Solution Explorer will open under which we have to scan the devices that we have
connected by clicking I/O >> Scan any device and it will scan and upload the motor,
drives, EtherCAT terminal, Input and Output Terminals which are connected and a
dialog box will appear to create a Motion tab for that motors and it will ask for NC
configuration or CNC configuration. For Basic setup, we can select the NC configuration.
After adding the devices, then the solution explorer will show that what are the devices
are added in I/O sections and motors are added as axis in motion.
If we want to check the motor is get connected or not with pc, then a check is there that
is when we go to Devices >> Term 1 >> Input, then the window will open there we can
see a value which is the encoder signal which is sort of numbers. when we turn or rotate
the shaft of that motor accordingly the value will also get changed. That is one sign
which is saying that all the connections are correct and encoder signal is communicating
between motor and pc.
Next there is a manual method that is use to run the motor without any programme in it
which is done by clicking the Motion >> Axis 1 ,then a window will open, there is online
panel is there by wick
Display
The actual position of the axis is determined from the feedback of the encoder system
and displayed in the large unlabelled field.
Setpoint Position The target position is specified by the NC during a movement.

Lag Distance The lag error is the difference between the nominal and actual
position.
Actual Velocity The actual velocity of the axis is determined by deriving the actual
position.
Setpoint Velocity The target velocity is calculated by the NC during a movement.

Override The override set by the user (0 -.100%) is displayed here.

Total/Control Total output of the NC axis to the drive in % and position control
Output portion of the output in %.
Error Axle error code. An axis error can be deleted with the reset key.

Set enables
Via the button Set the controller enable, the feed enables and the override of the axis
can be set.
Input fields for position controller setting
If the NC axis is operated in velocity mode (CSV), the position is controlled by the NC. At
this point the two most important parameters, the gain factor Kv and the reference
velocity, can be set. Further setting options can be found in the parameters of the axis.
We have to set the parameter of motor, encoder and driver by clicking the
Motion >> Axis 1 and a window is open under which select Parameters and set
various parameters

And back to online panel in which Enabling option is initially unselected and TwinCAT
software is in config mode change it to run mode and under Enabling option, click set
and select all and also set the value of override into 100%. Thus, the motor is got excited
and shaft will get locked similar to stepper motor. Then reset all values by clicking F8
and start the motor by F5 button and test the jog operation by pressing F1 to F4 buttons
for forward and reverse operation.
If we want to run the motor by varying joint angles as an input, we have to construct an
plc ladder logic. By using various ladders logic which can be manipulated by single
program, we can able to control the motor or even 6-axis robot by either HMI or by fully
automated by ROS.
Construction of PLC Ladder logic:
For declaring variables, we have to create necessary global variables in PLC >>
Project >> GVLs and add new GVL file under GVL tab.
If any set of variables are same for all ladder logic then we can use structures by
creating DUT file in PLC >> Project >> DUTs and add DUT file and select structures
under DUT tab.

Before that make sure that all the reference library files are added in Reference tab. If
not then add the necessary library files in PLC >> Project >> References and click add
items and select appropriate library files and add to it.

Then we can add necessary ladder logic by adding another program file and under
which we can create new Actions and set the Implementation language into Ladder
Logic Control and call all the ladder logics in main program.
Implemented Ladder Logic:
MC_Reset:
The function block is used to reset the NC axis. In many cases this also leads to a reset of
a connected drive device. Depending on the bus system or drive types, in some cases a
separate reset may be required for the drive device.

Final ladder logic:


MC_Power:
The function block is used to switch the software enable of an axis. Enable can be
activated for both directions of travel or only one direction. At "Status" output
operational readiness of the axis is indicated. A velocity override influences the velocity
of all travel commands by a specified percentage.
Depending on the drive type, "Status" also signals operational readiness of the drive.
Digital drives provide feedback on operational readiness, while analog drives are unable
to indicate their operational readiness. In the latter case Status only indicated
operational readiness of the control side.
Final Ladder logic:

MC_Jog:
The function block MC_Jog enables an axis to be moved via manual keys. The key signal
can be linked directly with the "Jog Forward" and "Jog Backwards" inputs. The required
operation mode is specified via the "mode" input. An inching mode for moving the axis
by a specified distance whenever the key is pressed is also available. The velocity and
dynamics of the motion can be specified depending on the operation mode.
Final Ladder logic:

MC_MoveAbsolute:
The function block MC_MoveAbsolute starts the positioning to an absolute target
position and monitors the axis movement over the entire travel path. The "Done" output
is set once the target position has been reached. Otherwise, the output "Command
Aborted" or, in case of an error, the output "Error" is set.
MC_MoveAbsolute is predominantly used for linear axis systems. For
modulo axes the position is not interpreted as a modulo position, but as an absolute
position in continuous absolute coordinate system. Alternatively, the function
block MC_MoveModulo can be used for modulo positioning.
Motion commands can be applied to coupled slave axes, if this option was explicitly
activated in the axis parameters. A motion command such as MC_MoveAbsolute then
automatically leads to decoupling of the axis, after which the command is executed. In
this case the only available BufferMode is "Aborting".
Final Ladder logic:

MC_Stop:
The function block MC_Stop is used to stop an axis with a defined deceleration ramp and
to lock the axis against other motion commands. The function block is therefore suitable
for stops in special situations, in which further axis movements are to be prevented.
At the same time the axis is blocked for other motion commands. The axis can only be
restarted once the Execute signal has been set to FALSE after the axis has stopped. A few
cycles are required to release the axis after a falling edge of Execute. During this phase
the "Busy" output remains TRUE, and the function block has to be called until "Busy"
becomes FALSE. The locking of the axis is cancelled with an MC_Reset.
Alternatively, the axis can be stopped with MC_Halt without locking. MC_Halt is
preferable for normal movement sequences. Motion commands can be applied to
coupled slave axes, if this option was explicitly activated in the axis parameters. A
motion command such as MC_Stop then automatically leads to decoupling of the axis,
after which the command is executed.
Final Ladder logic:
Implementation of Ladder Logic:
After declaring suitable variables and necessary ladder logic, then we have to build the
solution. Once the Build is successful, then we have to change the software into run
mode and by downloading all the programs and logics into the plc by clicking Active
Configuration in Twincat tab and it ask to made into run mode and click ok to change
the TwinCAT from config mode(blue) to run mode(green).

Run Mode can enable us to run the program in PLC and motor will only work in the run
mode. Once the run mode is enabled, then we have to force the Boolean value [TRUE] in
the necessary ladders to activate the motor by giving power supply, resetting the motor
and we can able to perform Jog operation and Point to Point motion operation like Move
Absolute operation.

You might also like