In a previous blog I discussed programming motion control with a S7-1500 with Technology Objects in TIA Portal. This is a very popular method of doing the motion control on the PLC.
We can also offload the motion control to the drive control unit using Siemens’ library motion blocks such as SINA_POS and allow the PLC to control more drives. The Siemens library motion blocks are also available for S7-300 PLCs, which do not support the same Technology Objects as S7-1500 PLCs.
How to Do Motion Control with SINA_POS
- Add the DO Servo Module to the control unit.
- Add Telegram 111.
- For a 1200 or 1500 CPU note the HW identifier in the System Constants when Telegram 111 is selected. For a 300 or 400 CPU note the I address and Q address.
- In the Global Libraries find the EPOS function blocks.
- Pull the desired motion block into your code. In this case, we created fbPositionAxis and we pulled in SINA_POS. We made SINA_POS a Multiple instance block so that it will be static memory in fbPositionAxis.
- I added a few inputs to the fbPositionAxis function block to simplify the Axis control. I chose to include basic jogging, absolute moves, setting a zero home position, and interrupting a move with the fast stop.
- Based on the inputs to fbPositionAxis I set the ModePos input of SINA_POS. You can see how I use the other inputs and the axis status to control the axis.
A few important points:
- The Velocity input of SINA_POS affects the absolute position move, but it does not change the speeds of Jog1 or Jog2. Those parameters must be changed in the STARTER/SCOUT configuration or by using the SINA_PARA or SINA_PARA_S function blocks.
- My example above only uses 3 of the 8 SINA_POS operating modes, so there are functions that this example does not demonstrate.
- SINA_POS uses Telegram 111 whereas SINA_SPEED uses Telegram 1.
Learn more about DMC's Siemens PLC programming services.