This tutorial explains how to utilize the motion control function of the Siemens S7-1200 PLC in the TIA Portal Software to control a stepper motor with a pulse train output. This is part 1 of the motion control tutorials.
Thanks for posting this very informative tutorial. I have some queries. What is the purpose of the position in the MC_HOME block? I want to home to a hardware limit switch, should I set this to zero? What is the function of MC_POWER block? The stepper driver does not give any feedback regarding status of power etc, so how does this affect the PLC?
Hi. Thank you. Ok so first the MC_Power (Ref page 161) block is to basically enable the stepper function, it releases or locks the Axis. Without this block you cant drive the stepper. You can monitor the Status bit of this block, its either TRUE or FALSE. The MC_HOME (Ref page 168) block you can use in several ways by changing the Mode of the block. The most common ones I use is either Mode 0 or 3. Mode 0 simply zeros your home value irrespective of where the stepper is at the moment for example if you jog the stepper 100mm and Execute the home block while in mode 0 the new value will become 0 and that will be your home position. You can use Mode 3 for active homing and have a home sensor or limit switch. You will need to set this up in the Technology object under configuration - Homing here you select the home sensor and how you want your homing to react. I always take a spare stepper motor with a long timing belt and idler pulley and position it in the middle of the belt then I play around with these functions till the desired effect is achieved. Hope this helps the reference pages can be found in the S7-1200 Motion Control V11 SP2 Manual. support.industry.siemens.com/cs/attachments/109773400/s71200_motion_control_function_manual_en-US_en-US.pdf If you have any further questions please feel free to contact me: tutorials@dcacrobotics.co.za