Purpose
In this tutorial, we develop the modeless Position Reset sequence for our example workstation, building on the PLC Pro Sequencing methods established during development of the Carrier Homing sequence. Once the carrier is confirmed at mechanical HOME, the Position Reset sequence commands the servo drive to establish its current position as zero. We demonstrate how an established sequencing structure allows us to develop this additional function quickly and consistently, recycling much of the programming structure already developed for homing the carrier.
In Permissives and Sequence Start, we create the PositionResetSeq program and declare PosResetSeq as an AutoSequence instance. We reuse the resource checks and permissive logic developed for Carrier Homing, modifying them to meet the requirements of our new sequence. We also use the handshake between the two sequences, allowing Carrier Homing to initiate Position Reset once mechanical HOME is established.
In Sequence Steps, we develop the two steps required to establish the servo drive's zero position reference. The first step requests Homing Mode, while the second initiates Homing Method 37. We establish the conditions for normal sequence completion, develop the RESET command logic, and configure a timeout alarm to detect excessive execution time.
In Link Sequence Steps to Outputs, we develop the servo drive commands required by our two sequence steps. We request Homing Mode by writing the appropriate value to RequestedDriveMode, then use the existing DriveOpStart command to initiate Homing Method 37. Both commands use the EtherCAT output mapping established earlier in our tutorials.
In Sequence RESET, we develop the logic that clears the sequence status and step memory and restores the HMI idle message. We then test the completed sequence, confirming that it establishes the servo drive's current position as zero. During testing, we add a diagnostic rung to record the sequence execution time and use the results to establish the final timeout setting.
Permissives and Sequence Start
Following the PLC Pro Sequencing method, we begin with the sequence OkToContinue bit. This permissive establishes whether current conditions will allow the Position Reset sequence to continue operating.
To develop our position reset sequence, we first need a place for its Ladder logic. We decide to create a new POU called "PositionResetSeq", and put it in the task order just under CarrierHomeSeq.
Next, we declare an instance of our AutoSequence structure called PosResetSeq in GVL_General. We covered the development of that structure in considerable detail during the Carrier Homing tutorial, so here we'll simply put it to work once again.
One advantage of the PLC Pro Sequencing method becomes apparent as we begin developing our resource checks. We simply copy the PowerOK and CommOK rungs from the Carrier Homing sequence into our new Position Reset sequence. Both sequences require the same resources, so we only need to update the sequence references and rung comments.
Unlike the Carrier Homing sequence, our Position Reset sequence does not command mechanical movement. We therefore can imagine no safety conditions that must be satisfied for continued operation. We retain the SafetyOK resource check for consistency with our established sequencing structure, but set it unconditionally TRUE. Should we discover a need for additional safety checks later, the rung is already in place and ready for the required logic.
Our final resource check requires the Carrier Rotate drive to remain fault-free. We copy this rung from the Carrier Homing sequence but remove the drive-enabled requirement, since our Position Reset operation does not require the servo drive to be enabled. We retain the DriveFault check, which makes ResourcesOK FALSE if the drive reports a fault, halting the sequence.
With our four resource checks established, we combine them as four normally open contacts in series to establish PosResetSeq.OkToContinue. As is our method, all four conditions must be TRUE for the sequence to continue operating.
With OkToContinue established, we next develop OkToStart. We decide that the governing factors are that the carrier turntable is at mechanical HOME and the servo drive is essentially not rotating. We also include a very short qualification delay, just enough to confirm these conditions over multiple PLC scans.
Before establishing PosResetSeq.NoConflict, we return to the Carrier Homing sequence. When we originally developed HomingSeq.NoConflict, there were no competing sequences to consider. Now that we are developing the Position Reset sequence, we need to prevent these two sequences from operating simultaneously. We therefore add a normally closed PosResetSeq.Active contact to the existing HomingSeq.NoConflict rung. We then copy and paste this rung into the Position Reset sequence. After modifying the text and references, we end up with two mutually exclusive sequences.
We next establish PosResetSeq.Trigger. During development of the Carrier Homing sequence, we created HomeSeqPosResetReq to request a position reset after mechanical HOME is established. We now use that handshake to establish the Position Reset sequence's Trigger. Additional requests can be incorporated as we develop the remaining workstation sequences.
We next establish activation of the Position Reset sequence by copying the activation rung from the Carrier Homing sequence and updating its references. When all four starting conditions are TRUE and PosResetSeq.OkToAdvance is FALSE, we SET PosResetSeq.OkToAdvance and PosResetSeq.Active.
This is our first opportunity to demonstrate an important practice when using sequence handshakes. When the Position Reset sequence activates, it has consumed the request from HomeSeqPosResetReq. We therefore RESET that bit in the activation rung, acknowledging that the request has been accepted. Leaving a consumed handshake TRUE could cause an unintended sequence restart when the starting conditions become satisfied again. We must always clear a handshake once the receiving sequence has accepted it.
Sequence Steps
We expect the Position Reset sequence to require only two steps. Step 01 requests that the servo drive enter Homing Mode. Before developing its Ladder logic, we declare the sequence step word and the Step 01 variable in GVL_SequenceSteps.
As we did above, here we copy the homing sequence's step one and change the references. Our new Step 01 triggers a request for Homing Mode from the servo drive. While waiting for confirmation that the drive has entered Homing Mode, we display the appropriate HMI status message.
We next establish Step 02, which becomes eligible for activation when the servo drive confirms that it is operating in Homing Mode. This step prepares the request to execute Homing Method 37, establishing the current position as zero without moving the carrier. The HMI displays a message indicating that we are waiting for confirmation that the operation is complete.
With Step 02 established, we can now determine when the Position Reset sequence has successfully completed. When the servo drive confirms that homing has been attained without a Homing Error, we establish Normal Done.
The Position Reset sequence uses the same RESET conditions as the Carrier Homing sequence. We copy the existing RESET command rung and update its references. A RESET is issued on Normal Done, Taking Too Long, or loss of permission to continue.
We next copy the sequence elapsed time logic from the Carrier Homing sequence and update the references for Position Reset. We expect this sequence to complete in a couple of seconds, but retain the 55-second timeout for now. The actual timeout setting will be determined during commissioning, based on observed execution times. As before, we declare the alarm in the HMI Workstation alarm section. The HMI alarm itself will remain active for eight seconds, giving the operator an opportunity to recognize the error condition.
Link Sequence Steps to Outputs
We begin linking the Position Reset sequence steps to the required servo drive output commands. Step 01 requests Homing Mode. Following the method established in the Carrier Homing sequence, we use a MOVE instruction to write 6 to RequestedDriveMode when the appropriate conditions are TRUE. The MOVE instruction remains enabled until the drive confirms Homing Mode or the sequence is Reset.
With the servo drive operating in Homing Mode, Step 02 requests execution of the configured Homing Method 37, which establishes the current position as zero without moving the carrier. We energize DriveOpStart while PosResetSeqStep_02 is established and PosResetSeq.OkToContinue is TRUE. This variable is already mapped to Controlword Bit 4 in MapDriveOutputs, so no additional output mapping is required. The command is removed when the sequence is Reset.
Sequence RESET
With the servo drive output commands established, we complete the Position Reset sequence by developing its RESET logic. Following the method established in the Carrier Homing sequence, we clear the Active, OkToAdvance, and NormalDone bits, reset the sequence step register to zero, and restore the HMI status message to indicate that the sequence is IDLE. These actions occur whenever PosResetSeq.Reset is established.
With the Position Reset sequence complete, we can appreciate the value of having an established sequencing method and a working example. Most of the programming consists of copying existing Ladder logic, updating variable references, and modifying the conditions and commands specific to the new sequence. For an experienced PLC Pro, developing a straightforward sequence like this should just take a few minutes. The resulting program retains the same structure, diagnostic capabilities, and operating conventions as our first (homing) sequence.
We next verify the operation of this sequence by repeatedly running the Carrier Homing sequence in Manual Mode, allowing the carrier to rotate to its next mechanical HOME position. We confirm that each homing sequence triggers Position Reset, that the servo drive reports Homing Attained without Homing Error, and that its actual position reads zero in the drive diagnostics.
During these tests, we add a rung immediately above the full RESET rung in the scan order to capture the last recorded Position Reset sequence cycle time in a separate variable, making it available for inspection while monitoring the control program. Once testing is complete, we adjust the Position Reset sequence's Taking Too Long timer to 1.6 seconds.
While repeatedly running the Carrier Homing and Position Reset sequences, we also add a rung to record the homing sequence's cycle time and adjust its Taking Too Long timer to T#8300ms based on observed execution times. We leave both diagnostic rungs in place, as they may prove useful to someone troubleshooting or evaluating the sequences in the future.
And that completes our second modeless sequence. We now have a Carrier Homing sequence that establishes mechanical HOME and a Position Reset sequence that establishes the servo drive's zero position reference. More importantly, we've demonstrated how a PLC Pro uses established programming methods to develop reliable, maintainable control logic without starting from scratch every time. Next, we'll put these capabilities to work as we develop the Carrier Normal Rotation sequence, where things get a little more interesting.