|AutomationDirect Live Chat|
The Software: Learn how to implement a full AC Motor On/Off control system with a Productivity Series Controller. Includes circuit breaker, shunt trip, forward and reversing contactors, safety tips, mechanical interlocks and more. Everything you need to implement a safe motor control system.
In theory, programming a PLC to turn on a motor contactor is easy. If a button is pressed, then engage the contactor’s coil. Of course, during the hardware video we saw that in most systems there really IS a lot more to it. Here’s our ladder code whish list: We want a Circuit Breaker Status Indicator We want to be able to Trip the circuit breaker on a button press We want an Overload Indicator On Forward button press, we want to start the motor in forward direction IF - The motor is not coasting - If the motor stop button is not being pressed - If the reverse contactor isn’t engaged - If the circuit breaker is on - If the overload is not tripped - And we’ll want the Forward Indicator lit while motor is running The reverse button has the exact same requirements except it doesn’t start the motor if the forward contactor is engaged. We want the Stop indicator to flash when motor is coasting and to be on when motor is stopped. I’ve already allocated the memory addresses and installed the TAG names to save us some time. You may notice there aren’t any physical button inputs, that’s because we’re using a C-more HMI to control this system. So instead of looking at PLC inputs we’ll be using these memory addresses that are being updated when the user presses the virtual buttons on the C-more screen. The stop button is set to start active because it’s a normally closed pushbutton. Ok, let’s do it. Let’s get the motor running in the forward direction. So on a button press – our virtual C-more HMI button in this example - enable the forward contactor which is output number 2. And once that forward contactor is engaged, the aux contact closes so we can use that to keep the motor running even after the momentary Forward button is released. We call this sealing or latching the contact. I should mention that we will be using a lot of keyboard short cuts to expedite the typing of this code. So if something appears on a rung and you’re not sure how it got there, then checkout help topic P092 – it lists all the keyboard shortcuts. We need a way to stop the motor so we’ll add the stop button. Stop buttons are normally closed, so this is active all the time until you press the STOP button which opens this contact, which releases the contactor, which releases the aux contact and breaks the seal or latching action of this circuit. We only want the motor to be started if the motor is NOT coasting – we’ll create that in a minute – and we want to make sure the reverse contactor is not engaged. We don’t want to run the motor is the overload is tripped. And finally we don’t want the motor to be enabled if there is no power. This serves as a handy reminder to check the power of course, but more importantly, it makes sure the motor can’t be latched or sealed in while the power is off. If we didn’t check the circuit breaker status, then there is nothing to prevent this ladder code from energizing the contactor, which enables the aux contact and latches or seals in the circuit. So when the power is applied, the motor will already be enabled and it will jump to life. Normally you won’t want that to happen, so adding this contact to prevent the circuit from latching while the power is off it is a really important safety feature. And we’ll add the comment for that rung. The reverse motor circuit is exactly the same except it uses the Reverse virtual button, kicks off the reverse contactor, it doesn’t run if the forward contactor is engaged and latches on the reverse aux contact. Let’s update that comment too. We’ll need a way to make the STOP button blink while the motor is coasting. Some PLC’s have a built in contact that toggles every 100 milli-seconds. The Productivity controllers don’t have that, instead they have a Flash Coil which lets you create a contact that toggles at any rate you want. I love that feature. We’ll set this one to 100ms and name it the 100ms coil. To create the 5 second timer for the motor spin down, we’ll watch both contactors aux contacts and if either of these gets released, we’ll start a simple timer. We want to start the timer after the input has been released and we’ll use the timer’s Done Bit to tell us when the motor is coasting. Since we are using this timer as an off delay timer, this bit is set during the off delay – or in our case, during the coasting of the motor which is exactly what we want. Now we can use that to create the flashing STOP indicator. If the reverse and the forward contactor are not active, but the motor is Coasting we’ll set a coil to indicate the motor is still active. If we add the 100ms contact we created here it will make the light blink. This will drive the STOP button indicator which is just the inverted version of this. We also want to turn on the MOTOR_ACTIVE bit if either contactor is active. Again, this will turn off the stop button indicator. Finally, we need for the circuit breaker shunt trip button to trip the breaker which is at output number 1. And let’s add some comments for all of these rungs. It’s important to understand that with the addition of this code, we are now protecting our control system with triple redundancy: To prevent the motor from running in one direction if it is already running in the other direction here in the code, we have fail safes: here in the wiring and mechanically with the interlock block. That creates a super reliable, fault tolerant system. Changing all of this over to a system that uses mechanical buttons instead of the virtual C-more HMI buttons is easy. Let’s assume the Start button comes in on input 5, Reverse on input 6, and Stop on input 7. Just replace this with input 5, this with input 6 and these with input 7. Don’t forget to make sure the Forward and Reverse are momentary normally open push buttons, and Stop button is a momentary normally closed pushbutton. We’re using the C-more HMI in this demo so we’ll leave everything like we have it here. We’ll, let’s try it. Save our work, and transfer to the PLC. If we turn on status monitoring, the green contacts are passi gpower flow and the red ones are not passing power. I prefer the fill option here, so let’s turn that on. So now these green highlights mean these contacts are active and passing power. Much better. When all the contacts between the left and right side are green – then power is flowing to the output coil. So this tells us that the forward button is not being pressed, motor’s not coasting, the normally closed stop button hasn’t broken the circuit, the reverse contactor is not active and the power and overload are good to go. If we press the Overload test button, we see that break the circuit, and if we flip the motors circuit breaker off, we see its aux contact open up. Great, looks like things are working. So when we press the forward button, we now have all the contacts on this rung active and power flows to the output coil and starts the motor spinning. Once the contactor engages, its aux contact will also engage – which is this contact right here. So when we release the momentary Forward button this aux contact will keep the motor running – we call that sealing or latching the circuit. Pressing the stop button will open this contact and disable the contactor - and its aux contact - which kills the power to the motor. It also starts the 5 second timer for the flashing stop button, which was off screen when we did it, so let’s start the motor again, and scroll down to the timer section of the code. This time, when we press the stop button, we should see this off delay timer count down for 5 seconds which will turn this Motor Coasting Bit on. And this aux contact will go inactive which will light up this contact. Then, every time this system 100ms bit is active, this Motor Active bit will turn on. The Stop Button indicator light is just the inverse of this motor active bit so if the motor is NOT active, the stop button will be lit. Of course, if either contactor is active, then the motor will also be inactive which again will light the stop indicator. Let’s try it. When we press the stop button, the timer counts down, the motor coasting but goes active, aux contact releases, and sure enough, the stop button indicator flashes. Perfect. Let’s start the reverse direction – which works exactly the same as the forward circuit – but this time we’ll press the Overload test button and sure enough, it deactivates this contact which disables the contactor and his aux contact which kills power to the motor. Exactly what we expected. The circuit breaker aux contact would work the same way. Finally, let’s make sure the shunt trip kills the branch circuit breaker and shuts down the motor. Start the motor in the forward direction, hit the shunt trip and no surprise here – when we kill power to the motor it stops. More importantly, this also breaks the sealing action of the ladder code so when power is re-applied the motor won’t jump back to life and surprise someone – that would be an accident waiting to happen … Well, this all looks great, there is a potential problem. What happens if the user presses both the forward and reverse buttons at exactly the same time or even just real close to the same time? Well, power will flow through all of these contacts on both the forward and reverse rungs because their respective aux contacts won’t have closed yet – it can take an aux contact 10 to 20 milliseconds to close which means we won’t see that feedback until many scans later. Which means BOTH of these outputs will fire, which will engage both contactors, which will short out the power mains. And that’s a bad thing, Right? Well, not really because it physically can’t happen in this system. Remember, in the hardware video we installed a MECHANICAL interlock to prevent just this scenario. It physically won’t allow two contactors to engage at the same time. Because of that, one of the aux contacts can’t close so that circuit will never seal or latch. Let’s prove it. Let’s engage both contactors on the same Forward button press. Now they are guaranteed to start at exactly the same time. Save that change, write it out to the plc. Sure enough, if we press the Forward button, both circuits light up, but then the reverse circuit turns back off because the mechanical interlock wouldn’t allow the reverse aux contact to close. So now you see why it was so important to add that extra mechanical interlock in the hardware video. And since it just snapped in place and it’s only two dollars and fifty cents – why wouldn’t you add the extra insurance to make sure you have an idiot proof, super reliable system? One side note: you could add another contact here that says don’t reverse the motor if the forward contactor is active, and the opposite here, but since the mechanical interlock has it covered we didn’t add that in this example – but if you don’t have access to a mechanical interlock, this is the next best thing. And as always, if you have any questions or need any help, please don’t hesitate to contact Automation Directs free award winning tech support – they will be happy to help you. And don’t forget the forums – there are lots of folks there that love to share their years of experience. Just don’t post support questions there, tech support doesn’t monitor the forums on a regular basis.