[Applause] [Music] almost every commercial building an industrial facility relies on the automation of their mechanical and electrical systems this trend is only set to increase especially as larger smarter more complex systems and buildings are constantly under construction so how do we control these systems and what devices are used to achieve that that's what we'll be covering in this video which is sponsored by telecontrols tele controls are one of the leading manufacturers in the automation industry since 1963. their technology is compatible with every plc hmi and controller on the market which reduces plc programming time and saves valuable storage by dealing directly with smaller automation tasks click the link in the video description down below to learn how teles products can make the best of your plc application you can contact them at sales at telecontrols.com or even via linkedin plc stands for programmable logic controller there are many variations but they typically look something like this a programmable logic controller is basically a small computer that can carry out pre-programmed outputs based on inputs and a set of specific rules they are used in commercial and industrial applications to control systems with minimal and sometimes even zero manual intervention the operation can be a simple on off control based on the status of the input or a more sophisticated response based on calculations sequence and logic before plcs control was carried out via banks of relays each relay controlled dedicated inputs and outputs based on physical wiring relays would control other relays to form logic controllers for example with a simple and gate only when two inputs are energized this one and this one does the relay output energize these inputs could be sensors or they could be outputs from other relays to change the operation the physical wiring had to be changed so the physical connections had to be altered if a different response was ever required these old banks of relays were vast in size and very complex this is an example of an elevator relay bank and this is the relay bank from an old electrical substation as you can imagine these are not going to be easy to change and finding faults can be difficult and very time consuming with the invention of solid state electronics and microchips the command logic part of the banks of relays could be replaced with software logic and so plcs quickly took over plcs vary widely on their application but they all monitor their inputs they make a decision based on a stored set of rules and from those they then output commands to automate a process we often find relays used in combination with plcs the relays can directly deal with automation tasks and communicate with the plc this will reduce the amount of programming required on the plc and also free up storage space plcs are widely used for example when you check a bag in at the airport the bag is given a barcode and it enters the conveyor belt a plc scans the barcode and based on a set of rules decides if the bag is diverted to either the domestic or international route the next plc scans the barcode and decides which city the bag needs to be diverted to the next plc decides which gate it also needs to be diverted to and if all of this goes to plan then the bag will arrive at the correct gate first we have the input modules of field sensors these are the physical connections between the outside world and the plc these can be digital inputs such as simple on off switches biometallic temperature strips presence or motion sensors or even a float switch these digital inputs can only provide information on whether something is either on or off and nothing in between for that we would need an analog input for example a simple control knob which ranges from zero to one hundred percent this will go through a voltage transformer to give zero volts at zero percent and ten volts at one hundred percent the plc can scale the input to match the sensitivity required for very accurate output control it could also convert the voltage into current using resistors and ohm's law the amount of current usually measured in milliamps tells the plc whether something is performing between on and off these inputs could be for example a thermocouple or a resistance temperature detector it could be a pressure sensor or perhaps a strain gauge these voltages or currents are converted into a digital equivalent number that can be understood by the cpu we will look at that a little later in this video input modules will perform four main tasks they sense when a signal is received they convert the signal voltage into the correct signal for the cpu they isolate the plc from fluctuations in the input voltage or current signal and they send the corrected signal to the cpu the cpu or central processing unit is the brains of the operation it holds the program or software that decides what outputs are required by applying rules to the input signals the cpu typically consists of a microprocessor which does the work based on the input value and the logic in the program a memory chip to store the program this will also store the output history any faults or alarms etc then we also have other integrated circuits these can be things such as modbus and lan connections which allow us to remotely communicate with reprogram or even monitor the device then there's the output modules or field output devices this is providing the signal to the device we are controlling for example a simple indicator light a solenoid valve a motor starter a variable frequency drive etc there are some other parts such as a battery to keep the plc alive in the event of a power failure there might be a small screen for a user interface to allow some configuration there will need to be a time clock and calendar to operate a device at the correct time and there will also need to be a power supply to provide the low voltage used by the cpu as well as the input and output modules by the way we have covered variable frequency drives motor starters and solenoid valves in detail in our previous videos do check those out links can be found in the video description down below the basic operation of a plc is to perform a pre-programmed output depending on the input signal by following a set of rules the plc completes the following stages in its basic operation first there is the input scan which detects the state of the inputs then the program scan to see what needs to be done then it will execute the program logic to actually implement what the rules state then it must update the outputs to operate output devices based on the program requirements finally the housekeeping for self-diagnostics communications updates and reporting the scan time which is the time it takes to complete all the stages depends on the sensitivity the resilience and system processing time analog inputs tend to take longer to process compared to more simple digital on off inputs for example a water tank might have a very fast scan time of 2 milliseconds and this will prevent overfilling but a room temperature control can be much slower perhaps 100 milliseconds let's see an example of a simple response we have a bi-metallic strip temperature sensor a plc and a boiler the biometallic strip bends as it becomes hot and cold so we can use this to detect if the room is at the desired temperature and from this control the boiler when the room is at the correct temperature the circuit is complete and the plc receives a signal so the boiler is off when the room temperature drops the circuit is no longer complete and the plc detects its change on the input it reacts by sending an output signal to turn the boiler on this is very simple and we could also use a simple relay to achieve this however a plc is better because it has a time function so it can check the time before switching on the boiler for example the building might be empty at nights and on weekends so we don't want the boiler to turn on them the plc is told the room is too cold it checks the time and date to see if it's allowed to turn on and then based on this decides whether to turn the boiler on or leave it off we can then add extra functions and inputs for example a motion sensor on the input the thermostat tells the plc the room is too cold the plc will check the time to ensure it is allowed to turn the boiler on and now it can also check to see if the room is occupied for example there could be a public holiday that isn't listed on the calendar the building is empty so the boiler doesn't need to turn on in this next more sophisticated example we have a thermistor a plc as well as an actuator valve the thermistor can provide a temperature scale rather than a simple on off input like the biometallic strip the actuator valve can open anywhere between zero and one hundred percent to control how much hot water is provided to heat the room for this we would use a pid control loop which stands for proportional integral and derivative control we won't go into too much detail on pids but essentially this will control the valve position to ensure it only opens enough to suit the difference between the room's desired temperature and the room's actual temperature for example if the room temperature dropped very slightly we don't want the heating valve to instantly open 100 because the room will heat too quickly and this will overshoot the desired temperature at this point it will then instantly turn off and the cycle will repeat instead we want the valve to gradually open in proportion to the demand so if there is a small temperature difference the valve slowly opens a small amount if there is a large temperature difference the valve opens further and faster it then decreases as it approaches the desired temperature until the valve finds the perfect position to maintain the desired room temperature let's see a more complex example in many commercial buildings the heating or cooling system will use a control strategy known as an optimizer this learns over a period of time how quickly the building heats up and cools down it then starts the heating or cooling system at the optimal time before the building will be occupied for example if the staff are due to turn up and start work at 9am the heating system knows that it will need to turn on at 7am to ensure that the rooms are all at the correct temperature let's say this system has a plc with the optimizer software installed this controls an actuator valve for the heating system this system also has two pumps which are set up in duty and standby configuration so only one pump runs at a time the plc will decide which pump to turn on based on whichever has the lowest number of previous run hours the plc will monitor a flow sensor to detect if the pump turns on when told to do so if the pump fails to turn on the plc receives an alarm and it will cut the power it then tells the other pump to start however before the heating system and pump start the plc will check with the clock should the heating turn on today and if so at what time will the building be occupied the clock says yes the scheduled occupancy time is 9 am the plc then checks the current temperature of the room and calculates the difference between this and the desired temperature it then checks the outdoor temperature to calculate how long it will take to heat the building because on a very cold day there will be a greater heat loss and so this will take longer from this the plc calculates what time it needs to turn the heating system on so that the building is at the desired temperature ready for 9 am by the way we have covered duty and standby pumps and relays in our previous video do check that out links can be found in the video description down below there are many advantages of plcs but some of the main ones are as follows the control software is stored locally so in the event of a building energy management system failure the plc can carry on working the connections between the plc inputs and outputs are made by the software and not by lots of physical wires plc installations are smaller than hard wired relay banks but they can still use relays when needed plc's are much easier to reprogram fault finding is easier and faster you can load the same program onto multiple plc units to save time you can also expand the inputs and outputs with more cards okay that's it for this video but to continue learning about controls and electrical engineering check out one of the videos on screen now and i'll catch you there for the next lesson don't forget to follow us on facebook twitter instagram linkedin as well as the engineeringmindset.com