ABB UCF SENIOR DESIGN PROJECT Switchgear System Control Interface

GROUP 14 MEMBERS Christopher Miller – CpE Huy Tran – EE Michael Dean – CpE

PROJECT SPONSER ABB Ltd.

PROJECT CUSTOMER ABB Ltd.

PROJECT MENTOR AND ABB LTD. CONTACT Michael B. Christian Product Manager of Medium Voltage Indoor Products ABB Ltd.

TABLE OF CONTENTS

ABB UCF Senior Design Project ...... i Group 14 Members ...... i Project Sponser ...... i Project Customer ...... i Project Mentor and ABB Ltd. Contact ...... i Executive Summary ...... 1 Project Description ...... 2 Project Motiviation ...... 2 Product Features and Goals ...... 2 Basic Controller ...... 2 Advanced Controller ...... 3 Requirement Specifications ...... 4 Basic Controller ...... 4 Basic Controller Requirement Specifications Description ...... 4 Advanced Controller ...... 5 Both Controllers ...... 6 Known Standards ...... 6 Market-Engineering Trade Off Matrices ...... 7 Advanced Controller ...... 7 Block Diagrams ...... 8 Hardware Block Diagram...... 8 Block Diagram ...... 9 System Design Diagram ...... 10 Orders of Operation ...... 11 Interaction Between Basic Controller the ABB IRS ...... 11 Interaction Between Advanced Controller - Control Board and Motorized Track ...... 11 Estimated Project Budget...... 12 Logic Design ...... 12 Idea Behind Logic Circuit...... 12 Switchgear Emulator ...... 14 Project Hardware Design Detail ...... 38 Design Software ...... 38

ii

NI Ultiboard ...... 39 DesignSpark PCB ...... 39 Eagle ...... 39 KiCad...... 40 Express PCB ...... 41 PCB Design Software Selection and Conclusion ...... 41 PCB Fabricators Comparisons ...... 42 PCB-Pool ...... 42 OSH Park ...... 43 Express PCB ...... 44 4PCB ...... 44 PCB Fabricators Selection and Conclusion ...... 44 PCB Composition ...... 46 PCB Design Considerations...... 46 Soldering ...... 49 Through-hole Soldering ...... 50 Surface Mounting Soldering onto a Printed Circuit Board ...... 50 Ladder Logic ...... 51 Emergency Stop Button ...... 55 Introduction to The Operation and Positions ...... 56 Hardware Schematic ...... 57 Pulse Generator for Blinking LED and Flip Flop in the PCB Board ...... 62 NE555 ...... 64 LM555 ...... 64 TLC555...... 65 LMC555 ...... 65 Voltage Step Down ...... 66 Buck Converter ...... 66 Microcontroller ...... 69 MSP430...... 69 Arduino Microcontroller (Arduino Uno, Atmega328p) ...... 69 Raspberry Pi (Broadcom 2835) ...... 70 Conclusion ...... 70 Programing Arduino Uno To Blink LED ...... 70

iii

Current Sensing Switch ...... 70 Cat 5 Ethernet Cable ...... 73 Project Software Design ...... 75 Idea Behind Software Architecture Design ...... 75 Software Design 1 – Web Server Architecture ...... 76 Overview ...... 76 Local Server ...... 78 Maintenance and Administration ...... 78 Advanced Controller Hardware Platform ...... 78 Web Server Architecture User Interaction Flowchart ...... 79 Logging and Diagnostics ...... 80 Communication Protocol ...... 80 Safety Features ...... 86 Software Design 2 – Standalone Command Application ...... 87 Overview ...... 87 Deployment ...... 89 Advanced Controller Hardware Platform ...... 90 Standalone Command Application User Interaction Flowchart...... 91 Command Application Implementation ...... 91 Logging...... 96 Maintenance and Administration ...... 97 Communication Protocol ...... 97 Networking and Security...... 99 Safety Features ...... 99 Software Design Selection ...... 100 Software Deliverables ...... 100 Overview ...... 100 Simulated Environment ...... 101 Appendix ...... 103 Appendix A – Logic Schematic ...... 103 Appendix B – Full Electrical Schematic ...... 104 Appendix C – Full PCB Design ...... 105 Appendix D – Permissions To Use Protected Content ...... 105

iv

EXECUTIVE SUMMARY

FIGURE 1 ABB MEDIUM VOLTAGE SWITCHGEAR SYSTEM, REPRODUCED AND REPRINTED WITH PERMISSION OF ABB LTD.

The ABB Ltd. Medium Voltage Switchgear system is an electricity power transmission system used for controlling, regulating, and switching on or off the electrical circuit in an electrical power grid. It is an all-inclusive package that contains all the parts necessary for safe and effective power distribution such as switches, fuses, circuit breakers, isolators, relays, current and potential transformers, indicating instruments, lightning arresters, and various system control panels. When a fault occurs in the power system an incredibly large current flow occurs in the electrical transmission equipment causing the equipment to get damaged and power delivery service to get interrupted. Therefore, to protect the various lines and other electrical transmission equipment from potentially catastrophic damage an automatic protection system such as a Switchgear system is necessary. Since the Switchgear systems are connected straight to the power delivery system, it operates in a high voltage and high current condition. Due to the high amount of voltage and current running through the machine the risk of an arc flash occurring and causing massive electrical discharge, flying debris, deafening sounds, and blast pressure is a constant risk during operation. For that reason, the design of a controller that can allow the operator of the system to work from a safe distance is necessary to minimize the time that the operator is within the range of the Switchgear system. By using a long-range controller, the operator

1 can stand a safe distance away from the Switchgear system while maintaining the same level of personal protection equipment and still complete the job at hand.

PROJECT DESCRIPTION

PROJECT MOTIVIATION

In an power system that distributes high voltage and high current loads like the Switchgear systems, arc flashes pose a deadly risk to the operator of the equipment whenever the system is charged. Even with personal protective equipment that is designed to help mitigate most burns, the risk of death due to an arc flash is only lessened slightly. Flying debris, blast pressure, and deafening noise caused by arc flashes within the Switchgear system are dangers that the operator may face while working on the Switchgear system. That is why the need for equipment to help keep the operator safe while working on the Switchgear system exists. Our motivation for this project is to design two controllers for operating the Switchgear system, a Basic Controller and an Advanced Controller. Both controllers aim to reduce the dangers not handled by personal protective equipment by allowing the circuit breaker components, which are tied directly to energizing and discharges the Switchgear system, to be manipulated from a distance. To support as many Switchgear systems as possible both controllers feature a wired connection interface, with the Advanced Controller offering the ability to use a wireless area network as well. By offering a basic and advanced option, customers of ABB will be able to decide which controller is right for their needs and can still be safe while operating the Switchgear system effectively.

PRODUCT FEATURES AND GOALS

The Basic and Advanced Controllers primary purpose is to allow the remote operation of the VC-W MR2 integral racking system (ABB IRS) that the circuit breakers of the Medium Voltage ABB Switchgear system are mounted to. Both controllers offer error codes in the event a problem in the motorized track operation has occurred such as the breaker colliding with a foreign object or being unable to move. While the Advanced Controller offers wireless connectivity, both controllers are able to connect to the system through an ethernet cable using a RJ45 connector.

BASIC CONTROLLER

The Basic Controller features a button array that allows the control of all features of the ABB IRS from a range. Complimenting the button array and used to indicate the status of the ABB IRS will be a separate LED array. The LEDs correspond to a state the ABB IRS can be in will be lit while the machine is in the respective LED’s state. Errors are displayed through the flashing of the status LEDs.

2

The housing for the controller is constructed out of a durable, lightweight material, that is big enough to securely hold the interior components of the controller and is also able to absorb enough energy from an impact to not damage the controller should it be dropped. The connection interface between the Basic Controller and the ABB IRS is a RJ45 connector attached to a standard eight wire ethernet cable. That cable plugs into an adapter that allows it to directly interface with the ABB IRS. The length of the cable connecting the Basic Controller and the ABB IRS is long enough to allow the operation of the ABB IRS from a distance multiple times further than the arc flash boundary set by IEEE. It is attached to the controller housing using a retaining clip and a wire relief to help minimize the chances that the cable gets removed unintentionally. At minimum the ABB IRS Basic Controller provides functionality on par with competing Switchgear systems offered by competitors such as: Siemens, Powell Electronics, and Eaton Corporation. Ideally the cost and ease of use of the ABB IRS Basic Controller is like that of the competing products.

ADVANCED CONTROLLER

The Advanced Controller uses pre-existing hardware in the form of a laptop or tablet style computer provided to us by ABB Ltd. Through the computer the operator is able to access a control interface that connects to the on-site server through which they can control the various Switchgear systems at the site. If the hardware system that the Advanced Controller software is running on supports it, additional feature includes a stylus, since the personal protective equipment worn by the operator can prevent the use of a capacitive touch screen.

The Advanced Controller features two connection methods to the ABB IRS. The main connection method is wireless, using Wi-Fi to connect to a wireless access network and gain access to a server that can connect to each of the Switchgear systems. As a backup to the wireless connection method, the Advanced Controller connects over the same wired interface as the Basic Controller.

The laptop or tablet style computer being provided to us by ABB Ltd. features a battery, housing, and all other features required by the customer as the customer is providing the device.

Since the Advanced Controller features a visual display, an intuitive and easy to use user interface was designed. The graphical user interface is divided into sections, a non-user modifiable section that is always visible no matter what screen the user is on and a variable screen section that displays the information the user requests. The non-user modifiable screen section displays the information that is visible on the Basic Controller as well as the touch screen buttons that control the ABB IRS. The variable screen section displays a variety of information including but not limited to: all Switchgear systems connected to the server and their status, error codes for various Switchgear systems, and allows the user to access the various Switchgear systems deployed at the site.

3

REQUIREMENT SPECIFICATIONS

BASIC CONTROLLER

Requirements Use Length < 9 in. To protect the interior components of the controller. Housing Width < 4 in.

Height < 3 in.

5 press buttons: The press buttons are used to control 1. Rack Out the motorized track unit’s motor and to 2. Rack In manipulate the circuit breaker. Control System 3. Breaker Open Buttons 4. Breaker Closed 5. Emergency Stop

5 LED lights: The LED lights are used to indicate the 1. Intermediate current, operating, or error status of the 2. Disconnected motorized track unit. LED Status 3. Test Indicators 4. Connected 5. Emergency

Connector: RJ45 Used to connect the Basic Controller to the Switchgear System for controlling Connection Cable: 8 pin ethernet the motorized track unit. Interface Length: >50 ft.

TABLE 1 REQUIREMENT SPECIFICATIONS OF THE BASIC CONTROLLER

BASIC CONTROLLER REQUIREMENT SPECIFICATIONS DESCRIPTION

• Control System Buttons: o Rack Out: Used to move the circuit breaker out away from the main connectors. o Rack In: Used to move the circuit breaker towards the main connectors. o Breaker Open: Used to open the circuit breaker from a closed state when the ABB IRS is in the “Test” position.

4

o Breaker Close: Used to close the circuit breaker from an open state when the ABB IRS is in the “Test” position. o Emergency Stop: Used to immediately stop all active operations of the ABB IRS.

• LED Status Indicators: o Intermediate: Intermittent status indicator, flashes during the racking in or racking out procedure. o Disconnected: Status indicator to show that the circuit breaker is completely disconnected from the system and is safe to remove. o Test: Status indicator to show when the circuit breaker is in the test position and the “Breaker Open” and “Breaker Close” buttons are useable. o Connected: Status indicator to show when the circuit breaker is fully seated into the main connecters of the Switchgear system. o Emergency: Status indicator to show when a critical error has occurred within the ABB IRS and immediate attention is needed.

ADVANCED CONTROLLER

Requirements Use 802.11 b/g/n Wi-Fi Used to connect the Advanced Wireless Controller to the Switchgear System for Connection Unobstructed controlling the motorized track unit. Interface Connection Length: >50 feet Connector: RJ45 Used to connect the Advanced Controller to the Switchgear System for Wired Cable: 8 pin ethernet controlling the motorized track unit. Connection Interface Length: >50 ft.

TABLE 2 REQUIREMENT SPECIFICATIONS FOR THE ADVANCED CONTROLLER

• Graphical User Interface: o Color code Switchgear systems display blocks with a color representing the status of the Switchgear system. o Multiple Switchgear systems displayed on the interface simultaneously. o Controlling multiple Switchgear systems simultaneously. o Static interface area that is consistent on all pages that displays any error codes generated by Switchgear systems. o Access and read logs generated. o All information and controls that are available on the Basic Controller have a persistent display area.

5

BOTH CONTROLLERS

• Control Board: o To be stored in the low voltage compartment of the Switchgear system. o Has a connection port that allows the Control Board to be connected to the Switchgear system relay to communicate with the server at the Switchgear site. o Has a connection port that allows the Control Board to be connected to the ABB IRS control board to control and monitor the status of the ABB IRS.

• Current Step-Down Board/Component: o Inline device connected between the Control Board and the ABB IRS control board to lower the amount of current going to the Control Board.

KNOWN STANDARDS

• ANSI/IEEE STD. C37.20.7: Design standards for medium voltage Switchgear systems. • NFPA 70E 2015: Definition of an arc flash and its area of effect when one occurs. • OSHA 29 CFR 1910.269: Defines the protective equipment the workplace should provide to the employees when flames or electric arcs are likely to occur.

6

MARKET-ENGINEERING TRADE OFF MATRICES

Legend ↑ Positive Correlation ↓ Negative Correlation

+ Positive Polarity

- Negative Polarity

Basic Controller

Marketing Requirements Easy Easy Durability Long Cost to to Set Distance Use Up Engineering + + + + - Requirements Size: <2 lbs. - ↑ Power: <6 W - ↓ Buttons: 6 + ↑ ↑ ↓ LEDs: 5 + ↑ ↑ ↑ ↓ Range: 50 ft. + ↑ ↑ Performance + ↑ ↑ Cost: <$100 - ↑ ↑ ↑ ↑ TABLE 3 HOUSE OF QUALITY AND ENGINEERING TRADE OFF MATRIX FOR THE BASIC CONTROLLER

ADVANCED CONTROLLER

Marketing Requirements Easy Easy Durability Long Cost to to Set Distance Use Up Engineering + + + + - Requirements Size: <2 lbs. - ↑ Power: <12 W - ↓ Wired Range: + ↑ ↑ ↑ ↑ 50 ft. Wireless + ↓ ↑ ↑ Range: 50 ft. Touchscreen + ↑ Performance + ↑ ↑ Cost: <$500 - ↑ ↑ ↑ ↑ TABLE 4 HOUSE OF QUALITY AND ENGINEERING TRADE OFF MATRIX FOR THE ADVANCED CONTROLLER

7

BLOCK DIAGRAMS

HARDWARE BLOCK DIAGRAM

FIGURE 2 HARDWARE BLOCK DIAGRAM WITH MEMBER BLOCK TASKING ASSIGNMENT

CURRENT BLOCK STATUS • All done

8

SOFTWARE BLOCK DIAGRAM

FIGURE 3 SOFTWARE BLOCK DIAGRAM WITH MEMBER BLOCK TASKING ASSIGNMENT

CURRENT BLOCK STATUS • All done

9

SYSTEM DESIGN DIAGRAM

FIGURE 4 FULL HIGH-LEVEL SYSTEM DESIGN DIAGRAM

10

ORDERS OF OPERATION

There are two orders of operations in the system design diagram in Figure 4:

1. Interaction between the Basic Controller to the ABB IRS. 2. Interaction between the Advanced Controller to the site server followed by the ABB IRS.

INTERACTION BETWEEN BASIC CONTROLLER THE ABB IRS

Starting from the Basic Controller, the input is going from the RJ45 port in the Basic Controller to the control board. The control board is a printed circuit board that has input and output ports that can transfer information either to other components of the diagram. From the control board, the signal goes through the output port through the current step up into the motorized track unit. The current step up is necessary here because the current used for the control board are significantly smaller than the current used for the motorized track. At the same time, the control board also sending a current signal to the relay which is also put in the low voltage compartment. This relay interacts with the server giving information and accepting information from the server. After that, the motorized track operates, adjusting the circuit breaker, then sends a current signal back to the control board. This current signal goes through a current step-down circuit to lower the current so that it won’t destroy the control board. Then the control board sends a signal back to the Basic Controller, letting the controller know what phase the motorized track is in.

INTERACTION BETWEEN ADVANCED CONTROLLER - CONTROL BOARD AND MOTORIZED TRACK

Starting from the Advanced Controller, the input signal goes through the same cable as used for the Basic Controller into the control board. From the control board, the signal goes through the output port through the current step up into the motorized track unit. At the same time, the control board also sending a current signal to the relay. This relay interacts with the server giving information and accepting information from the ABB site server. After that, the motorized track will operate, adjusting the circuit breaker, then sends a current signal back to the control board. This current signal has to go through a current step-down circuit to lower the current so that it won’t destroy the control board. The Advanced Controller communicates with the server through wireless communication to update the status of the motorized track, error codes, or status.

11

ESTIMATED PROJECT BUDGET

Item Quantity Needed Estimated Cost Total Cost Pushbuttons 5 $1.50 $7.50 LEDs 7 $2.95 (pack of 20) $2.95 7-Segment LCD 2 $2.31 $4.62 Display PCB 1 $41 - $100 $41 - $100 Touchscreen 1 $180 $180 Arduino 1 $22 $22 Microcontroller Controller 2 Unknown Unknown Housing Internal Battery 1 $30 $30 Board Mounted 1 $8.70 $8.70 Current Sensor

Total: $296.77 - $355.77 TABLE 5 ESTIMATED PROJECT BUDGET

LOGIC DESIGN

IDEA BEHIND LOGIC CIRCUIT

The idea behind using digital logic to process the status codes was an easy one to make. The two choices were to either use a microcontroller and do some very simple programming or to build a very specific circuit that is perfect for our uses. We thought that a microcontroller would be overkill for a project like this and we didn’t want to add any unnecessary complexity. We also thought that if all the functions we need could be done with digital logic then it is also much cheaper and easier to reproduce than using a microcontroller.

Investigating the aspect of the price of the components more deeply. An Arduino costs about 25 dollars and would have to be programmed before installation for every single switch gear. On the other hand, we will be making these logic gates out of BJT and MOSEFT transistors. These transistors are made on an almost unfathomable scale. In 2014 alone on average 8 trillion transistors were created every second and a single transistor costs about one billionth of a dollar, this is shown in Figure 5 on the next page.

12

FIGURE 5 NUMBER OF TRANSISTORS MADE PER YEAR VS PRICE PER TRANSISTOR

Knowing this fact, it was easy to make the move to keep the solution as cheap as possible and go with a digital logic circuit. There is a famous law in computing that goes along with this graph, Moore’s law. Moore’s law states that the number of transistors than can fit on a processor die will double every 18-24 months. This law has held up for several decades and as a result we have seen transistors get incredibly small and incredibly cheap. As a result, computing power has grown exponentially since CPU’s are just hundreds of millions of transistors cleverly arranged to compute data and manipulate memory.

Another reason why it was a good idea to go with a digital logic circuit was that based on some of the modifications we are going to have to make it is advantageous that we keep everything as a circuit and not feed information through to a microcontroller. The way the breakers move into place is based on a track that is pushed forward by a DC motor. This motor draws a decent amount of current and when the breaker is almost in position the current ramps up a little since the motor needs more power. DC motors do not last forever, and we need to be able to tell when the motor is giving out or if the motor is drawing way more current than it should be. We can also do this with transistors which will play very easily into the logic circuit. We can use a circuit that will only turn the transistor on when the current is higher than it should be and that can serve as an additional input to the logic circuit. This input is going to be called the ‘Over-Current sensor’. When the input for this center is set to high then the racking system automatically stops and reverts to its old state before it started moving. This is an important feature because if the racking system is moving and there is something blocking its path or mechanical error that is restraining the movement of the screw that racks in the breakers then it would be very dangerous to keep the system operational and try to force the breakers into position. The best idea is to back it up, and send a signal to the operator letting them know that the switch gear encountered a problem while racking in or racking out and that they need to physically go over to it and see if there is anything blocking the path or if there is anything wrong with it. The signal that will be sent to the operator is an LED light indicating that the

13 overcurrent sensor has been tripped and the system is in the process of returning to a safe state.

All the status codes that will be displayed to the operator will be through LED lights that will turn on and off as the system changes to different states. Overall there are 7 LED lights on the controller. Racked out, Test position, Racked in, Emergency Stop, Breaker Closed, Breaker Open, and In Motion. These lights are the basic lights required for the design. Later on, a 7-segment display can be added in order to indicate other things since we have all of the possible inputs and outputs already baked into the control board design. The ‘In Motion’ LED is different from the rest, while the other LED’s stay a solid color when turned on the ‘In Motion’ light will blink as the Switchgear system is moving between states. The reason it blinks is that the light is tied in to the clock signal of the control board whereas the other lights are not.

If in the future, we decide to add a 7-segment display then it would be used most likely to totally replace the existing LED’s and make the design much more compact and simple. It would be easy to take the existing outputs and tie them to different segments lighting up on the display to indicate status. Since our contact at ABB has not told he wants a 7-segment display then we will continue with our design with the LED’s.

Edit- As the project moved along a 7segment display was not used to control any of the status codes. Just LED lights were.

SWITCHGEAR EMULATOR

The idea behind building an emulator for the circuit breaker part of the Switchgear system is that we need a way to easily test our designs without having to drive to the ABB facility all the time to test and do rapid prototyping. We think that this is very important not just for us but possibly for the ABB engineers. If ABB likes the emulator, then they can also use it for themselves to test new products or additions to the Switchgear system. Currently, they have two models that they test on and they are fully configured Switchgear systems. That means if an engineer has an idea or wants to create something he must drag all his equipment over to the Switchgear system which is in another building and test from there. Meanwhile if the engineer has access to this Switchgear system emulator then they can very easily test whatever they are working on right from their work bench.

FIGURE 6 STATE MACHINE OF THE SWITCHGEAR SYSTEM EMULATOR

14

The base state diagram for the emulator above in Figure 6 is simple. The very basic functionality that it must have is to be able to move between the three different positions on the racking system. All other features that can change the state of the racking system and the state of the breakers will be discussed later but they do not change the basic functionality that is required.

00 is the state when the circuit breaker is fully racked out and disengaged. 01 is when the racking system is in the testing position. This is the position where the engineer working on the switch gear would flip the breaker manually and make sure that they work properly. 10 is the state when the circuit breakers are fully racked in and in position. A 0 in this case is when the rack out button is clicked on the controller and a 1 is when the rack in button is pressed on the controller.

We mapped the inputs, the outputs in a table and determined what we wanted the next state of the Switchgear system to be based on the current state and the current input. We were not able to simplify as much as we wanted to because there are a few situations during the operation of the Switchgear system that are not allowed. Even though they are not allowed it is still possible for the operator to try to cause those not allowed situations and the racking system needs to not respond. If the racking system responds to the not allowed situations, then there is not recovery, so the design must be carefully crafted.

DETAILS OF LOGIC CIRCUIT

Current State Inputs Next State Flip Flops A B C D A’ B’ 퐷푎 퐷푏 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 1 1 0 1 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 1 0 1 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 0 x x x x 1 1 1 0 x x x x 1 1 0 1 x x x x 1 1 1 1 x x x x TABLE 6 LOGIC TABLE USED TO DETERMINE STATE MACHINE CONFIGURATION

15

Table 6 above was used to design the state machine and what configuration of gates needed to be linked together to go into each flip-flop. The reason we used D flip-flops is because they are the simplest in terms of how they function, and they are the simplest flip-flop in terms of what goes into them logic gate wise. It leaves open the option of either making them with transistors or using already pre-made Integrated circuit chips with D flip-flops on them. Another reason D-flip-flops are the easiest to work with is that they only have one input, the ‘data’ input. Other flip- flops such as J-k flop flops and S-R flip-flops have two inputs that need considering which can complicate the wiring process and adds complexity to the design.

The current state section is how the switch gear looks before a new input comes in like input C or D. A is the light that will turn on if the circuit breaker rack is all the way into the final position in the racking system. B is the light that will turn on when the rack is in between the racked-out state and the racked-in state, otherwise known as the ‘test’ position. A’ and B’ are the states the racking system will be in after the input goes through. Once the input goes through then those new states become the current state. It is important to include both of those in the table since the D flip-flops are modeled after those next states. When both lights are off then the racking system is in its lowest state and the circuit breaker is all the way in the racked-out position with the shields up between the breakers and the slots. A and B cannot be on at the same time since that would indicate a fourth state that the circuit breaker can in and since there is none, those states have not been considered in the design and it is impossible for the emulator to get into that state. As was mentioned earlier the system must be robust enough to not accept incorrect inputs. Therefore, in the row where both inputs C and D are 1 (this is equivalent to pressing both the rack in and rack out buttons at the same time), the next state, A’ and B’ stay the same as they were in A and B. Opposite of that situation, there is the situation where neither button is pressed, and a clock cycle goes through. This will be very common since most of the time the operator has the controller plugged in to the Switchgear system he will not be pressing any buttons while the clock is constantly going. Therefore, it is important that when both inputs are 0 then the state does not change to a new one, otherwise the operator will have put in no input and the Switchgear system will be moving un- expectantly which is not good for day to day operation. As you can see in figure 25, the rows in the table where both C and D are 0 have a ‘Next State’ that mirrors the current state that the Switchgear system is in. The last four rows are marked with an ‘x’, in logic this means that it doesn’t matter whether the input/output is a 0 or a 1. We were able to recognize the fact that since the racking system can never have both A and B be in the 1 position. Those cases fall under do not care in the next state if they are both 1. This allows us to simplify the circuit easier with a Karnaugh map.

A Karnaugh map is one of the most important tools when creating combinational logic circuits like we are here. It allows you to map the current state along with the current inputs and dictate what the next state will be. These next states are groupable if they are the same, the size of the group is a power of two, and the

16 shape of the group is normal. By normal it means that the group you create is either a square or a rectangle.

AB 00 01 11 10 CD 00 0 0 X 1 01 0 0 X 0 11 0 0 X 1 10 0 1 x 1 TABLE 7 K MAP OF THE FIRST FLIP-FLOP, 푫풂

For example, above in Table 7 is the result of creating the K-map for the input of D flip-flop A. The groups we chose are highlighted in red. As you can see the ‘don’t cares’ can make a big difference in how you simplify the circuit. The 1 in AB =01 and CD = 10 overlaps with the x next to it. Even though it overlaps in an x that has already been group it is allowed and the circuit can be simplified farther.

The result of this K-map is 퐷푎 = [AC’D’ + AC + BCD’]. The way to read this notation is that letters with nothing between them have to be combined in an AND gate and letters/groups of letters that have a + between them have to be combined in an OR gate. The apostrophe next to the letter signifies the compliment of the input, basically the input with a NOT gate before it goes into the AND/OR gate. So, to implement this we need three AND gates that combine into an OR gate and the output of that OR gate will be the input to 퐷푎. This is a total of 4 gates with a maximum of three inputs. If we had not used a K-map to simplify it then we would have had to implement 퐷푎 = [A’BCD’ + AB’CD’ + AB’CD + AB’C’C’]. the result of this is 5 gates and each AND gate going into the OR gate have 4 inputs. This would require many more wires and much more hardware to implement. Simplifying the

17 input to 퐷푏 also used this process and the result was 퐷푏 = [A’B’CD’ + BC’D’ + AC’D + BCD].

FIGURE 7 LOGIC IMPLEMENTATION OF STATE MACHINE

Figure 7 above shows the result of the simplification of the K-map, the output of the top OR gate goes into the input of 퐷푎, and the output of the OR gate on the bottom goes into the input of 퐷푏. The inputs to all of the AND gates were explained above. The order of the gates and the order of the wires doesn’t matter but the grouping of the wires with each gate does matter and that is what produces the desired results. The D flip-flops have two outputs, Q and Q’. These outputs are looped around to the front and used in the gates, there is no need to negate an output of a D flip-flop since Q and Q’ will always be compliments of each-other.

INPUTS

The inputs (C and D) are being controlled with buttons on the controller. The clock signal is going to be coming from a circuit placed on the control board that has a crystal that will keep the clock signal coming at a constant rate. The reason we need a clock signal is because there are a few components on the board that need to be synchronized with the rest of the components and a clock signal is the easiest way to do that. The frequency of the signal will probably be between 10 and 15hz. This clock is not very fast compared to many other electronic devices but it’s all we need. When the user presses the button the longest it will take for the Switchgear system to move will be 100ms if we choose 10Hz and 66ms if 15 Hz is chosen. Likely 15 Hz will be chosen since our contact at ABB has set a standard for us to meet, which is that the time from the user pushing the button to the time the Switchgear system moves should be 60ms. The clock will also be tied into some LED’s so that they flash when certain conditions are met. They will flash at the same frequency as the clock and 10-15Hz isn’t so fast the operator will not be able

18 to tell that it is flashing. Another advantage of having a clock go off at this rate is that we need to constantly be checking to see if the over-current sensor has been tripped. If it has then response needs to be quick since if the track keeps moving forward, then the rack or motor could be damaged because something might be in the way of the track.

There are two other important inputs to the control board that need to be considered. The first one is Emergency-Stop. When this button is pushed then the entire racking system needs to be stopped in place immediately. The easiest way to make sure this happens is to only let the clock go through to the other components on the board if the emergency stop button has not been pressed. The easiest way to do this is to have to clock as an input to an AND gate with the E- Stop button as the other input to the gate so that only when the button has not been pressed will the clock signal be able to go out. When the clock signal is not going out then the E-Stop button has effectively halted the entire system since the flip-flops only propagate the new signal throughout the circuit if the positive edge of a clock signal goes into it. The E-Stop button will also send a signal to the DC motor and immediately stop it from moving anymore. The other important signal is the DC motor signal. When the DC motor is on then no new signals need to be taken into the board. This situation is solved in a very similar way as the E-Stop button. The compliment of the signal coming from the DC motor will be combined together with the clock as inputs to an AND gate, so if the motor is turned on and the rack is moving no new signals can be sent to the system. The only thing that can stop the motor from turning on and moving the rack is the E-Stop button described earlier.

FIGURE 8 CLOCK SIGNAL CONDITIONS

As shown in Figure 8 above the clock signal has some conditions before it is able to propagate to the rest of the system through the output of the AND gate. The two conditions for the OR gate are NOT E-Stop and NOT over-current. The conditions for the AND gate are the clock, the output of the OR gate, NOT E-stop, and NOT DC-Motor. These conditions ensure that the Switchgear system does not continue its process of moving between states while an emergency signal is activated.

Another pair of inputs that are important to the safety of the operator and the entire system are the open break and close breaker inputs. When Switchgear system is in the test position then it is recommended for safety reasons to test that the breakers can still open and close. Without the controller the operator would have to walk up to the front of the Switchgear system and manually flip a lever in order to open the breakers then flip it again in order to close the breakers. This can be

19 dangerous since this puts the operator within close proximity to the Switchgear system. The whole point of this controller is so that the operator can control everything from a safe distance. The controller will have two buttons that control each input. The inputs will only do something if the Switchgear system is in the test position. This test position is an intermediary position between fully racked out and fully racked in. Otherwise pressing the button will do absolutely nothing.

FIGURE 9 CONDITIONS FOR CLOSE BREAKER AND OPEN BREAKER

Figure 9 on the previous page shows the inputs and outputs for the close breaker and open breaker functions of the board. The OR gate at the top of the picture is the output for close breaker. In the emulator the output just turn on a light but when this is on the control board then the output will be tied to the signal that closes the breaker. The output of the AND gate on the bottom is the signal to turn on the open breaker light or on the real control board it will actually open the circuit breaker. The reason the output for the close breaker is on is because the Switchgear system is in the test position and the open breaker button has not been pressed. The circuit breaker is by default closed when it moves into the test position so when this is on the emulator then when the emulator is in the test position then the close LED will turn on and when the open input is turned on then it will switch to ‘open breaker’ LED being turned on.

Edit- none of these circuits were ever implemented. In order to emulate the switchgear for test we used a Raspberry Pi running a Python script that simulates the feedback that the racking system outputs.

OUTPUTS

The outputs of our design are simple. They consist of several LED lights that turn on and off based on different states that the Switchgear system is in. Some LED’s also flash when something has gone wrong or the Switchgear system is in motion. There are 7 outputs from the system, they are racked in, test position, racked out, emergency stop, in motion, breaker closed, and breaker open. These are the basic states that the operator needs to be aware of when operating the Switchgear system. Each of these outputs have three different states. On, OFF, and Flashing.

20

On alerts the operator that the Switchgear system is in that position or moving to that position, off means that the operator does not have to deal with that position, and flashing means that an error has occurred that involves hat position.

FIGURE 10 OUTPUT STATES WITH DESCRIPTIONS

Figure 10 above illustrates all the different states that the output lights can be in. As you can see if the breaker is racking in or racking out and he DC motor is currently on then the lights of the two states that is moving from and to turn on along with the racking or In Motion LED. When there is an error while the rack is moving then the same lights that would be on if the rack is moving normally flash. The flashing makes sure that the operator knows that something has gone wrong with the process and they can quickly resolve the problem. At the moment the only racking error that can occur is the overcurrent which is when the DC motor is drawing too much current which means that there is something blocking the path of the breaker. Since this is the only error when that occurs then all the lights blink at the same frequency as the clock signal on the board. The other important error that is shown is when the operator tries to rack the system in or out while the breaker is closed. When that condition is met then the breaker closed LED and the in-motion LED both blink. This is considered an error because the breaker is only able to move when it is open. All of this is controlled with the output logic section of the Logisim diagram outlined in red.

21

FIGURE 11 OUTPUT LOGIC OF THE EMULATOR

The AND gate in the bottom right of the picture is what controls the condition when there is a racking error, otherwise known as when the overcurrent pin is turned on. It is tied to all of the lower left 4 OR gates and it turn on and off with the clock which is what produces the flashing. The top right of the picture is what controls the lights between the open breaker LED and the closed breaker LED. The next OR gate down is what controls the two conditions for when the racked out AND test LED’s should be on. The two conditions for this are when the old state was test and racked out was pressed while the motor is on and when the old state is racked out and the rack in button is pressed while the motor is on. The next OR gate down controls the logic for when the test and racked out LED’s should be on at the same time. Like the previous condition this should only happen when the DC motor is on which means that the breaker is racking in. The two conditions for this are when the old state is test and the new state is racked in and when the old state is racked in and the new state is test.

The second set of outputs is the signals are sent to the DC motor/racking system in order to actually turn the motor on and start moving the breaker.

22

FIGURE 12 SIGNALS TO THE MOTORIZED TRACK UNIT

The racking system requires a 75ms signal to it in order to either rack the breaker in or out. This supplies that signal to the system. As you can see in figure 33 there are a few different ways to send the rack out or rack in signal to the racking system. All of the AND gates are connected to both the clock signal and the overcurrent pin. There is also a D flip-flop with a mux attached to the input that plays a major part in the system. The basic cases are when the rack in button is pressed then the rack in signal needs to be sent but only if the system is not already in the racked in position, the ‘in pressed’ AND gate takes care of this. There is also the condition when the rack out button has been pressed and the system isn’t already in the racked out position, the ‘out pressed’ AND gate takes care of this condition. The other four conditions are concerned with when the overcurrent signal goes off. The board needs to know if to send the rack in or rack out signal when the overcurrent is set off in order to automatically send it back to its previous safe position. The other conditions go by the naming convention ‘old new’. So in the case of the ‘test out’ AND gate, this is turned on only when the old state was test and the new state needs to be out. This is connected in an OR gate with the ‘rack in’ signal because if the old state is test and the new state is out then the rack in signal needs to be sent because of the overcurrent. In order to test for all of these conditions we mapped out what state the four main D flip-flops where in during each condition. For the ‘out test’ and ‘test out’ states it was easy since the state of the four flip- flops was unique for each of those cases. For the ‘test in’ and ‘in test’ conditions they had the exact same state of flip-flops so there needed to be an extra factor that could determine when to press the rack out button and when to press the rack in button. The solution for this was to use an extra D flip-flop that would keep track of if the rack in button was pressed last clock cycle. If it was then the output would be 1 and the rack out signal needed to be pressed since these conditions are concerned with the last state restoration. On the other hand if the overcurrent signal is turned on and the state of the flip-flop is a zero then the board known that 23 it needs to rack in since the previous command of racking out tripped the overcurrent and that is not a safe position to be in.

This is probably the most important part of the board because without these signals all the board does is light different LED’s on and off depending on what state it thinks it is in. The only thing that changes the state are these signals. This is the part of the emulator that will control a physical motor and will allow us to display the board during the senior design presentation and will potentially allow us to use this board to control a real Switchgear system which is the main goal of this project. During the presentation we will need a mockup of the racking system used to control the Switchgear systems at ABB to correctly demonstrate our product. Or we will need some way to fake the signals from the motor with timing chips of some sort. For example if the rack out signal is pressed then a signal is sent to a microcontroller or some sort of delay IC chip and that will mimic the DC motor and allow the board to fully function for everybody to see.

STATE RESTORATION

The over-current signal is one of the most important signals in the control board. When the over-current signal is turned on then the switchgear will stop moving and reverse back to its previous state. This is not a trivial task since the system must have a second pair of flip-flops that act as memory. The flip-flops can be written to only if the overcurrent sensor is not on and if a valid input has been sent to the board. These flip-flops are also D flip-flops based on the same reasons as the main flip-flops are of the D type. These flip-flops are called 퐷푎2 and 퐷푏2. 퐷푎2 holds the previous state of 퐷푎 and 퐷푏2 does the same for 퐷푏. The output for each respective flip-flop is sent to the input of its counter-part, this holds the last state.

clock 퐷푎 퐷푏 퐷푎2 퐷푏2 1 0 0 0 0 2 0 1 0 0 3 1 0 0 1 4 1 1 1 0 5 x x 1 1 TABLE 8 RELATIONSHIP BETWEEN TWO SETS OF FLIP-FLOPS

As seen above in Table 8 on each clock the second pair of flips is mirrors the state of the primary flip-flops on the clock before. This is crucial to backing up the rack and keeping the state of the Switchgear system intact as far as the control board is concerned. When the over-current signal goes back down to 0 then the operator can physically inspect the switch gear and see what happened to cause the signal to go off and when the operator fixes the problem then the Switchgear system can resume normal operation immediately and either rack in or out or if they are in the test position then they can open and close the breakers. The whole point of this function being included in the control board is that it should take no human input in order to keep the switch gear from damaging itself. Unless the racking system

24 starts making a loud, audible noise then the operator would have no idea that it is stuck, and the motor is destroying itself and the racking system because it is stuck on something.

FIGURE 13 STATE RESTORATION D FLIP-FLOPS

Figure 13 above shows the D-flip-flops that are used to restore the state of the Switchgear system when the overcurrent sensor goes off. Originally the flip-flips were simply tied to the first pair of flip-flops and when the overcurrent sensor went off a signal was sent to an AND gate in front of the first pair of flip-flops and the new signal from the output of these flip-flops is used in the data input of the primary ones. The problem with that is that if the overcurrent stays on when the next clock signal comes in then the emulator keeps reverting back states so with the clock signal we have, if the Switchgear system moved into the racked in position and the overcurrent wire was turned on then the emulator would move to the test position and then to the racked out position within a tenth of a second. This is obviously not the desired functionality so the multiplexor was added to the front of the data input of the flip-flop.

When the overcurrent sensor is turned on then the multiplexors output is set to what the input at the 0 position is. The input for both of the 0 positions for the multiplexor is the output of the flip-flop. This means that when the overcurrent sensor is turned on these restoration flip-flops cannot be changed to another state other than the one they were in before the overcurrent sensor went to a one. But when the overcurrent sensor is a 0 the multiplexor selects the inputs coming in at the 1 position. The combinational AND/OR gates leading into the multiplexors 1 input are the conditions needed in order to push a new state into the restoration flip-flops.

The way the restoration flip-flops work is not obvious since there are three states the Switchgear system can be in but only two D flip-flops. The way they work is that the outputs of the restoration flip-flops are used as a permutation the determines the state to restore to. If both of the outputs are 0 then that means to

25 restore back to the racked out position. If 퐷푎2 = 0 and 퐷푏2 = 1 then restore to the test position, and if 퐷푎2 = 1 and 퐷푏2 = 0 then restore to the racked in position. There is no situation where the two outputs will both be 1 so that situation was not handled. This system was used in order to not use a third flip-flop. The easiest way of doing it is using three flip-flops to hold each state and restore from there but we thought that saving on some hardware would be a good idea. Overall the circuit used for storing the old state of the Switchgear system saves out on a multiplexor, a D flip-flop, and several AND/OR gates. It was worth adding complexity to this design to save those components from being added to the PCB.

This feature is the shining star of the emulator since it is pretty advanced and makes the emulator much closer to working like the real Switchgear system will. ABB’s competitors also have this feature included in their Switchgear system controllers so in order to not fall behind the competition we needed to add it as well. We do not want the reason that ABB falls behind the competition to be us, especially if we just didn’t implement the feature because it was deemed to be to advanced for us to do.

Edit – None of these logic circuits were implemented either, there was no point since we could just program everything with the MSP430 that we chose to include into our design. It is one chip that replaces dozens of chips that would be needed to implement these circuits.

FLOWCHART

FIGURE 14 OPERATION FLOWCHART OF THE EMULATOR BOARD

26

The overall flow of the emulator and the control board is captured in Figure 14. This flow chart is the same thing as the state machine (pictured in Figure 6) except it shows all of the signals that are sent to each board controlling each state. This flow chart does not capture the open breaker and close breaker signals because they are not critical to the actual moving of the Switchgear system in between states. Each block has a certain condition that consists of several control signal conditions and depending on those control signals it transitions to a new state. As you can see there are two or three different diamonds for each state. The only way to go backwards is that the over current sensor is turned to a one or the rack out button is pressed.

COMPARING THE EMULATOR AND THE CONTROL BOARD

There are differences between the emulator and the control board. The main difference is the fact that since the control board is hooked up into the actual Switchgear system then there is a built-in delay between changing states while the DC motor pushes the breakers into position. With the emulator the change is instant since there is no DC motor that takes up time. To compensate for this the emulator has to be wired in such a way that the DC motor signal can be manually flipped on and off in order to simulate the delay that the real control board will see, or delay circuits will have to be implemented into the design of the emulator. The preferred method is the former, since that wouldn’t require us to go out and either make a delay circuit or to buy some Integrated circuit chips to put between the outputs of the flop flops and the LED lights in order to stop the instant propagation of the signals that turn the lights on. Also, if the signal for the motor is something that we can control on and off we can potentially show off exactly what is going on in the circuit while the DC motor is on during the presentation of our device.

The demonstration of our device that is required at the end of Senior Design 2 will be much easier with this emulator. The only way we could show off our controllers is if we take a video of them controlling the test Switchgear systems that ABB has set up at their facility. It is very likely that the people judging our project will want to physically see how our device works and the emulator will serve that purpose. To supplement the emulator we can also show a video of the emulator next to the Switchgear system and show that the emulator and the Switchgear system act exactly the same. This will make a strong case for us that our project was successful and we created what ABB expected us to create. We can also easily show off the functions of the Advanced Controller with an emulator. We can use a raspberry pi and connect to the pi with the Advanced Controller which will in turn manipulate the inputs to the board just like it would work if the Advanced Controller was truly hooked up to the server that can send signals to the Switchgear systems in all of the E-houses.

The emulator will also be used to show off the functionality of the Basic Controller with the buttons and the LED’s on the front. The controller will be able to plug into

27 the emulator and will be able to be used exactly the same way as if it was plugged into the Switchgear system. In the end the final product we will be showing off to ABB is mainly the Basic Controller since they already have a solution set up with a PLC type device that provides all the functionality they need from our control board but it’s already built into the Switchgear system racking system.

The relationship between the emulator and the Basic Controller is featured in the figure in Appendix A. What is highlighted in the blue box is the Basic Controller which has absolutely no logic in it at all. What is highlighted in red is the emulator/control board. The reason the Basic Controller does not have any type of circuity involved is that in order for the Advanced Controller to work properly and the entire system to work properly, the emulator and the control board both need to work even if the Basic Controller is not plugged into them.

An example of this would be if there were some AND gates or inverters in the Basic Controller that the Advanced Controller needed to use in order to send the correct signals then the Basic Controller would also have to be plugged into the Switchgear system at the same time. This is obviously not the ideal situation. We want to be able to use both controllers totally separate from each other based on the current need of the operator. Taking this into consideration the only thing that is in the Basic Controller is a bus of wires that lead to the input and outputs of the system (the LED’s and buttons).

Looking closely at the diagram you can see that the DC motor signal is not in the red box, AKA part of the control board. This is true since the DC motor is totally separate of the board and we will only be getting a signal of whether it is on or not. The notation of putting it outside of the box was used for clarity so nobody thinks that we have a DC motor on our actual control board. Yet we do have an overcurrent sensor on the board.

Our contact at ABB said there are two different ways that we can measure the overcurrent. One is that we use the relay which can be programmed in order to determine if there is too much current going to the motor, and the other is to create our own overcurrent sensor that would be included in the control board and used as an input to our state machine. Our contact said that the latter is preferred since it makes the entire system more standalone.

CHOICE OF TRANSISTORS

For this project the transistor of choice is the NPN 2N2222 transistor. NPN transistors are the simplest to work with since we are most familiar with them from lab and class. This particular transistor has a delay time of 10ns and a rise time of 25ns. The timing of the circuit does not have to be precise at all since there are only seven input signals and at the moment there is nothing that the controller would need to do that would require the inputs to be able to switch during a time as short as 10ns. The maximum current rating of this particular transistor is 300mA.

28

We will not be using anything near that high for the emulator, we are not driving anything that needs a lot of current so we still stay below 500mA for the entire system.

When we create the overcurrent detectors for the DC motor then we will have to use transistors that are rated at a much higher current. For example the TIP3055 transistor is rated for up to 15A and 60V. This type of transistor will be necessary for the overcurrent detection because the current that the motor takes in to function can be up to 12A. Most transistors are made with pretty thin wires for the emitter, base, and collector so they would heat up and probably melt when channeling that much current.

Very likely when the full PCB is created then we will switch to a much smaller transistor package in order to save space on the board. There is a form factor that will be good to use on the actual PCB and that is the SOT (small outline transistor) form factor. The SOT-23 3 package for a transistor is just 3mm x 1.2mm which is very tiny. Integrated circuit chips are much larger which further cements the idea that we will be creating our own logic gates instead of relying on IC chips. When converting over to the SOT-23 3 package then we will have to pick a transistor that has the same characteristic as the 2n2222 transistor. The MMBT2222 transistor has the same characteristics as the 2n2222 transistor but is in a much smaller package. This switch over will be seamless and will have no effect on the final product other than reducing its size and For the overcurrent transistor then we will have to make sure that even though the package is much smaller it can still deal with currents in excess of 12A. Luckily there are transistors this small that can receive a current of up to 15A so the transition to full blown PCB from prototype will be very smooth for the overcurrent switch as well. The transistors will probably all be positioned in the same area and will act as the brain of the board. Since the input to the board will be on a data bus then it is advantageous to have all of the transistors in the same spot. It reduces the amount of wiring required to activate the transistors. It also leads to a cleaner, simpler, and smaller design which are all features of a good product.

According to research on PCB printing the possibility of printing LED’s, transistors, and diodes directly onto the board is going to available in the future. Since this technology is not available yet we will have to use SOT’s and solder them onto the PCB very carefully. Whenever this technology has matured, and those components can be directly on the board then the only component that will have to be soldered are the resistors and the transistors will be able to be much smaller. We could have a single area on the board that groups all of the transistors together that produces the logic needed for the emulator and have some busses that transport current back and forth.

Edit- We did not have to use any transistors in our circuit.

29

COMPARING IC CHIPS WITH RTL CIRCUITS

The decision between using IC chips and creating our own gates with RTL (resistor transistor logic) circuits was not an easy one at first. On one hand it greatly simplifies the job we have creating the control board on Eagle when using IC chips. This is a very good thing since if we overlook even one thing when creating the schematic for the board and once wire goes into a wrong input or a resistor is a wrong value then the entire circuit can become nonfunctional. With the time and money constraints we have in this project it would be nice to have the peace of mind that these IC chips are mass produced and have a very high probability of working exactly as advertised. We could also very easily test all of the gates before we solder them on to the PCB by just putting them on a bread board and using a voltmeter to determine when the output of the gate is positive.

Size is not really an issue for these IC chips either since they can come in many different packages depending on the chip. The package we will use to prototype will be biggest on which is 5.3 mm long and the package that we will use on the finished PCB is the small outline version which is a bit smaller at 3.9mm. This is very small and is barely bigger than the small outline BJT’s which are 3mm long and several of them need to be chained in order to create a gate.

The 74HC21 IC chip is a dual 4-Input AND gate which is only 3.3 mm long. In order to create our own 4-input AND gate then we would need 4 transistors and 5 resistors. The size of the transistors alone would be 13.2 mm long which is over three times longer than the entire equivalent IC chip already, the 13.2mm number is before resistors are added in to the circuit as well and to add on to that the IC chip has two of these together. This makes the IC chip roughly 20 times smaller than if we made the equivalent two AND gates with our own components. Knowing that size is a large factor of our design it would be hard to choose anything we create over an IC chip. So, knowing this the size advantage goes in favor of the IC chip by a large margin.

Along with size the IC chips have the advantage that they come with a very large and detailed data sheet explaining typically operating voltages and currents at different temperatures, as well as expected output currents and voltages. This is also a huge advantage over gates we would make ourselves since we would have to spend a large amount of time and effort mapping out all of those statistics ourselves and those numbers can potentially play a large part in the operation of the circuit. Statistics such as propagation delay is potentially impossible for us to measure based on the tools we have available to us and on the IC data sheet it is right there if we need it. So, the ease of use advantage goes to the IC chips

Another factor to consider is the cost of the components. Standalone transistors and resistors are extremely cheap and can be bought by the thousands for just dollars. The IC chips on the other hand are a little pricier they can go for as much

30 as $1 a piece. Cost is a factor in any design and if we decided to go with the option of creating our own gates then we would save money overall on the design.

Overall the only reason we would choose to create our own gates from transistors over using IC chips is to meet requirements for the Senior Design curriculum. The biggest part of senior design is having a major PCB design. The design of the control board is major but if we use IC chips then the complexity of the PCB design goes way down. In our opinion if the complexity of the circuit can be lowered and the circuit can preform the same as if the PCB design was very complex then going with the simple design is much better. The extra cost of using IC chips is not a concern if it saves a huge amount of space on the control board and the operation of it is more reliable. Those two factors far outweigh the cost which even though it is a large percentage difference between the cost of the IC chips and the RTL circuits the real price is very low (around a dollar).

CREATION OF LOGIC GATES

Even though we will be taking advantage of IC chips in our design it is still important to contrast each circuit with its IC counterpart to see how much easier it is to implement the IC chips.

FIGURE 15 AND GATE IMPLEMENTED WITH BJT TRANSISTORS

An example of the AND gate that we can use in our control board is show above in Figure 15. The LED will only turn on when both switches are in the closed position. Otherwise known as 1 logically. When the bottoms switch is closed then there is a voltage across the LED but it’s not enough to turn it on, only if both are closed is there enough voltage to turn the LED on. When both switches are closed the voltage across the diode is 2.3V which is above the threshold of what is considered a ‘high’ voltage or a 1 logically. These can be chained together, or more inputs can be added to the circuit and it will still behave as expected. A VCC of either 5V or 6V is enough to drive the circuit and it keeps the current through the circuit to a minimum, the less current the circuit takes to work then the better the design. The whole idea behind using these gates are that they are very powerful

31 function wise, yet they are small in size and they don’t require much current to run which makes them very power efficient. When these gates are chained together then the LED will be removed and the wire that connects the LED to the circuit will simply be the input to another circuit just like demonstrated in the sections before this explaining how the logic circuit works.

FIGURE 16 IC AND GATE CHIP

This circuit shown above in Figure 16 is what an IC chip looks like with quad, 2 input AND gates. Using these is as simple as connecting the pins of the inputs to the correct input we want to map to that gate and getting the output from the specified pin. These gates are extremely small and you cannot see them with your own eye if the chip is de-lidded. Chaining these gates together in order to make greater combinational circuits should not be a problem wince with a sufficient enough VCC on pin 14 there is a set clamped output of around 25 mA which is enough to drive the input of another gate chained to this one.

FIGURE 17 OR GATE IMPLEMENTED WITH BJT TRANSISTORS

Figure 17 above shows an OR gate created with BJT’s, if either switch is closed then the circuit will be complete and current will be able to flow through the LED which turns it on. In a real circuit the LED would be replaced and that wire would be the input to another gate or some other important component of the control board.

32

One more important circuit we will need to create in order to make any logic circuit we make is the inverter circuit. There is a limited number of circuits that are possible to make with just AND/OR gates. In other words not all logic is possible with just these two gates. However every piece of logic is possible if you combine those two gates with an inverter. There are two main ways to make an inverter, one is with a BJT and the other is with a CMOS transistor.

FIGURE 18 EXAMPLE OF CMOS CIRCUIT

FIGURE 19 BJT INVERTER

Above in Figure 18 is an example of a CMOS circuit. CMOS is short for complementary MOSFET. It combines a PMOS transistor with a NMOS transistor. If VIN is 0 then VOUT will be 1 and if WIN is 1 then VOUT will be 0. This is the more likely option when deciding between the two different inverters since it does not involve a resistor. Compared to a transistor, resistors are very large and will take up a lot of space on the board. If they do the same exact thing and one solution is smaller then that is the solution that will be chosen.

On the other side of things there is the BJT inverter shown in Figure 19. It has the exact same function of the CMOS circuit, but it uses a BJT instead. As you can see it requires a resistor which is much larger than a transistor in size. The control board will have many components on it so the smaller the components the better. Also since the BJT is current controlled it makes activating it a little bit more involved than the voltage controlled CMOS circuit.

Although both designs are not as good as using the IC chip solution. Many inverters are used in the design of the control board and if all of the inversion can

33 be done through one or two IC chips then that would be ideal, especially considering that like the AND IC chip and the OR IC chip the Inverter IC chip is also very small at 3.9 mm and wouldn’t take up much space on the board at all while at the same time providing the functionality that we need. The Inverter IC chip is displayed in Figure 20 below.

FIGURE 20 6-INPUT INVERTER IC CHIP

The last major component that needs to be explained and compared to its BJT equivalent is the D flip-flop that we will be making use of in our circuit. It is the most important component of the circuit since it is responsible for keeping track of the previous state and the output of each flip-flop is crucial as an input to the other gates that are in the circuit.

FIGURE 21 FLIP FLOP WITH BJT TRANSISTORS

Pictured above in Figure 21 is a D flip-flop that was created with two BJT and two capacitors along with a few resistors to control current. Every time the switch opens and then closes again the LED that was previously on will turn off and the LED that was previously turned off will turn on, this is the basic functionality of a flip. The only problem with this is the fact that additional gates will be required in order to make sure that the switch opens and closes when a new clock signal comes in and the other conditions for the change of state of the flip-flop are met. This adds complexity to the design and more gates which is not optimal. This circuit also adds capacitors which are large and take up space. The reason the two resistors immediately following the LED’s on the circuit do not have the same value is to control which one turns on first. When this circuit first powers up the LED that turns on first is not predictable in real life. However, when one of the resistors is set to a

34 lower value or a higher value then the state the flip-flop is in when it first powers on is predictable. The state captured in Figure 17 is when the device is first powered on. As you can see the LED on the left is on and the LED on the right is turned off. This will happen every time the circuit powers on since the resistor value after the LED on the right-hand side of the circuit has a lower value.

FIGURE 22 FUNCTIONAL VIEW OF IC VERSION OF D FLIP-FLOP

Figure 22 above shows the functional view of an IC chip that has two D flip-flops on it. This particular one comes with a set and reset input as well as the typical data input. Having both of these flip-flops on a small 3.9mm chip greatly benefits the design since creating flip-flop with BJT and resistors is a large task and takes up a lot of space on the board. Since this chip also comes with set and reset inputs we have an even larger reason to pick using this over our own flip-flop since those inputs can be used in the design or as emergency system resets if needed.

The main IC that is going to be used is the 74xx series. These are all TTL (transistor logic) based IC chips. They are very small and very common. The other choice of chips would be the 40xx chips which are CMOS based IC chips. The reason we are not going with these is that they are considerably slower to react to new signals than the 74xx chips. Although our device is not very reliant on speed it is still a good idea for the board to be as snappy as possible. One advantage the 40xx chips have over 74xx though is that they are rated for a much higher input voltage, all the way up to 18V.

Edit- We did not use any of these gates or any of the transistor circuits in our design. These were all replaced by a single MSP430 microcontroller.

PROTOTYPING THE SWITCHGEAR EMULATOR

When prototyping the Switchgear system emulator it is important to have indicators of when the output of a gate is a 1 or a 0. In order to do this LED’s were used to give a clear indication of output. The circuit has to be slightly changed from how they are going to be in the final product. Normally the output is a 1 if there a voltage on the output node, but for quickly prototyping LED indicators are nice. When the real circuit is constructed then the LED’s will have to be taken out and the output will just be a positive voltage on a node. We will use this voltage to drive all of the

35 other components on the board. And act as the input to other gates that will be daisy chained together.

Another important tool in prototyping the emulator is using the larger package IC chips. If we buy the smallest version of all of the IC chips we used then we would have had a very hard time plugging them into the breadboard and testing them sine they are so small. The larger package makes it so that the chips are easier to handle and the pins fit into the sockets on the breadboard.

The emulator also makes use of NOR gates. A NOR gate works exactly like an OR gate but the output is inverted. The reason NOR gates are used in the circuit is because there were two instances of AND gates that had inverted values going into the input. If all of the inputs of an AND gate are inverted then the outputs can be not inverted and the gate can be changed into an OR gate and the output is inverted at the end. Both situations are logically identical. This can be shown using DeMorgan’s law, [A' + B'] = [AB]' and [A'B'] =[A+B]'. This is a powerful law since it can be used to greatly reduce the amount of inverters that have to be used inside of the circuit. Inverters use a transistor and resistor which take up space on the board. Using DeMorgan’s law to reduce the amount of components needed on the board is useful because that also saves money. It also makes it easier to prototype since less components are used and it’s easier to keep track of them on the breadboard.

In the process of creating the emulator many of these have to be strung together in order to create the entire thing. Each piece has to be correct or else the entire emulator will not work. The easiest way to go about this is to create the emulator in stages. First we verified that the logic was correct for the emulator using logic simulation software (Logisim). Then we had to verify the way we were creating the logic gates was correct. To do this we used a breadboard and some 2N2222 transistors to test the actual physical circuit that would be needed when the emulator is eventually fully made. This was done to make sure that if we did not go with the IC chips for our design then we could in fact use RTL circuits to implement our design.

DETAILS ON THE CHOICE OF FLIP-FLOP

There are many different types of flip-flops. But only two of them are suitable for use in our circuit. Those two are the J-K flip-flop and the D flip-flop. The S-R flip- flop is not good to use for our design because it does not include a clock signal and the initial output of the S-R output is undetermined until a signal is sent to it. Neither of these features are good since we need a continuous clock in our design and we also need the initial state of the flip-flops to be the same every time. There is no room for random outputs or inputs in our design.

A D flip-flop is designed to be used synchronously with the rest of the circuit that it is implemented into. The output of the flip-flop only changes to the new state when

36 a new rising or falling edge comes into the clock input. There is also a D-latch. A latch is asynchronous and the output changes as soon as a new input signal comes in. On most designs the clock input is very important to the overall device since if there is no clock then some parts of a system can be out of step with other parts and the entire system fails. When considering our design, a clock signal is necessary. We do not want the output to change as soon as a new input comes in, we have other parts of our system that rely on the output of these flip-flops other than the LED lights. Even though the input will not be changing very fast we still want to make sure that the other components on the board stay in lock step with everything else.

If a D-latch was used, then a clock signal would not be necessary but as stated earlier we do need a clock signal. Not only will the clock signal be used to activate the D flip-flop and send another input in through it, we also have LED’s, some of which need to flash. We determined the simplest way to make an LED flash with our design was to tie the input of the LED to the clock signal in some way so that the LED can flash with it when needed. Since the frequency of the clock will be a little faster than desired we can use a circuit the takes only every other clock cycle and use that to flash the LED but no matter what we need to have the LED flash somehow. With the D flip-flop our design utilizes the clock is two separate ways. The more ways we can find to use the clock the better of a choice it is for our design.

The other flip-flop that is possible would be a J-K flip-flop, this component is very popular and is used in many designs for electronic devices. It includes a clock signal which is good since that means it can be used synchronously with the rest of the circuit and it can ‘remember’ the old state of the circuit just like the D flip-flop can. There is only one reason we did not choose this component to be included in our design and that is the fact the J-K flip-flop as two sperate inputs. As the name implies the flip-flop has a J input and a K input. In order for the design to work we would need a combinational logic circuit to be acting as the input of both of these. Since we have 4 D flip-flops in our design that would mean we would have to double the inputs we have to take into account and it also doubles the wires needed on the board, making the diagram and the circuit even harder to understand.

One feature the J-K flip-flop has over the typical D flip-flop is that there is an input that can reset it back to its default state. This can be very useful in many applications. We got around this by choosing a D flip-flop IC that has both a set input and a reset input. Using this type of IC we get the best of both worlds. We can simplify the input of the flip-flop to one combinational logic circuit and we can set the default state as well as reset the flip-flop back to the default if needed just like the J-K flip-flop.

To backup our decision that the D flip-flop is the best to go with we designed some circuits with both the S-R flip-flop and the J-K flip-flop and our initial thoughts were

37 cemented after that. The S-R flip-flop just didn’t work in or design. This was cause mainly by the fact that it does not have a default state when powered on. The J-k flip-flop was slightly more complex to use than the D flip-flop and we want to avoid complexity as much as possible. Therefore through test we confirmed our design and went to work designing a circuit that uses D flip-flops.

CREATING THE EMULATOR BOARD IN EAGLE

The only way to turn our Logisim prototype into a real board is to model it in Eagle. The schematic is shown in Appendix A. Fortunately, Eagle has a very convenient way to use IC chips and we were able to model the schematic almost exactly the same way as the Logisim prototype. When the automatic generation button is pressed then Eagle automatically takes all the gates and groups them into IC chips with each other and wires them the way you already specified. All of the IC chips that are on the board are small outline packages with leads. The result of the schematic is shown in Appendix A. Since the Basic Controller and the board are going to be two separate things there is a 10 pin connector on the board that will be used to connect the Basic Controller with the board in order to send signals between each other. There will be a battery in the low end controller that will be used in order to close the circuit so that a signal is sent from the controller to the 10 pin connector which will drive the gates on the board. The board will be connected to a VCC source that will control all the gates on the board. The battery is necessary because it is not a good idea to send power through a wire at the distance that we need it to be sent. The resistance of the wire will take in to play at that point and there will be a voltage drop that could affect the performance of the device. It is also probably not a good idea to ramp up the voltage on the board just so that it can make the journey from the board over 50 feet of wire. It also sounds like a bad idea to have a live wire like that from the control board to the Basic Controller.

PROJECT HARDWARE DESIGN DETAIL

PRINTED CIRCUIT BOARD DESIGN SOFTWARE

There are two stages involved in designing a printed circuit board via software. The first is creating a schematic to decide what components will be used and how everything will be connected. Second stage is to use that schematic along with a PCB layout editor to place every component and wire in a practical manner. Choosing an appropriate software environment is important to ensure the process goes as quickly and efficiently as possible. There are three key requirements that the software being considered must meet. First requirement is a low price; preferably free. Second the program must be lightweight and be able to perform well on a weaker laptop. Third the program must be compatible with Windows 10 64-bit. The PCB software that meets all the above criteria will be the one that is chosen. If none of the considered programs satisfy all of the requirements the one that meets the most will be picked. If there is a tie, a more in-depth comparison will

38 be made. Ease of use, features, a nice UI, and the extent of documentation/tutorials available are things to consider for a tiebreaker.

NI ULTIBOARD

Ideally, the software this project for creating schematics would be Multisim from . Multisim is the program used in the UCF Electronics Laboratories, so it is the one students are the most familiar with. However, Multisim as well as its PCB Design counterpart software, NI Ultiboard, are only offered for free via a feature-restricted trial version. This version does not offer the ability to export final Gerber files, a much-needed feature. The two programs like to use proprietary formats which can create compatibility problems. Despite being already accustomed to the schematic software, it is unlikely this PCB software will be used for this project. Worst case scenario the computers in the UCF labs can be used since these programs are installed with a usable license.

DESIGNSPARK PCB

The second PCB program to be examined is DesignSpark PCB. This software is produced by RS Components in conjunction with Allied Electronics. This software is completely free. There are no restrictions to the PCB dimensions other than a 1m x 1m limit, which is more than enough. There are also no hard limits on the number of layers, nodes, pads, or connections that are sometimes found on the free trial versions of paid-for software. This software also contains the ability to create schematics. This is useful in making the transition from schematic to PCB layout as seamless as possible.

DesignSpark features object libraries that users can pull from. For example, if a project is using a common microcontroller, it can be found in the library and placed into the layout easily. This saves time from having to manually create an object. The program can generate a bill of materials based on the components that are used. This allows users to cut costs and buy the components separately. The components can be soldered manually instead of paying the PCB manufacturer for the service. Plenty of import and export options are available making it likely it will be compatible with programs not necessarily in the same suite. One down side is that Design Spark PCB requires the user to be logged in. If the user does not go online within 30 days, the software will cease to function if after an additional 30 days the user has not gone online. This is not a deal-breaker because logging within 60 days is reasonable, however the existence of this restriction is strange since this is a completely free software without a premium or paid for edition. DesignSpark PCB is a possible choice since it meets three listed key requirements.

EAGLE

The third PCB program to be examined is the Easily Applicable Graphical Layout Editor, or Eagle. This program is developed by Autodesk, which was previously

39

Cadsoft Computer. This software contains both a schematic editor and a PCB layout editor. The schematic editor boasts many features. Users may generate modular design blocks for custom components. These blocks can then be saved and can be dragged-and-dropped into current and future projects. The editor allows users to create multisheet schematics. Using multiple sheets allows better organization and readability, since the design can be broken into different partitions. Electronic rule checking is another feature. This can help catch mistakes before moving into the PCB layout stage. The Eagle schematic editor is synced with the PCB layout so changes to the schematic will be applied to the PCB layout automatically.

Eagle’s PCB layout editor tries to streamline the design process. When laying down wire traces Eagle will try to automatically go from point A to B by using the least amount of bends and avoiding obstacles in its way. Designs can be optimized by using loop removal tools and cornering tools. These can be setup to work automatically while the wire traces are being laid out. Eagle includes automatic BGA fan-out that can be customized. There program also has design rule checking, which can be customized to the users chosen constraints, that can suggest and make changes to help finalize the PCB layout. Autodesk has a growing library of components that are ready to be used. The library components are well labeled and display many important statistics. These libraries are linked directly to manufacturers so buying parts can be easy. Finally, Eagle can generate 3D models of PCBs, helping users to visualize the dimensions for fitting enclosures.

KICAD

KiCad is a free open source software suite. The schematic editor is called Eeschema, while the PCB layout editor is called PcbNew. The schematic editor of KiCad shares many of them same capabilities as its competitors. The editor has no limits to size or number of components. Larger designs can be broken up into subsheets, much like Eagle. Eeschema can export many different file types, among them are PDF, SVG, HPGL, and Postscript. Another feature that Eeschema shares with Eagle is the Electrical Rules check. In Eeschema it specifically checks the schematic for ouput pin conflicts, missing drivers and unconnected pins amongst other things. Netlists can be exported in several formats including: Pspice, Cadstar, PcbNew and XML. A bill of materials can be generated much like DesignSpark. Eeschema also includes community maintained libraries.

PcbNew, the PCB layout editor, lists less features than its competitors. PcbNew can handle 32 layers of copper, 14 technical layers, and 4 auxiliary layers. The program has what KiCad calls a “push and shove” router. This is an intuitive way to draw tracks since it pushes already laid tracks away or reroutes the current track around obstacles. The behavior of the “push and shove” can be customized to the

40 user’s specified design constraints. Trace lengths can be automatically adjusted using a dedicated too. This is useful when lengths of traces need to match.

EXPRESS PCB

The company ExpressPCB provides both a schematic and PCB layout editor in the form of Express PCB Plus and ExpressSCH classic. The plus version of the schematic editor is not yet available. As such real-time linking of schematics and layouts is not available. ExpressSCH is a rather bare-bones product compared to its competitors. The site does not list any features but highlights a simple four step process comprised of selecting the components, positioning the components, adding the wires, and editing the schematic. The PCB editor is likewise, bare- bones, its features are all found in other programs while missing ones found in others. The one exclusive feature is a streamlined PCB ordering process. ExpressPCB is also a printed circuit board manufacturer and boards can be ordered within the program itself.

PCB DESIGN SOFTWARE SELECTION AND CONCLUSION

This began as a sincere investigation between a handful of schematic and PCB layout editors. Finding software suites that met the three specified requirements of being free, lightweight, and windows compatible took little effort. Five different software suites are examined for this comparison but the amount of software available for PCB design and layout is numerous, overwhelming even. Ultimately, the free software is rather competitive and seem to aim for feature parity with its competitors.

Looking deeper into the programs’ documentation shows that DesignSpark, Eagle, and KiCad have very few exclusive features amongst each other. For example, despite only having a modest selection of features in its website, KiCad’s PCB Layout software also contains an object library and can generate a bill of materials. Comparing features will not decide which software will be used for the project. The size limits for KiCad and DesignSpark are very generous; what is offered is more than enough for the scope of this project. The user interface can be a good way to decide which is the most suitable software suite. After downloading each set of programs, it is apparent that schematic editing software have an almost universal interface. There are miniscule differences, no schematic editor is significantly more intuitive than the other. Comparing the user interfaces of the PCB side of the software shows greater differences. However, this will be the first time anyone on this project’s team will be using PCB design software. It is best to just pick one and learn the nuances, since it is unlikely that any one program is harder or easier to learn.

Ultimately, it was decided that Autodesk’s Eagle is the program that the team used to create the schematics and PCB layouts for this project. More than any of the other programs, Eagle has very detailed and extensive documentation. The

41

Autodesk website has forums dedicated to Eagle which can be a useful source of tips and tricks if the official documentation proves to be too dense. Looking for tutorials on YouTube shows that Eagle is a popular PCB design program. There are many videos available ranging from videos suitable for beginners and ones that aim to solve specific problems. Eagle also appears to be the software UCF professors recommend and are most familiar with.

PCB FABRICATORS COMPARISONS

The University of Central Florida’s ECE department website has a page dedicated to listing resources for Senior Design. Among the links listed on this page are a list of printed circuit board fabricators. There are four recommended, PCB-Pool, OSH Park, Express PCB, and 4PCB. These four manufacturers will be compared to see which offers the best service for the price. The sizes available, the shipping times available, and prices will be the key factors that will decide which fabricator will be used for this project. If there are no clear winner when examining those aspects, a deeper inspection will be needed, such as looking to see if one store offers services that could be useful for this project, or checking the opinions of people have used the fabricators before. PCB fabricators not included in the ECE resources site will also be examined they will not be appear in this comparison unless it ultimately chosen.

PCB-POOL

The first manufacturer to be looked at will be PCB-Pool. The company Beta Layout has been around since 1984, and has been offering PCB fabrication services since 1994. This company offers many services. The one that will be looked at will be PCB Prototype. This manufacturer offers one-layer boards up to six layer boards. Using the website’s PCB configuration tool various service options such as delivery time, flexible or rigid boards, the addition of a soldermask, the option of a silkscreen and more are all variable that control the price of the board. For this project, a rigid board will be selected, a soldermask and a silkscreen will be used, and the dimensions will be less than 9 x 3 inches. With these specifications, the total cost to produce a single printed circuit board from PCB-Pool comes to $104. After filling out all the options the website generates a price comparison chart that details how the price changes by delivery time and quantity of boards. If the project is well planned, the eight-business day lead time option is the best choice since it reduces the price significantly. The price of a single business day lead time more than triples the price of an eight-day lead. Strangely, the PCB-Pool site only lists lead times and offers not information on delivery time. This leaves the actual arrival of the boards to be questionable. By increasing the quantity of boards, the price of a single unit decreases. When three boards are purchased the price of a unit become $70 with the total adding up to $210. It is a good idea to purchase more than one circuit board in case it breaks, or if the team is unlucky and a problem occurs during the manufacturing process produces an error.

42

Aside from price, there are other things to consider. PCB-Pool offers a free “FITS- or-NOT-3D-Model” with every prototype order. The utility of this model lies in its namesake; this lets customers see if the PCB design will fit the enclosure or not. If there seems to be a problem the PCB order can be canceled. The 3D model is no longer free if PCB is not going to ordered but it’s much cheaper than having to buy a useless board. The 3D model while nice is not important for this project. The size of the Basic Controller should be around 9 x 3 x 4 inches. This is plenty of space for the board. Another free bonus for PCB prototype orders is a desoldering pump which should help keep things nice and clean during the soldering process. PCB-Pool uses Electroless Nickel Gold for purpose of being able to create ultra- flat pads. PCB-Pool supports the use of several file formats, including all the formats used by the programs listed in PCB Design Software Comparison section except Express PCB. If this fabricator is selected it is likely the total price spent will be a bit less than $210 and it comes with some free extras. This site is a good option to produce the PCBs.

OSH PARK

The second fabricator is OSH Park. All orders come with 3 copies of the printed circuit board. OSH Park uses a purple soldermask, instead of the usual green, and uses an Electroless Nickel Immersion Gold finish. This company offers two-layer boards as well as four-layer boards. The two-layer boards are priced at $5 per square inch, while the four-layer boards are price at $10 per square inch. This is in line with PCB-Pool; the price of a 9 x 3 board slightly less than double when going from two-layers to four. It is likely a two-layer board will be used on this project. More layers will be considered if it becomes too difficult to connect everything with only two layers. OSH Park has less options to adjust than PCB- Pool. The size of the board and the delivery time are the only variables other than number of layers that control the price. The lead time can be either twelve calendar days or five business days. Choosing the shorter lead time will double the price of the board. Delivery time can be as short as 1-2 business days or 1-5 business days depending on the option selected. The slowest shipping option is free, while the fastest shipping option is $20. Various file formats are supported and will work with Eagle. The OSH Park website has design tool help for several programs including Eagle. There are several tips and things to look out for to make sure the file you submit will be accepted. Besides a few minor details it is said that Eagle files can be used directly so there should be little trouble when submitting files to the site.

The maximum size of the project’s printed circuit board will be no larger than 9 x 3 inches. This means by using OSH Park the cost (which comes with 3 copies) will be no more than $135 if the slowest lead and delivery times are chosen. This is a good deal cheaper than PCB-Pool. OSH Park is a better choice than PCB-Pool since it is cheaper and arrival times are much clearer.

43

EXPRESS PCB

The third PCB manufacturer option is Express PCB. Several options are available which are very poorly explained on the website. The naming convention is confusing and it’s difficult to quickly gauge the differences in the options. This site will only accept designs submitted using their proprietary PCB design software title ExpressPCB plus. The cheapest option called the MiniBoard Standard, is $41 for 3 sets of two-layer boards with fixed dimensions of 3.8 x 2.5 inches. This option does not include a silkscreen or soldermask. $41 is just below what OSH Park would offer for those dimensions. However, OSH Park includes a soldermask and silkscreen. The miniboard service also has a lead time of only one business day. The “Production” service is an option that produce a product similar to what PCB- Pool and OSH park offer, which includes two layers, a soldermask, silkscreen, and custom dimensions. The 10-day lead time price formula for this service is:

$245 + ($0.55 ∗ 푁푢푚푏푒푟 표푓 퐵표푎푟푑푠 ∗ 퐴푟푒푎[𝑖푛2]) + (1.00 ∗ 푁푢푚푏푒푟 표푓 푏표푎푟푑푠)

The cost of shipping most also be added into the formula. The initial $245 makes this option much more expensive than OSH Park. It is very unlikely that this will be the selected printed circuit board manufacturer for this project. The site accepts only one format and the price is significantly higher for a similar level of service offered by the competition.

4PCB

Finally, the last PCB fabricator to be examined is 4PCB. This site offers pricing for custom designs and flat rates for boards that fall within specific parameters. Prices for fully customizable boards are not available unless design files are uploaded. However, the flat rate service for 2-layer boards is practical for our project. This service costs $33 per board, with a minimum order of three boards. It comes with a soldermask as well as a silkscreen. The only limit is a maximum board size of 60 square inches, which easily falls within our predicted PCB dimensions. This service has a five-day lead; however, shipping options are not listed. The site accepts various file formats including Eagle.

PCB FABRICATORS SELECTION AND CONCLUSION

Of the four PCB fabricators looked at and compared, three are possible choices. Express PCB will not be considered since they stricter design rules, higher prices, and forces customers to use ExpressPCB Plus software, which was found to be lacking in the software comparison section. Of the three that remain, PCB-Pool is the most flexible; there are many choices to make that can reduce the price of the boards. 4PCB appears to be the cheapest option with a total cost of $99 (plus shipping) if this service is used. OSH Park strikes a nice balance between PCB- Pool and 4PCB. OSH park has workable design constraints and offers competitive

44 pricing. It is the PCB fabricator that is clearest about lead time and delivery time. It is likely that OSH Park will be the chosen fabricator for this project.

Edit- We decided to use 4PCB, they had a good $33 dollar each deal for a two layer board including a solder mask and a silkscreen on both sides. After looking up information on them online it was determined that they were reliable and there was a very small chance of getting a defective board from them.

45

PCB COMPOSITION

The printed circuit board is made of multiple layers comprised of a silkscreen, soldermask, copper, and substrate (FR4). The substrate is at the bottom layer. It serves as the board’s base and provides rigidity. This substrate is commonly made of fiberglass with an epoxy resin with the designation of “FR4”. The designation of FR4 means that it is flame resistant as well as having self-extinguishing flammability characteristics. Other key properties that make FR4 substrates suitable for PCBS. This fiberglass has relatively high strength to weight ratios. It can properly insulate electricity in both dry conditions and humid conditions. After the substrate layer is the copper foil. If the PCB uses multiple layers for wire traces, copper is applied to both sides of the substrate. Although there are materials that have higher electrical and thermal conductivity, copper is most commonly used because it relatively cheap and has properties that are good enough. The printed circuit board can feature as little as one copper layer to more than 16 layers. However, going beyond 2-layers can raise the price of fabricating the board by a significant amount. It is not a flat increase with each additional layer, it is best to design the circuit board with using as few copper layers as possible to reduce the cost.

The next layer is the soldermask. Depending on the PCB fabricator that being used, this layer can be optional. Forgoing this layer can reduced the price of the PCB if it is decided it is not needed for the project. This layer is what gives the circuit board it’s green color (sometimes red, or purple). Without out this layer the yellowish color of the FR4 laminate will be revealed. The soldermask goes on top of the copper foil in order to insulate the copper traces. This prevents shorts since without the soldermask the traces could accidentally come into contact with metal, solder, or conductive bits. The main purpose of the soldermask is to prevent solder bridges from forming. Solder bridges are unintended electrical connections when a blob of solder connects two or more components that are seated closely together.

The final layer is the silkscreen layer. This layer is sometimes known as a component layer or component overlay. This layer allows designers to place outlines of components onto the board. Labels can also be placed. Important labels can be the function of each pin of an integrated circuit or microcontroller chip. Company logos, manufacturer marks, warning symbols, and parts numbers are among the things that can be useful to indicate on the silkscreen layer of the printed circuit board.

PCB DESIGN CONSIDERATIONS

This section will detail basic design approaches that can be used to create reliable and sturdy PCB. Of course, every PCB is different and designed specifically for whatever task it was made to handle, there are recommended techniques and approaches that can be used for the circuit board design process. The circuit is an

46 actual physical object; there are things to consider that may not be readily apparent in the schematic design stage. In addition to increase reliability and lifetime these techniques can help shorten the troubleshooting process when the printed circuit board finally arrives and is ready to be used.

The copper traces used in PCBs have resistance and it is a good idea to keep this in mind. Because of this resistance, voltage drop, power dissipation, and temperature rise are factors that affect the design. The formula to describe the resistance of the copper is:

(푟푒푠𝑖푠푡𝑖푣𝑖푡푦 ∗ 푙푒푛푔푡ℎ) 푅 = (푡ℎ𝑖푐푘푛푒푠푠 ∗ 푤𝑖푑푡ℎ)

In the formula, resistivity comes from the nature of the material being used. This is not a variable that can be easily be changed, so the dimensions of the trace are what can be adjusted. Thickness is usually decided by what the manufacturer can offer. Length is based on the layout of the PCB and placement of components. Width is the only variable that can be controlled without completely redesigning the board to reduce resistivity.

For the design of this Printed Circuit Board it is important to consider the width of the wire traces. The Basic Controller will take in current that is going to the DC motor of the circuit breaker racking system. The website of the PCB manufacturer 4PCB features a calculator that calculates the required trace width for a given amount of current that the board will exposed to. The formulas used are:

[ ] 2 (퐶푢푟푟푒푛푡 퐴푚푝푠 ) 퐴푟푒푎[푚𝑖푙푠 ] = 1 ( ) (푘 ∗ (푇푒푚푝_푟𝑖푠푒[푑푒푔. 퐶])푏) 푐

퐴푟푒푎[푚𝑖푙푠2] 푊𝑖푑푡ℎ[푚𝑖푙푠] = 푚𝑖푙푠 [ ] (푇ℎ𝑖푐푘푛푒푠푠 표푧 ∗ 1.378 [ 표푧 ])

Where k = 0.024, b = 0.44, c=0.725 for internal layers. For external layers k=0.048, b = 0.44. It is important to remember that this formula is only compatible of currents of 35 amps or lower and a temperature variation of 10 to 100 degrees Celsius. Keeping that it in mind it is better to select a trace width higher than what is recommended by the calculator. Interestingly, trace widths for external layers are noticeably less than what is required for internal layers using the same current. This is because the external layer is exposed to the air allowing for better heat transfer via convection. Depending on if the enclosure being used for the PCB prevents proper ventilation, using the wire trace widths calculated for the internal layers may be a good idea.

Whether a wire trace is being used to route power or used to send a signal, is something to consider when deciding trace width. A trace used for power should

47 be thicker since more current will be running through it. Traces used for signal should be smaller so there will be enough space for other signal traces. Using larger widths for wire traces also have an advantage of lessening errors from appearing in the manufacturing process. Smaller wire traces increase the chances of manufacturing errors. So, to summarize it is best to use larger wire trace widths. Decrease the size of the trace widths when managing real estate on the Print Circuit Board. When decreasing the widths start with signal traces first then if necessary adjust the widths of traces that route power.

Power and ground traces should be drawn after components have been placed. These lines should be wide and be kept as straight as possible. If there is available real estate on the board it is best to use a ground plane instead of just a trace. With a ground plane designer is can ground anything without have to use multiple traces. A ground plane can also provide a lower impedance connection than a trace. The ground plane can also act as an EMI shield. The plane will also act as a heat sink. Using a ground plane provides many advantages with the only trade off being using more circuit board real estate.

Signal traces should be as short as possible using the most direct route. This will keep the resistance associated with the copper trace from degrading the signal. Doing this can improve performance noticeably. This is particularly true in analog circuitry. The distance between traces should be increased whenever possible. This reduces the chances of a short forming in the manufacturing process. A rule of thumb is that the gap between traces is 0.007” at a minimum. Increasing the gap even slightly can reduce errors from occurring.

When ordering PCBs from a fabricator it is recommended to request for a silkscreen even if it costs extra (some fabricators have it standard). Having a silkscreen allows labelling of where everything will go onto the circuit board. This saves a lot of time and makes the process of fully assembling the board much easier. Detailed labels can point out component values, pin labels, button functions and much more. Paying extra for the silkscreen service is worth it if it can reduce the number of mistakes during the soldering of components onto the PCB.

When placing objects on the PCB layout editor it is best to use a snap grid. It may seem like free-hand placement can create a compact design but it’s possible it will bring about more problems. For instance, the PCB manufactures may have trouble producing boards that were designed using free placement of components and wire traces. Using a grid will keep everything thing neat and line everything up. Components will be guaranteed to be lined up straight instead of risking a slight angle. If more space is needed the grid can be lowered from the default size. If it is determined that more space can be used, increase the grid size and this will spread out all components and traces further away from each other. This brings about several benefits.

48

For this project, size is not a major constraint. The controllers will be used in industrial settings, so a small form factor is not a selling point. If anything, larger is better. Having a larger space to design the board comes with several advantages. Components can be spread further apart so heat is not concentrated in one area. Allowing more space between components allows for important nodes to be more accessible. This makes measuring signals and troubleshooting much easier. The auto-routing of traces, featured in many PCB layout software, tends to have better results when components are not tightly packed together. That said it is generally not recommended to rely on the auto-routing feature. It is best to use auto-routing and make small manual adjustments whenever necessary. Spreading the components also makes soldering process more manageable.

When working with multiple instances of a component, it is best to keep them in the same orientation as well as group them together. Keeping related components close together allows shorter trace paths as well as proving easier testing points. It might save space to rotate some of the components, but it’s best to keep things simple for when it comes time to solder. This increase the speed in which the soldering process can be completed as well as reducing the number of errors that can occur. Only change the orientation of similar components if managing space becomes an issue.

A simple step to consider when finishing the layout of the circuit board is to print it on paper in its actual size. Place the components on top of the printed layout to see if everything fits correctly. If some components were taken from a community generated library, there could be mistakes. It’s possible the component sizes might not be incorrect. If this is the case a custom object must be created that fits the actual specs of the component.

One thing that may be overlooked, and mistaken as something that doesn’t need much consideration is the placement of mounting holes. It is incredibly important to make sure that space is given for mounting holes. All components and traces should be kept away from holes, else they could end up touching the metal screws. If metal screws are used the holes should have a dielectric material coating it.

SOLDERING

Soldering is one of the most important skill in designing electronic circuit. PCB is the circuit board that contains the wires to each component. Soldering helps to attach the components into the circuit board. Two of the important techniques of soldering are through-hole soldering and surface mounting component into the circuit board. Picking the material for soldering is important. There are 2 types of solder: leaded and lead-free solder. Leaded solder is useful because of its low melting point and its ability to create a great solder point. However, it’s harmful for human. Lead free solder, it is like leaded solder, but it contains no lead. Instead it is made up of mostly tin and other trace metals, such as silver and copper. This solder is usually marked with the RoHS symbol to let potential buyers know it

49 conforms to the standard. For the scope of this project, we are going to choose lead free solder.

THROUGH-HOLE SOLDERING

The first thing is to heat up the tip of the solder. The temperature of the iron to 675 degrees Fahrenheit. After that, loaded the circuit board into the alligator clips. When soldering leads into circuit boards you want to heat the metal contact on the board and the lead itself. Applying too much heat can damage the circuit board or even your components. The surfaces being joined in this application were much smaller than the twisted wire, so things heated up a lot faster.

Touch the tip of the iron to the crack between the lead and the metal pad on the circuit board. After waiting a couple of seconds, dip the tip of the solder into the joint and placed a very small amount of solder at the connection - no more than the head of a pin or so.

Once the solder pooled a bit and soaked into the joint, remove the solder wire and then the iron. You should remove the solder a second or two before removing the iron so that the tip of the solder doesn't get stuck to the joint. The solder begins to harden as soon as you remove the iron.

Using the proper amount of solder is more important while soldering small components on a circuit board than when soldering wires. If you apply too much solder and it pools up outside of the metal pad, it can cause a short. Too little solder and your component won't make a good connection with the circuit board and might not work the way you want it to. When you've got the right amount of solder it looks like a small ant hill that forms right at the base of the lead and the circuit board. After that, cut the lead.

SURFACE MOUNTING SOLDERING ONTO A PRINTED CIRCUIT BOARD

To solder something onto the surface of a circuit requires a process called tinning. Tinning is when you apply a small amount of solder onto the materials you are joining before you connect them. In this case, it involves putting some solder on a contact on the surface of the circuit board then attaching the component to the solder pool.

First touch the tip of the iron onto the small pad on the top of the circuit board. Then introduced a small amount of solder onto the pad and took the iron away.

Then, a few seconds later, pick up the component that you want to solder with a set of tweezers, heated up the small glob of solder that you had just placed down, and gently lowered the contact on the component into the pool of hot solder.

50

After that, take the iron away, held the component in place a few seconds longer, and released the component from the tweezers. Then went to the other side of the component and finished making the connection by soldering the remaining two contacts together.

Surface soldering is done like this because you need to lower the component into place by hand, so it's hard to hold the iron, the tweezer and the solder all at the same time. Additionally, tinning is just a good thing to do while soldering small components. When soldering small components or doing surface mount soldering like this, tinning can be helpful because you basically already have your solder applied to your pieces before you go to connect them. There is no need to glob on more solder and run the risk of getting it in a place where you don't want it to be.

LADDER LOGIC

The project sponsor, ABB, has provided schematics that is presented using ladder logic. This is not to be confused with the programming language which originates from this diagram notation. The namesake comes from the look of the diagram which starts with two vertical or horizontal rails that represent the two poles of the supply power. One rail represents the ground. In between these rails are the “rungs” of the ladder. The amount of control circuits determines the number of rungs. These types of diagram are often used in industrial control logic systems, which is the setting this project falls into. The basics of the ladder logic diagrams can be learned by examining two key symbols:

FIGURE 23 SYMBOLS FOR NORMALLY OPEN AND NORMALLY CLOSED CONTACTS

Ladder logic diagrams are best used in simple but critical control systems where it is important to see which elements are powered and which are not. The two symbols above make gauging the circuit flow much easier than other styles of diagrams. The two symbols in Figure 23 above are contacts. In ladder diagrams contacts are anything that can toggled to allow or block the flow of electricity. This means switches, push buttons, or even a transistor acting as voltage or current controlled switch can be represented using the contact symbols. The contacts are labeled by whatever controls the toggling of its state. For example, P1 for push button one, or SW2 for switch two. Sometimes a contact can just be labeled Input “X” or Output “Y”, for when the toggling of a contact depends on something other than a physical means of toggling states. For instance, measurements like the amount of current going through a device.

51

The symbol on the left side of Figure 23 on the previous page is for contacts that are normally open. These types of contacts mean that if left alone the flow electricity will be blocked. Toggling the contact will allow the corresponding section of the circuit to receive current. This is easy to remember because the symbol literally looks like a break in the circuit which would prevent current from traveling through the circuit. This type of contact behaves in an intuitive matter, that most people would characterize the usual behavior of a button. An example of this type of contact is a start button; the device is unable to do anything until the start button is pushed and allows current to flow through the rest of the circuit.

The second symbol is for contacts that are normally closed. These contacts behave in the opposite way of normally open contacts. When using normally closed contacts, the relevant part of the circuit is powered and operational in the default starting state. It is only when the contact is toggle that the current to the circuit is blocked. Remembering the behavior of a normally closed contact is easy because the symbol does not look like a break in the circuit like the normally open symbol does. An example of a normally closed contact is an emergency stop button. In this case the device works normally until the stop button is pushed. The device will then be disconnected from the power supply completely.

FIGURE 24 THIS LAYOUT OF CONTACTS BEHAVES IDENTICALLY TO AN AND LOGIC GATE

Figure 24 above illustrates why ladder diagrams are often used in control logic systems. It is easy to see that contacts P1 and P2 both need to be toggled for any power to go to the motor. Think about how this situation is represented in a digital logic diagram. An AND gate would be used to produce them same function as the two contacts in Figure 21 above. Picturing an AND gate does not immediately reveal the situation that both inputs must be 1 before the signal gets through the gate.

This is the advantage of ladder logic diagrams; It can be gauged quickly how the signal can get to its destination as well as what contacts needed to be toggled for it to get there. For this project, a situation in which this layout of contacts is used is when sending the racking-in signal from the test position. In this case the orientation of the circuit breaker and the button for racking-in will be represented as contacts. The circuit breaker will to move into the connected position, if and only if, the rack-in button is pushed, and the breaker is in the open position.

52

FIGURE 25 THIS CONFIGURATION PRODUCES A NOR GATE

The normally closed contacts behave like an inverter. In ladder logic however, placing a normally closed contact after the two normally open contacts will not reproduce the function of a NAND gate. In fact, it is not possible to produce a NAND gate functionality using this layout of contacts. It might intuitively seem like replacing the two normally open contacts with normally closed contacts will produce a NAND gate, but this is not the case. By using normally closed contacts what is happening is not inverting the output of an AND gate. Instead, the inputs are being inverted and a “negative” AND gate is produced. The negative-AND gate is identical to the NOR gate. So, with two normally closed contacts in series the only time power will not reach the motor is when both contacts are toggled from their default states. In all other combinations, the motor will be powered.

FIGURE 26 CONFIGURATION OF CONTACTS THAT PRODUCE AN OR GATE

The illustration in Figure 26 above behaves like an OR gate. It is plain to see that there are two paths for the power to reach the motor. If push button one is pressed the motor will be turned on. If push button two is pushed again the motor will be powered. If both buttons are pushed, then the motor will be powered. The only situation the motor will be deactivated is if neither of the buttons are pushed.

For the project, the layout featured in Figure 26 will be useful in controlling the rack-out signal. There are two situations in which the rack-out signal being sent is desired. The first, and obvious, situation is when the rack-out button is pressed. The second situation is when the control board senses that an unusually high amount of current is going through the DC motor. When there is too much current this indicates that the motor is being obstructed in some way. If there is something blocking the motor the desired action is for the motor to back a position. So, in this case, the current going through the motor, and the rack-out button would be represented by normally open contacts.

53

Using the same logic as when the contacts were in series; when contacts are in parallel, replacing the normally open contacts with normally closed contacts will produce a different type of logic. In this case two normally closed contacts in parallel will produce a Negative-OR gate, also known as a NAND gate. When dealing with this configuration the only time the motor will be powered is if both contacts are left in their default states. In all other situations, the motor will not receive power.

As an aside, the Exclusive-OR gate can also be created using ladder logic. This would require a minimum of four contacts two of which are normally closed and the other two being normally open. It would take two inputs and the contacts would be grouped in series-parallel arrangement. This situation did not appear in the schematics provided by ABB so further examination is not needed.

Ladder Logic Diagrams are perfect for permissive circuits. This is when several conditions need to be met before a device can operate. This is important for safety checks, which is applicable to this project. By connecting the conditions necessary for safe operation of a device in parallel, all conditions must be met before the device can be energized. If any condition is not satisfied the circuits will stay open. In effect, the control system must request permission from several contacts before anything can be powered. Another way to add safety in the operation of a control system is to use ladder logic to produce an interlocking circuit. These types of circuits ensure that two conflicting events cannot occur simultaneously. Interlocking design directly applicable to this project. For example, a situation that would be best to avoid is energizing the forward and reverse contacts at the same time. To prevent this from occurring energizing the forward contacts should be tied to a normally closed contact that will prevent the energizing the of the reverse contacts.

Another way these types of Logic diagrams are useful are in the design of fail safes. The simple way to set up something like a fire alarm system is to set normally open contacts in parallel, one for each room of the building. In this way, the siren alarm will sound as long any of the switches are actuated.

However, there is a flaw in this design. It does not consider what happens in the event of a wiring failure. Open failures tend to be the most common type of failure. If one of the contacts connected to the siren alarm has an open failure there would be no way of knowing that it is unable to sound the alarm until a regular fire drill check is performed. One way to get around this problem is to connect a normally closed contact directly to the siren. This normally closed contact would then be toggled by the previous contacts connected in parallel. If one of the rooms in the building has an open failure the alarm will sound. In this situation, the siren will sound if the alarm is pulled or if there is an open failure in one of the contacts.

54

EMERGENCY STOP BUTTON

One of the requirement specifications for both the basic and Advanced Controller is to feature an emergency stop button. The circuit racking motor already contains safety features in the form of permissive ad interlock circuits. For regular household devices, this might be enough to eliminate most hazards. This project deals with Switchgear systems which can be very can be dangerous, indeed even deadly. If for some unfortunate reason the safety systems have failed, it is incredibly important to have an emergency stop button to de-energize the machinery as a last result.

As mentioned previously an emergency stop button can be added to a control logic system. Using ladder logic diagrams, it’s clear to see that implementing a stop button can be very simple. In the case of this project, placing a normally closed contact in series with the motor truck provides the desired effect of de-energizing the motor when the button is pushed. Placing the stop button in series with the racking motor gives it the highest priority, ignoring any other signals that would normally cause the motor to start moving. This emergency stop button would only apply to the circuit racking motor not the entire Switchgear system. An example of when the E-stop might be used, is if the motor starts moving the circuit breaker in the connect position while the breaker is closed. That situation shouldn’t occur but if for some reason the safety mechanisms that would prevent those events from happening were to fail, it would be a good time to hit the E-stop button.

The emergency stop actuator needs to easily accessible and recognizable, but at the same time must be placed in a manner that it won’t be accidentally pushed. Placement should be obvious and quick to reach. The stop button must work reliably and safely always. On the controller, the E-Stop button is placed in a manner that visually separates it from the standard control buttons.

The stop button for the controller is red and larger than the other buttons featured on the controller. The housing of the controller contrasts with the red color of the stop button. The stop button could also be different in shape from the regular buttons. For instance, if the standard buttons are flat, the stop button could be mushroom shaped. The E-Stop button must also be extremely durable and wear resistant, therefore the contacts should be made with hard silver, gold, or palladium.

There are three types of stops when dealing with emergency buttons. The first is a controlled stop with power available to the actuators to achieve the stop and power is then removed after the stop has finished. The second is a controlled stop where power is left to the machine’s actuators even after the stop. The third and final category, is the uncontrolled stop. For this type of stop, power is immediately removed from the machinery and all brakes and mechanical stopping devices are applied. For this project, the uncontrolled stop is style that will be implemented.

55

The emergency stop only applies to the movement of the circuit raking motor, not the entire Switchgear system.

INTRODUCTION TO THE OPERATION AND POSITIONS

ABB Medium Voltage Withdrawable Circuit Breaker (MVCB) includes of a breaker element and an integrated racking truck attached to the bottom of the MVCB. Once the withdrawable breaker assembly is inserted into the Switchgear system compartment the truck is utilized to move or “rack” the breaker between the three physical operational modes or racking positions.

“Disconnect” being the first position, this is when the breaker has just been inserted into the compartment and is ready to be racked into one of the next two positions, at this moment no primary or secondary electrical connections have been made to the breaker element.

“Test” position is the next position that the assembly is racked into, in this position, the secondary control wiring connections to the breaker element automatically connects and lock into the withdrawable assembly, charging the breaker element with energy to allow a testing of the breaker operations and control signal indicators.

The final and third position being the “Connected” position. During racking of the withdrawable assembly to the connected position, the primary shutter assembly opens, and the primary contacts of the breaker engage connecting the breaker for primary circuit operation. In this “connect” position, you can open and close the breaker.

FIGURE 27 ABB IRS CIRCUIT BREAKER RACK IN PROCEDURE

56

HARDWARE SCHEMATIC

FIGURE 28 HARDWARE SCHEMATIC, REPRODUCED AND REPRINTED WITH PERMISSION OF ABB LTD.

In Figure 28 above fully detailed hardware schematic diagram which shows all the contacts and what is inside of truck itself. This schematic diagram is used for production of the PCB. In Figure 25, DB1 and DB2 switches change states when the breaker goes into and out of the disconnected position. Electrically preventing the racking operation past the disconnect position. A higher-level hardware schematic can be used as in the Figure 29 below.

FIGURE 29 BASIC CONTROLLER AND INTERNAL TO TRUCK ASSEMBLY, REPRODUCED AND REPRINTED WITH PERMISSION OF ABB LTD. 57

Looking at the schematic, we can see that those blue circles represent the LED with “disconnect” is represented with the green LED (G), “racking” is represented with the white LED (W), “test” is represented by yellow LED (Y), and “connect” is represented by the red LED (R).

There are some operations and symbols that are important in regard of the schematic:

• Normally open (₌): a contact that does not flow current in its normal state. Energizing it and switching it on closes the contact, causing it to allow current flow. • Normally close (≠): a contact that flow current in its normal state. Energizing it and switching it on opens the contact, causing it to not allow current flow. • Racking pin: is used to mechanically locked the assembly truck in one of the three positions (Disconnect, Test, and Connect). The pin is released manually by depressing the position release lever or electrically from the pin solenoid. When pin is disengaged from racking screw position, the Interlock Breaker (IB) limit switches change state • Racking pin release solenoid MI: electromechanically releases racking pin from racking screw while actuating IB limit switches • IB1, IB2, IB3: Interlock breaker limit switches are actuated when the truck is at rest. They change states when the racking pin is released from the racking screw to permit the racking operation. IB3 is the contact used to block the close command when the breaker is not in the Test or Connect position. • CB1, CB2: Connect Breaker limit switches change states when breaker goes into and out of connected position. Electrically prevents racking operation past connected position • Racking motor MR: provide electromechanical racking motion

The operation of the Basic Controller and the motorized assembly truck is based on the 3 contacts: disconnect contact (all the DBs limit switches), interlock breaker contact (all the IBs limit switches), connect contact (all the CBs limit switches). Refer to the schematic in Figure 29 to see the physical location of the following items.

ABB IRS in Disconnect Position (Initial Position)

IB1a IB1b IB2a IB2b DB1a DB1b DB2a CB1a CB1b CB2b Open Close Open Close Open Close Open Open Close Close TABLE 9 CIRCUIT JUNCTION STATES WHILE ABB IRS IS IN THE DISCONNECT POSITION

58

Disconnect LED (Green) On Racking LED (White) Off Test LED (Yellow) Off Connect LED (Red) Off TABLE 10 LED STATUS WHILE ABB IRS IS IN THE DISCONNECT POSITION

At this position, we can see that DB1B is close which mean the green disconnect LED is on, CB1b is close and the rack in button can be pressed. IB1a (a contact which hold the control over the motor power, if it’s close the motor starts to do work to move the assembly truck, if it’s open, the motor won’t do anything) is open.

ABB IRS in Racking In State

IB1a IB1b IB2a IB2b DB1a DB1b DB2a CB1a CB1b CB2b Close Open Close Open Close Open Close Open Close Close TABLE 11 CIRCUIT JUNCTION STATUS WHILE ABB IRS IS IN THE RACKING IN STATE

Disconnect LED (Green) Off Racking LED (White) On Test LED (Yellow) Off Connect LED (Red) Off TABLE 12 LED STATUSES WHILE ABB IRS IS IN THE RACKING IN STATE

The current signal is going through CB1b to the passive controller. It then activates the racking pin release solenoid which release the racking pin from the racking screw. For that reason, all the IBs contacts change state. IB1a closes activates the motor to do work, begin racking the assembly from the disconnect position toward the test position. After the motor begins racking, the disconnect contact also change states. DB1b is open which means the green LED is off. IB2a is close which means the white LED “racking” is on. There’s no change to the test and the connect LED since they have opens in their connection.

ABB IRS in Test Position after Racking In

IB1a IB1b IB2a IB2b DB1a DB1b DB2a CB1a CB1b CB2b Open Close Open Close Close Open Close Open Close Close TABLE 13 CIRCUIT JUNCTION STATUS WHILE ABB IRS IS IN THE TEST POSITION AFTER RACKING IN

Disconnect LED (Green) Off Racking LED (White) Off Test LED (Yellow) On Connect LED (Red) Off TABLE 14 LED STATUSES WHILE ABB IRS IS IN THE TEST POSITION AFTER RACKING IN

At the test position, interlock is engaged locking the racking pin into the racking screw. This changes all the IBs contact. IB1a is open which disables the power from the motor. The racking truck is not moving anymore. IB2a is also open which 59 leads the racking LED be turned off. DB2a, CB2b, IB1b are all closed which leads to the test LED is on. There’s no change to the disconnect and the connect LED since they have opens in their connection.

ABB IRS in the Racking In State from the Test Position

IB1a IB1b IB2a IB2b DB1a DB1b DB2a CB1a CB1b CB2b Close Open Close Open Close Open Close Open Close Close TABLE 15 CIRCUIT JUNCTION STATUS WHILE ABB IRS IS IN THE RACKING IN STATE FROM THE TEST POSITION

Disconnect LED (Green) Off Racking LED (White) On Test LED (Yellow) Off Connect LED (Red) Off TABLE 16 LED STATUSES WHILE ABB IRS IS IN THE RACKING IN STATE FROM THE TEST POSITION

When you press rack in again, there is a signal current going through the closed CB1b to the passive controller. This signal activates the racking pin release solenoid which releases the racking pin from the racking screw. All the IBs contact change state. IB1a is close again which activates the motor to do work to move the truck from the test position toward the connect position. IB2a is close which turns the racking LED on. IB1b is open which creates an open in the test LED connection. This turns the test LED off. There’s no change in the disconnect and the connect LED since they have opens in their connection.

ABB IRS in the Connect Position

IB1a IB1b IB2a IB2b DB1a DB1b DB2a CB1a CB1b CB2b Open Close Open Close Close Open Close Close Open Open TABLE 17 CIRCUIT JUNCTION STATUS WHILE ABB IRS IS IN THE CONNECT POSITION

Disconnect LED (Green) Off Racking LED (White) Off Test LED (Yellow) Off Connect LED (Red) On TABLE 18 LED STATUSES WHILE ABB IRS IS IN THE CONNECT POSITION

At the connect position, all the connect contact CBs change state. Racking pin interlock is engaged locking the racking pin into the racking screw. For that reason, all the IBs change state. IB1a is open which disables the power from the motor. The truck stops racking. CB1a and IB2b are close which turns on the connect LED. IB2a is open which turns off the racking LED. The disconnect and test LED remain off.

60

ABB IRS in the Racking Out State from Connect Position

IB1a IB1b IB2a IB2b DB1a DB1b DB2a CB1a CB1b CB2b Close Open Close Open Close Open Close Open Close Close TABLE 19 CIRCUIT JUNCTION STATUS WHILE ABB IRS IS IN THE RACKING OUT STATE FROM CONNECT POSITION

Disconnect LED (Green) Off Racking LED (White) On Test LED (Yellow) Off Connect LED (Red) Off TABLE 20 LED STATUSES WHILE ABB IRS IS IN THE RACKING OUT STATE FROM CONNECT POSITION

When you press rack out, the current signal goes through DB1a to the passive controller. It activates the racking pin release solenoid and release those racking pin. All the IBs contact change state. IB1a is close which activates the motor to do work. The motor will begin to rack the truck out from the connect position toward the test position. After the truck being racked out, the connect contact will change state as well. IB2a is close which turns on the racking LED. Both CB1a and IB2b are open which turn off the connect LED. The disconnect and test LED remain off.

ABB IRS in the Test Position after Racking Out

IB1a IB1b IB2a IB2b DB1a DB1b DB2a CB1a CB1b CB2b Open Close Open Close Close Open Close Open Close Close TABLE 21 CIRCUIT JUNCTION STATUS WHILE ABB IRS IS IN THE TEST POSITION AFTER RACKING OUT

Disconnect LED (Green) Off Racking LED (White) Off Test LED (Yellow) On Connect LED (Red) Off TABLE 22 LED STATUSES WHILE ABB IRS IS IN THE TEST POSITION AFTER RACKING OUT

At the test position, interlock is engaged again locking the racking pin into the racking screw. This changes all IBs state. IB1a is open which cuts the power from the motor. The racking truck stops moving. IB2a is open which turns off the racking LED. DB2a, CB2b, and IB1b are closed which turn on the test LED. The disconnect and connect LED are both off.

ABB IRS in the Racking Out State from the Test Position

IB1a IB1b IB2a IB2b DB1a DB1b DB2a CB1a CB1b CB2b Close Open Close Open Close Open Close Open Close Close TABLE 23 CIRCUIT JUNCTION STATUS WHILE ABB IRS IS IN THE RACKING OUT STATE FROM THE TEST POSITION

Disconnect LED (Green) Off

61

Racking LED (White) On Test LED (Yellow) Off Connect LED (Red) Off TABLE 24 LED STATUSES WHILE ABB IRS IS IN THE RACKING OUT STATE FROM THE TEST POSITION

When you press rack out again in the test position, the current signal will go through DB1a to the passive controller activating the racking pin release solenoid. This will release the racking pin from the racking screw and change all the IBs state. IB1a is close again. The motor will be enabling to do work moving the truck from the test position to the disconnect position. IB2a is close which will turn on the racking LED. The test LED will turn off because IB1b is open. The connect and disconnect LED are both off.

ABB IRS in the Disconnect Position after Racking Out

IB1a IB1b IB2a IB2b DB1a DB1b DB2a CB1a CB1b CB2b Open Close Open Close Open Close Open Open Close Close TABLE 25 CIRCUIT JUNCTION STATUS WHILE ABB IRS IS IN THE DISCONNECT POSITION AFTER RACKING OUT

Disconnect LED (Green) On Racking LED (White) Off Test LED (Yellow) Off Connect LED (Red) Off TABLE 26 LED STATUSES WHILE ABB IRS IS IN THE DISCONNECT POSITION AFTER RACKING OUT

At the disconnect position, interlock engages again locking the racking pin in the racking screw. All the IBs contact change state. IB1a is open will stop the motor from running. The racking out process will stop. All the disconnect contact will change state as well. DB1b is closed which will turn on the disconnect LED. IB2a is open which will turn off the racking LED. The test and connect LED are both off.

PULSE GENERATOR FOR BLINKING LED AND FLIP FLOP IN THE PCB BOARD

We are going to generate pulse signal for the LED when it’s blinking and for the flip flop to have a delay time using the 555 IC timer. 555 IC is a highly stable device for generating accurate time delay or oscillation. Additional terminals are provided for triggering or resetting if desired. This 555 IC chip can be used to generate a single pulse (Monostable Multivibrator) or multiple pulse (Astable Multivibrator). In this project, we are going to use the Astable Multivibrator because we are going to generate multiple pulse with frequency of 5 Hz. Below is the circuit diagram of Astable Multivibrator 555 timer.

62

FIGURE 30 ASTABLE MULTIVIBRATOR 555 TIMER

Given a Pulse repetition frequency of 5 Hz

1.44 Pulse repetition frequency (PRF) = 퐶∗(푅1+2푅2)

0.72 When 푅2 ≫ 푅1, the value of PRF = 퐶∗푅2

Pick R1 to be 10 kΩ and for C pick a low value so that R2 is high and it can satisfy the pulse repetition frequency. For the value of C, we pick it to be 1000 nF. So, the value of R2 is 144 kΩ. The components that we are going to need is:

R1 =10 kΩ, R2= 144 kΩ C= 1000 nF

For the application of this project, we have a few option which are LM555, NE555, LMC555, and TLC555.

63

NE555

FIGURE 31 NE555 PRECISION TIMING CIRCUIT

The NE555 circuit in Figure 31 above is precision timing circuit capable of producing accurate time delays and oscillation. In the time delay mode of operation, the time interval is controlled by a single external resistor and capacitor network. In a stable mode of operation, the frequency and duty cycle can be controlled independently with 2 external resistors and a single external capacitor. The threshold and trigger levels normally are two-third and one-third, respectively, of Vcc. These levels can be altered by use of control voltage terminal. The output circuit is capable of sinking or sourcing current up to 200 mA. Operation is specified for supplies of 5V to 15V. With a 5V supply, output levels are compatible with TTL inputs. The price is $0.46 per unit.

LM555

FIGURE 32 LM555 TIME DELAY AND OSCILLATION GENERATING CIRCUIT

The LM555 circuit in Figure 32 above is a highly stable device for generating accurate time delays or oscillations. Additional terminal is provided for triggering or resetting if desired. The circuit maybe triggered and reset on falling waveform, and the output circuit can source or sink up to 200 mA or drive TTL circuit. The price is $0.99 per unit.

64

TLC555

FIGURE 33 TLC555 MONOLITHIC TIMING CIRCUIT, PUBLIC USE IMAGE PROVIDED BY TEXAS INSTRUMENTS

The TLC555 circuit in Figure 33 above is a monolithic timing circuit fabricated using the Texas Instruments LinCMOS process. The timer is fully compatible with CMOS, TTL, and MOS logic and operates at frequencies up to 2 MHz. Because of its high input impedance, this device uses smaller timing capacitors than those used by the NE555. As a result, more accurate time delays and oscillations are possible. Power consumption is low across the full range of power supply voltage. Like the NE555, the TLC555 has a trigger level equal to approximately one-third of the supply voltage and a threshold level equal to approximately two-thirds of the supply voltage. These levels can be altered by use of the control voltage terminal (CONT). All unused inputs should be tied to an appropriate logic level to prevent false triggering. While the CMOS output is capable of sinking over 100 mA and sourcing over 10 mA, the TLC555 exhibits greatly reduced supply-current spikes during output transitions. This minimizes the need for the large decoupling capacitors required by the NE555. The price is $0.80 per unit.

LMC555

FIGURE 34 LMC555 TIME DELAY AND OSCILLATION GENERATOR CIRCUIT

The LMC555 circuit in Figure 34 above offers the same capability of generating accurate time delays and frequencies as the LM555 but with much lower power dissipation and supply current spikes. When operated as a one-shot, the time delay is precisely controlled by a single external resistor and capacitor. In the astable mode the oscillation frequency and duty cycle are accurately set by two external resistors and one capacitor. The use of Texas Instruments's LMCMOS

65 process extends both the frequency range and the low supply capability. The price is $1.07 per unit.

In conclusion, comparing between all these 555 IC timer, we are more satisfied on the specs of the LMC555. Even though the price for them somewhat higher than the other chips, the one thing that we really like for this chip is that it provides a much lower power dissipation and supply current spikes. This will save us some power in our PCB board.

Edit- none of these chips were used. Instead the internal clocks on the MSP430 microcontroller were used to control all the timing neded.

VOLTAGE STEP DOWN

To connect the power supply of the motorized track which is 125 VDC to the current sensing switch, we need a voltage step down because the current sensing switch can only operate in a lower range of voltage (<25 VDC). We chose the switching regulator because linear regulator tends to draw extra unnecessary power from the circuit. For that reason, the efficiency of the linear regulator is not high. In the other hand, the buck converter can reach efficiencies of 90% which save a lot of power.

BUCK CONVERTER

FIGURE 35 BUCK CONVERTER CIRCUIT DIAGRAM

As shown above is a buck converter. It is a DC to DC power converter which step down voltage and step up current. The buck converter typically consists of two switches: diode D and S, two pole low-pass filter, and a load. The circuit can be studied in two different modes: the first mode when the switch S is on, and the second mode when the switch S is off. Consider the duty ratio of switch S is:

푇 퐷 = 푂푁 in which 푇 = 푇 + 푇 푇 푂푁 푂퐹퐹

The first mode when the switch S is on:

66

FIGURE 36 BUCK CONVERTER WHEN THE SWITCH S IS ON

푑푖 Voltage across the inductor = 푉 = 퐿 ∗ where 퐼 = 퐼 + 퐼 퐿 푑푡 퐶 0 푉 Load current = 퐼 = 0 0 푅

Applying Kirchhoff’s voltage law, we can get: 푑푖 푉 = 푉 + 푉 == 퐿 ∗ + 푉 and 푉 = 푉 푆 퐿 푑푡 0 0 퐶

The second mode when the switch S is off:

FIGURE 37 BUCK CONVERTER WHEN THE SWITCH S IS OFF

푑푖 VL+V0=0 =>V0=- L 푑푡

As the output voltage is assume constant by small ripple approximation, the slope of the inductor current is constant.

67

FIGURE 38 WAVEFORM OF IS, ID, I, AND VL

푑푖 As VL= L 푑푡 푉푆−푉0 => (Imax-Imin) Switch on = DT 퐿 And 푉0 => (Imin-Imax) Switch off=- (1-DT) 퐿

From the steady state perspective, magnitude of the inductor current increment during switch on is equal to the inductor current decrement during switch off

|(퐼푀퐴푋 − 퐼푀퐼푁)푆푤𝑖푡푐ℎ 표푛| = |(퐼푀퐼푁 − 퐼푀퐴푋)푆푤𝑖푡푐ℎ 표푓푓|

푉0 = 퐷푉푆

Since D is always less than 1, the voltage of the output is always less than the voltage of the input)

68

MICROCONTROLLER

Microcontroller can be used to flash the racking LED light when the motorized truck is moving from between the three positions. We have two options for using a microcontroller. The first option is the MSP430 microcontroller, and the second option is the Arduino microcontroller. We also have the third option of building our own clock circuitry. However, after considering about the cost and the power consumption, the microcontroller will yield more advantages

MSP430

A Texas Instruments Launchpad (MSP430) costs $10 including everything. We will check out the MSP430G2553 for this project, as it is the most powerful of the three and what you officially get with the board. You get 16 IO pins, of which 8 can do analog input and 7 can do Pulse Width Modulation (PWM). You also get a green LED connected to a PWM pin and a red LED connected to a digital IO pin. Both LEDs can be detached from their pins by removing a pair of jumpers. You get a RESET button just like the Arduino, as well as an extra pushbutton that you can use in your projects

Texas Instruments puts out an integrated development environment for programming the MSP430. For that reason, you can use the C programming language to program the board easily. The Launchpad also has expansion boards, Texas Instruments calls them Booster Packs. They add all sorts of features, just like the Arduino shields do. The Booster Packs do not, however, stack.

Included with the LaunchPad package is the MSP430G2452. This microcontroller is nearly identical to the unit that comes installed with the test board but has less memory. Instead of the G2553’s 616kB of flash memory and 512B of RAM this controller has 8kB of flash memory and 256B of RAM. The active power used for both chips are nearly the same; the G2553 uses 330 (uA/MHz) while the G2452 uses 320 (uA/MHz). There is little reason to consider the microcontroller with less resources.

ARDUINO MICROCONTROLLER (ARDUINO UNO, ATMEGA328P)

The cost for an Arduino Uno with the board and the cable are probably between 30 to 35 dollars. This gets you 20 IO pins, 6 of which do analog input and 6 of which can do PWM output (pulse width modulation). There is a RESET button on the board just in case that your code crash or you have other reasons to need it. There is an LED built into pin 13 for easy testing and/or status reports. Disabling this LED if you want to use pin 13 for something the LED interferes with requires cutting a trace or de-soldering the LED.

Arduinos have a lot of expansion options. Boards called 'shields' can be stacked on top of the Arduino board to add features like Ethernet, motor control, WIFI,

69

GSM, Cell Radio, wireless communication, etc. Many of them can be stacked on top of other shields as well. This option will leave us a lot of room to do application.

RASPBERRY PI (BROADCOM 2835)

Strangely, despite being a very popular MCU to work with, the Broadcom 2835 is not possible to work with on this project. Incorporating the MCU into a custom designed PCB is impossible. There are no schematics available and obtaining a single processor to work with is not an option since it’s not even available for sale. Buying the test board wouldn’t help either since the MCU is not removable from the Raspberry Pi itself. Still a Raspberry Pi could be useful as an easy way to test how well the wireless capabilities of the Advanced Controller works.

CONCLUSION

After comparing the possible two microcontrollers, even though the MSP430 is cheaper in cost and has a lower power consumption, we decide that we are going to use the Arduinos microcontroller because of its applications. The wide variety of application include wireless communication and WIFI are important in our project. For that reason, we value the Arduino more than the MSP430.

Edit- We did not decide to use the ATMega32 processor, we used the MSP430G2553. We also used the Raspberry Pi to enable wireless connectivity to the control board.

PROGRAMING ARDUINO UNO TO BLINK LED

The first thing you do is to initialize LED_BUILTIN pin as an output pin with the line pinMode(LED_BUILTIN, OUTPUT);

In the main loop, you turn the LED on with the line: digitalWrite(LED_BUILTIN, HIGH);

This supplies 5 volts to the LED anode. That creates a voltage difference across the pins of the LED, and lights it up. Then you turn it off with the line: digitalWrite(LED_BUILTIN, LOW);

That takes the LED_BUILTIN pin back to 0 volts, and turns the LED off. In between the on and the off, you want enough time for a person to see the change, so the delay() commands tell the board to do nothing for 1000 milliseconds, or one second. When you use the delay() command, nothing else happens for that amount of time

CURRENT SENSING SWITCH

70

For this project, we need a current sensing switch to detect if the current flowing in the circuit excess the acceptable current value. If the value excess is larger than the acceptable value, the motor will be blocked from operating and all the racking operation will be stopped. Here is the table of the current operates in the system:

71

Rate Rated Starting Starting Running Blocked Rack Voltage Power Current Current Current Motor IN/OUT Duration Current Current @ 75ms 24VDC 40W 10A 40ms 1.67A 9.3A 48VDC 40W 5.2A 40ms 0.83A 4.7A 0.42A 110VDC 40W 2.6A 40ms 0.36A 2.3A 0.17A 125VDC 40W 2.0A 40ms 0.32A 1.8A 0.15A 220VDC 40W 0.8A 40ms 0.18A 0.5A 0.08A TABLE 27 TABLE OF CURRENT AND POWER USED BY THE MOTORIZED TRUCK

As shown in Table 27 above, for the voltage supply of 125 VDC which is used in the factory itself, the running current is 0.32 A and the block motor current is 1.8 A. So, we need a current sensing switch of 1.8 A. If the current in the circuit somehow reach 1.8 A, the motor stops function and the racking stop immediately. For the application of the current sensing switch, we can use the DS3 series DC current operated switch of NK technology

FIGURE 39 DS3 SWITCH

FIGURE 40 DS3 SWITCH SDT MODEL

72

DS3 series are DC current operated switches. They accept 24 VAC or 24 VDC power, and the output are isolated from the input and the power supply. The sensor can be supplied with solid state output or with form C relay output (SDT). In our case, we are going to use the SDT model. Moreover, they operate (switch) when the current level through the hole exceeds the adjustable setpoint. In our case, the set point is 1.8 A. If the current level exceeds 1.8 A, it can change the state of the normally close wire which supply the power for the motorized truck. About the setpoint of the DS3 switches, there are two mechanisms in selecting the setpoint. The first one is to select the setpoint range with the range jumper. The second one is to fine tune the setpoint with the 11 turns potentiometer. We are going to use second method to set the setpoint since we don’t need the range of current. You can turn counter clockwise to decrease the set point and clockwise to increase the set point. The potentiometer has a slip-clutch to prevent damage at either end of its rotation.

FIGURE 41 4 OUTPUT TYPE AND LED BASED ON MONITORED AMPS

The DS3 switches will be connected to the V- connection that come from the passive controller inside of the motorized truck. The reason is that the V- connection is the main connection that will later split out to those “connect”, “disconnect”, “test”, and “racking” connection.

CAT 5 ETHERNET CABLE

The Cat 5 ethernet cable is the type of connection that the project sponsor, ABB, wanted to be used as the means of communicating with the circuit racking motor. The main reason for this is because of the convenience provided by the cable type’s ubiquity. It also makes retrofitting older models of Switchgear systems with the motor truck. The Cat 5e ethernet and the Cat 6 ethernet cable types can also be used instead since they are backwards compatible and can be used anywhere a Cat 5 ethernet cable can. It is unlikely that the new features that are found in the Cat 5e ethernet and Cat 6 ethernet cable types provide any type of advantage. Because of this, the specs that will be discussed refer specifically to the Cat 5 ethernet cable since that will be the worst-case scenario.

The Cat 5 ethernet is a twisted pair cable used to communication signals. These cables can feature electromagnetic shielding, but it’s not guaranteed so it’s best to assume they are not. For this project, the idea is that any Cat 5 ethernet cable can be used so proceed as they are not shielded.

73

The Cat 5 ethernet cable features balanced line twisted pair design and differential signaling. This design reduces electronic crosstalk, and electromagnetic interference. It also reduces noise emission and acceptance. Differential pairs reduce noise since circuit only sees the difference between the wires. Since the appears in both pairs they will end up canceling out each other. The Cat 5 ethernet can keep a high signal-to-noise ratio.

The Cat 5 ethernet cable has 8 pins to work with. This is incidentally, the amount of connections needed to communicate with the racking motor. When integrating a RJ45 jack on a PCB there are several recommendations that can be followed to make working with a Cat 5 ethernet cable as trouble free as possible. It is important to remember that RJ45 jacks must contain magnetics. Many jacks that can be bought have the magnetics built in. If this is not featured the magnetics must be designed and put onto the PCB board.

FIGURE 42 SCHEMATIC FOR REQUIRED MAGNETIC MODULE

Traces between the magnetic module and the RJ45 jack needs to be kept as small as possible. As a rule of thumb, the length of the trace to from the magnetics to the jack cannot be more than one inch. The impedance of the wire should be less than 50 ohms. This can be calculated using the equation featured in the “PCB Design Consideration” section of the report.

74

The positive/negative transmission and positive/negative receiving traces should also be kept short as possible. Less than one-inch traces are ideal and any traces larger than three inches will start to suffer in performance. Once again, the traces for the transmission and receiving traces need to have a resistance of less than 50 ohms.

The transmitting and receiving pair traces needed to be paired together. The distance between the traces need to be kept under 0.25 mm. The differential pairs need to have less than 0.5 mm of separation. The power supply needs to be at 3.3 V DC with a tolerance of ±5%.

PROJECT SOFTWARE DESIGN

IDEA BEHIND SOFTWARE ARCHITECTURE DESIGN

The idea behind our Software Architecture Design is to fulfill the requirement of being able to wirelessly communicate with and send commands to the Switchgear systems deployed at the site. We created two software architecture designs that are both possible solutions to our software requirement for the sponsor. The software requirement for the project is to be able to communicate from a to a ABB local server over Wi-Fi, using a bridging medium on the ABB local server to pass the communication to the Switchgear System relay, which bridges the communication to the control board in the low voltage compartment. The major hurdles with designing a software architecture is the communication between three different platforms.

FIGURE 43 SWITCHGEAR SYSTEM SITE NETWORK ARCHITECTURE, REPRODUCED AND REPRINTED WITH PERMISSION OF ABB LTD.

75

SOFTWARE DESIGN 1 – WEB SERVER ARCHITECTURE

OVERVIEW

The Web Server Architecture is comprised of a web server hosted on the ABB local server at the site that the Switchgear systems are deployed, a web browser running on the Advanced Controller, and a network traffic publisher/subscriber system running on the Switchgear system relay. The ABB local server running at the Switchgear site runs on a server grade level of already, making it ideal for this design. Adding a local network accessible web server to the ABB local server is a relatively simple process. Being a server grade level of Microsoft Windows, we can have the network administrator install the packages required to host a web server on the machine, if they are not already installed, and then we can work together to get the web server configured properly to work with our design and configuration. An added benefit to this is as students we have access to server grade levels of Microsoft Windows through Microsoft Imagine that we can install locally to a virtual machine, allowing us to develop and test without having to go to the ABB office or a site deployed with the Switchgear systems. Not only does this side-effect benefit us for development purposes but also for future development after the design is deployed. Being able to locally deploy the entire Web Server Architecture design at a software engineer’s desk allows for faster development times and easier quality control on the system and/or new features.

The Advanced Controller is a generic name for any Wi-Fi enabled device capable of running compiled executables, this is a specific case with the Web Server Architecture design. Any modern computer, tablet, or tablet computer can run a web browser whether it is a built-in browser, or one downloaded from the device’s respective program source. This is a great benefit to the Web Server Architecture design in that it makes the Advanced Controller completely agnostic to the device it is running on. So long as the device can connect to the network either wirelessly, wired through an ethernet connection, or even directly to the Switchgear system relay like the Basic Controller, operation of the Switchgear motorized track system is possible through the Advanced Controller. A design constraint here is that if the Advanced Controller is unable to access the ABB local server then the browser cannot retrieve the control webpage from the server. To account for this a backup local webpage that has some features disabled are included on the Advanced Controller. A secondary constraint of the design is the situation in which the device is unable to process, display, or run the web code that the site is made in. While this is extremely unlikely to occur unless the site is being accessed through extremely outdated web browsers or no longer supported versions of Microsoft Windows.

Two possible solutions to this constraint are to include a simplified site that features older HTML only standards capable of running on legacy hardware. The issue with this solution is that it doubles maintenance work on the site, if any changes are made to the fully featured version of the site then those changes are also need to

76 be made on the fallback HTML site. The second solution seeks to remedy this somewhat by building the fallback code into the site itself, adaptively disabling/enabling advanced features depending on what is supported by the browser.

The website that is used on the Advanced Controller to operate on the Switchgear system(s) is to be built in what we are calling a “live website” style. This kind of website does not need to have its page refreshed. Due to the frequency of updates received from the local server and the Switchgear system relay a live socket on an adaptive page that can display information in real time is the most ideal. Because of the inherently dangerous nature of working on/near the Switchgear systems the need for a live feed of data and the status of the Switchgear system is important.

A website that relies on page refreshes can be more severely impacted by wireless network slowdowns, loss of connection to the network, and to slowdowns caused by the web browser itself. A live website on the other hand would maintain an open, likely encrypted, connection to the server that the website is being ran on. Wireless network slowdowns won’t impact the live website nearly as much because instead of needing to serve an entire webpage it is a small stream of packets being transferred over the network. Since the information is being served as a stream of packets it is possible to add detection for packet loss or loss of connection to the network and when such an event is detected fire off a cascade of safety features as the user could possibly no longer be in control of the system.

Other website features that could be included are user credentials to prevent unauthorized access to the control panel of the site, a modular design to allow the user to configure how the information is displayed, and quality of life features such as grouping of certain Switchgear systems. Safety features that could be included are a “checkout” style system that prevents multiple Advanced Controllers from operating on the same Switchgear system(s), an emergency stop button that halt all active commands to any Switchgear system, and audible warnings for when a high alert error appears.

The Switchgear system relay is not specifically a relay in the electrical sense, “relay” is an internal name used by ABB because the relay literally relays information back to the local server. Since the system relay is the main bridge between the local server and the control board it needs to be constantly reporting its status and ready to receive commands at any time from the server. This makes the entire hardware architecture an ideal candidate for a publisher - subscriber style system. A subscriber on the local server is listening for reports from the system relay as to the status of motorized track and publishing those to local logs and to the Advanced Controller. It is also listening for commands from the Advanced Controller. The Advanced Controller has a subscriber of its own listening for updates from the local server that are then displayed on the website page on the Advanced Controller, whenever a command is issued from the Advanced Controller it publishes the command to be sent to the local server. The system

77 relay also has a subscriber and a publisher running on it as well. The subscriber is listening for commands from the local server and runs some error checking to make sure an invalid state does not occur. The publisher for the system relay is polling the incoming ethernet connection from the control board to get a constant flow of status updates for the motorized track and publishing the status to local server.

LOCAL SERVER

Server grade levels of Microsoft Windows include a multitude of technologies that are extremely beneficial to the Web Server Architecture design. The main package that would need to be installed on the server to support this design is ‘Internet Information Services’ (IIS). The IIS package includes an entire suite of tools for Microsoft Windows for managing, configuring, and deploying a local area network website. It includes support for .NET services as well should the already deployed server make use of them. Additionally, if a separate C# application was to be developed the information stored in the database and site could be accessed due to the interaction between .NET and C#.

MAINTENANCE AND ADMINISTRATION

The management of IIS will be handled by the network administrator or the IT personnel at the site the system is deployed at. While configuration of IIS depends on the network architecture of the site it is being deployed at, the Web Server Architecture design should be backwards compatible through Microsoft Windows Server 2008. If each site’s network architecture is the same, then the entire deployment of the Web Server Architecture design on the local server could be scripted and entirely automated. If absolute consistency between sites cannot be guaranteed but they are similar enough parameters could be passed into a deployment script. With the worst-case scenario being completely unique network architectures at each site in which case the network administrator or site IT personnel will have to manually configure all the settings according to documentation.

ADVANCED CONTROLLER HARDWARE PLATFORM

With the internet of things movement in full swing and web browsers being on nearly any smart device made in the last 5 years this type of design supports that very well. Any device that can connect to the wireless access network or local access network at the site could be used to manage the Switchgear systems at the site. However, this adaptability presents a few unique scenarios that need to be accounted for.

78

WEB SERVER ARCHITECTURE USER INTERACTION FLOWCHART

FIGURE 44 USER INTERACTION FLOWCHART WITH WEB SERVER ARCHITECTURE SITE

79

LOGGING AND DIAGNOSTICS

Built into IIS is a full set of “Health and Diagnostics” tools. Enabling HTTP logging, custom logging, page request monitoring, and request tracing. This set of health and diagnostics tools allow us to collect information that is particularly 58 useful to network administrators and future maintainers of the project.

HTTP logging allows IIS to be configured to generate log entries on successful requests, failed requests, or both. While not obviously useful for this specific case, it mostly enables logging of malicious attempts at getting around user credentials by directly accessing certain pages. Since the local site where the IIS is deployed is secured more so than a public location that means the location, the information there, and control over the systems there is sensitive and some layers of security on the Advanced Controller are necessary. HTTP logging could help with digital forensics should there ever be an illegal breach of the system. Custom logging is a more applicable type of logging for the Web Server Architecture design. My defining a custom log through the IIS every action taken by the user of the Advanced Controller can been logged. Any button that is clicked, any Switchgear system that is selected but not operated on, or any details page that is viewed by the user can be logged. While given the rather small scale of deployment for the system the danger level of something going wrong or the wrong button being pressed causing a catastrophic failure of a Switchgear system is a possibility. In the event something goes catastrophically wrong a full-fledged logging system will allow the source action to be traced back to a specific action.

Additional policies and safeguards can then be put in place to mitigate the source of the failure in the future. If using user credentials, the source of the failure could also be traced back to a specific user creating accountability and additional care on the user’s part. Page request monitoring and request tracing both also fall under digital forensics and cyber security. Page request monitoring can be configured such that if a page or any information served by IIS is accessed or attempted to be retrieved without the proper credentials an alert can be sent out to the network administrator. Working in tandem with request tracing the alert can also trigger a request trace that attempts to find and log all information about the requester as possible. Being that this is a local only website that will not be accessed outside of the local network and is an entirely Microsoft Windows network ecosystem the trace should be able to find the exact computer that attempted the connection. The health and diagnostics suite of tools built into IIS offer a nice blend of digital forensics logging and system security.

COMMUNICATION PROTOCOL

Due to the nature of the Switchgear systems that the Web Server Architecture design oversees, manage, and display the status of, traditional HTTP communication between the local server and Advanced Controller is not enough to support the speed and responsiveness needed for such a system. HTTP

80 communication was designed as a means of unidirectional method of communication. However, for our use case this is an undesirable trait. The websocket communication protocol instead is designed for more modern web- based applications that require a more real-time bidirectional communications system to function properly.

FIGURE 45 NETWORK TRAFFIC FLOW CHART FOR WEB SERVER ARCHITECTURE

HTTP/HTTPS

The HTTP/HTTPS communication protocol is not an ideal solution as a means of communication for the Web Server Architecture design. Firstly, it is unidirectional meaning that the communications can only go in a single direction at a time. If the web page content on the Advanced Controller needs to be refreshed, then the user is unable to see any content and is unable to operate the page until the entire page is loaded. Even with optimizations for loading a very basic skeleton of the site to display the information to the user and allow functionality of the most important features as quickly as possible, the user cannot send information to the local web server for a period of time. This is not an acceptable behavior for a real time necessary application of web communication.

WEBSOCKET PROTOCOL

Websocket protocol is the ideal solution for the Web Server Architecture design. It allows communication from the Advanced Controller to the local server to occur at the same time it is receiving information from the local server. Being bidirectional is important because if the status of a Switchgear system changes when the user is attempting to operate on it that information needs to be displayed to the user as immediately as possible.

This constant feed of information is paramount to the safety of the operator and other personnel around the Switchgear system. The websocket communication

81 protocol is also an extremely quick communication protocol over local networks specifically. On a wired local area network the approximate round trip time for messages sent of a websocket is around 200 microseconds. The 200 microseconds is the time it takes for a packet to go from the browser’s JavaScript to the websocket server and back. This puts the round-trip times of communication over websocket protocol very close to the level of raw ICMP pings. While the wired local area network round trip times are extremely low, so are the wireless local area network. Although a magnitude higher than its wired counterparts at around 0.2 milliseconds, that is still an incredibly small amount of time considering the average human reaction time of 250 milliseconds to visual stimuli. At 2 milliseconds to send the request for information and receive it back there is almost no concern of information not being displayed to the user in a timely fashion. Along with having multiple supporting JavaScript libraries such as Socket.io and Node.js for websites and built in support with IIS Windows Server, it is highly supported and provides the performance necessary for our application. An item to note is that the websocket technology in IIS Windows Server is not compatible with Socket.io or Node.js and will need to be disabled if either of those libraries are used on the website.

NETWORKING AND SECURITY

If there is a singular network that is shared for external internet connections at the site for employees to work on and the local network that connects all the Switchgear systems, any system on that network could theoretically access the site. This presents a unique security concern. The major vulnerability is that the same network that provides access to the Switchgear systems at the site is connected to the internet. This drastically increases the risk of unauthorized access to the Web Server Architecture site regardless of the amount of security in place on the network compared to being on its own isolated local network.

A combination of MAC address filtering, IP filtering, and user credentials can substantially lower the risk of such an attack but does not mitigate the risk entirely. As such the security features should be in place before the deployment of the Web Server Architecture design. Even if the local network that the site server is attached to is not connected to the internet such security measures should be implemented to limit the number of access points to the website. Hardware, Software, and Considerations While any device with an internet browser can access most websites for an open socket live site like the one in the Web Server Architecture design not every device will be capable of this.

Not all browsers are able to maintain an open TCP connection to a web server. While mobile browsers on electronics such as tablets and smartphones have made great advancements in becoming as full featured as their x86 counterparts there are still limitations to what they’re able to do. Due to lack of features on mobile device web browsers for supporting the Web Server Architecture design this eliminates most smartphones and tablets from being compatible. However, a

82 workaround to this is to write an app for the device that uses the networking application programming interface allowing the app itself to open a TCP socket stream to the local server. A consequence to this work around is that because the app does not already exist on the market it will need to be developed. Given the market share of main mobile operating systems iOS and Android, together they make up 99.8% of the operating systems for all mobile devices, and the rate at which the parent companies of the operating systems update their ecosystem, the amount of maintenance work to maintain the app would be large. With the built-in web browser of mobile computing systems not supporting open TCP socket streams and apps designed for iOS and Android requiring at least yearly updates to support the newest application programming interface and operating system features, this makes mobile computing systems ineligible candidates for the Advanced Controller. Laptop, 2-in-1, 360, and other x86 mobile computers on the other hand can run web browsers such as Mozilla Firefox, Google Chrome, and if running Microsoft Windows, the Microsoft Edge or Internet Explorer browsers. Each of these browsers, although Microsoft Edge and Internet Explorer are somewhat limited in this capacity, can maintain an open TCP stream socket. Since Mozilla Firefox and Google Chrome are pretty much operating system agnostic and can be installed on any major operating system, including multiple distributions of Unix including Debian and Red Hat distributions, this makes them ideal for the Web Server Architecture design.

Additionally, Mozilla Firefox and Google Chrome are fully open source and a derivative of an open source project, respectively. This enables modifications to the web browser itself should it be necessary to add additional code to support features that are not currently supported in the web browser. Microsoft Edge and Internet Explorer have a few items worth noting as to why they would not make ideal candidates for the Web Server Architecture design web browser of choice. Microsoft Edge is an extremely new web browser with a small user base, approximately 2.5%, and is designed to be fully integrated with its parent operating system only. Microsoft Edge is also unavailable on any other operating system aside from consumer levels of Microsoft Windows, being unavailable even on Microsoft’s own server operating systems. Internet Explorer is approaching end of life support by Microsoft and is being phased out as of Microsoft Windows 10 in preparation for a full adoption of Microsoft Edge. As opposed to Mozilla Firefox and Google Chrome being at least partially open source, both Microsoft Edge and Internet Explorer are completely proprietary to Microsoft Corporation with closed source code. There is not a direct feature request or feedback system for Internet Explorer. Although there is a feedback and feature request system for Microsoft Edge; however, this relies completely on support of other developers and users to move forward to becoming an actual feature and the feature is still blocked by Microsoft’s allocation of development time.

Due to the closed source, proprietary, and limited operating system support of Microsoft Edge and Internet Explorer they are ineligible candidates for the Web Server Architecture design. Mozilla Firefox and Google Chrome on the other hand

83 are both completely viable options. The choice between them will be up to the site IT standards of ABB Ltd.

WEBSITE IMPLEMENTATION

The website for the Web Server Architecture design is likely the most flexible part of the design in terms of the number of ways it can be implemented. While the front end of the website lends itself to an adaptive refresh style web development language such as HTML5 or JavaScript, the backend is open to multiple development paths.

FRONT END IMPLEMENTATION

Of the number of front end web development languages out there are two that are openly capable of supporting this style of website design. Those are HTML5 and JavaScript. JavaScript is one of the most popular web development languages out there for well featured websites that can modify their design and displayed information on the fly.

With the amount of adoption JavaScript has seen and the fact that it is currently being used in some fashion on 94.8% of all websites there is no concern with maintainability or finding developers to maintain a JavaScript implementation of the front end of the Web Server Architecture design. It enables an active web page that can load information on the fly to completely change the display of the page without a full page reload. As mentioned previously this is an important factor as a delay in seeing critical error information could be deadly. JavaScript is capable of opening and managing multiple TCP stream sockets as well, theoretically allowing a single implementation of the site to serve multiple Switchgear system sites. There is also a multitude of networking stream and 63 socket libraries that are available for JavaScript, including Node.js which is one of the most popular networking libraries for JavaScript. Connected to a TCP socket stream from the IIS web server on the site’s local server the page could deliver the live data of all Switchgear systems at the site with minimal delay. Additionally, JavaScript is supported on all major platforms and web browsers.

HTML5 is the newest standard of HTML having been published by W3C just three years ago. Initially upon its release HTML5 was substantially ahead of its time only being adopted by approximately one third of the top 100 websites in the world at the time. Over the last three years however it has grown in popularity to approximately 67% of websites. Given that most websites are built out of HTML and the markup language is not going anywhere in the immediate future means its long-term maintainability is high. Finding HTML developers is also of little concern as any decent software engineer should be capable of learning both HTML and JavaScript in a relatively short amount of time should a professional web developer be unavailable. The combination of HTML5 and JavaScript make for a strong front- end system that is easily maintained by any kind of software developer. JavaScript can handle the TCP socket streams and making the user interface adaptable to 84 the information being streamed in while HTML5 offers a great skeleton for the site. An example of the graphical user interface layout is in Figure 41 below.

FIGURE 46 WEB SERVER ARCHITECTURE GRAPHICAL USER INTERFACE MOCKUP, REPRODUCED AND REPRINTED WITH PERMISSION OF ABB LTD.

BACKEND IMPLEMENTATION

While the front-end implementation is a more limited in the options that it can be implemented in because of the mass adoption of HTML and JavaScript, the backend implementation of the websocket communication protocol is more open. Interfaced directly with the IIS web server the back end of the website allows for a variety of solutions, with some being more ideal than others.

Python is capable of full stack development for web servers. However, in this case with the front end of the webpage being handled by HTML5 and JavaScript it is only needed for the back end of the webpage. Python features a few libraries and open source APIs to make creating, managing, and streaming over websockets easier. Most of these libraries and APIs support both Python 2 and 3 making them relatively flexible. Being a simpler, more popular language that is used in a wide variety of fields the concern of not being maintainable is low. While Python can interface with the web server through an API it cannot directly communicate with the IIS web server. This does create a bit of a maintainability problem as this will require the usage of either an open source or proprietary API which will either need to be updated occasionally or maintained 64 by ABB engineers. While a possible 85 language to implement the backend in, Python is not the most ideal due to being less maintainable.

JavaScript is also capable of serving the backend implementation of the website in addition to managing the user interface on the front end. Because of this JavaScript can serve as a full stack language. JavaScript features approximately the same number of networking libraries as Python but more of the libraries are open source. Having more open source libraries is a maintainability concern as open source projects that aren’t backed by a large community run the risk of becoming a dead project. Since JavaScript would be used on both the front and back end of the Web Server Architecture design it would need less developers to maintain it because one specialized developer could maintain the entire project. JavaScript, like Python can also interface with the IIS web server but only through an API and doesn’t have direct access to the server. While capable for implementing the back end of the websocket communication protocol and convenient because it’ll be used in both the front and back end of the web server, JavaScript also has maintainability issues.

C# is likely the most likely solution to create the backend implementation with. It has built-in Microsoft libraries for supporting the websocket communication protocol that we found to be the best solution. C# also can communicate directly with the IIS web server directly using the .NET framework, allowing the passing of objects such as websockets and page content between the two. In terms of debugging and developing in C# both JavaScript and Python do not contain an integrated development environment anywhere nearly as fully featured and powerful as Microsoft Visual Studio. The features in Microsoft Visual Studio allow for substantially easier debugging of both the web server and the C# backend code and can substantially reduce development and maintenance time. Although the C# libraries for network protocols and web server integration are Microsoft proprietary and could cause issues as Microsoft makes decisions related to what is and is not important in the library; it also means that it is maintained by a professional company with a full development team. With the maintenance of the libraries and APIs being done by another company for free, we believe that that offsets the downside of being Microsoft proprietary. Given C#’s compatibility with the IIS web server, .NET framework, unparalleled IDE support, and long maintainability within the Microsoft Windows ecosystem, it is by far the superior choice in language for the backend implementation of the website.

SAFETY FEATURES

The nature of operating the Switchgear systems and energizing/deenergizing the systems is a very dangerous process. Applying an instant load that is high current and high voltage can lead to dangerous situations. As such, safety features built into the Web Server Architecture are mandatory.

86

A variety of safety features can be implemented into the Web Server Architecture design rather easily. The first and base level of safety is by preventing unauthorized or untrained personnel from accessing the control page. Without access to the control page it is not possible to manipulate the motorized track unit from the Advanced Controller.

The second safety feature is a timeout trigger. After a certain amount of time has passed and the site server has not received a status update from a Switchgear system the control page will display an error message and no longer allow commands to be issued to that Switchgear system. Because each Switchgear system is addressed individually by the web server, if a Switchgear system is disabled it is not possible to send commands to it.

The third safety feature is a state machine that can determine if the command being issued is possible from the Switchgear system’s current state. Because the motorized track unit itself is unable to know what state it can and cannot enter from its current state, this must be accounted for in the software design. Since the current state of a Switchgear system is known, the Web Server Architecture will be able to display error messages and reject commands that would be invalid given the current state.

SOFTWARE DESIGN 2 – STANDALONE COMMAND APPLICATION

OVERVIEW

The Standalone Command Application is comprised of a software application that can be deployed across the Advanced Controller, ABB local server, and the Switchgear system relay. The overall architecture of the Standalone Command Application is a combination of a client server and publisher subscriber application. The client server architecture portion of the Standalone Command Application is simply to allow a change in network functionality of the application. While the publisher subscriber architecture portion of the Standalone Command Application is how the network traffic is sent and received by the applications on the network. The Standalone Command Application will feature a command parameter flag that the Standalone Command Application reads in on launch and determines if it is the server or client.

Client flagged Standalone Command Applications will run on the Advanced Controller and the Switchgear system relay. Clients flagged applications will both publish Standalone Command Application network traffic and subscribe to listen for Standalone Command Application network traffic. The client flagged applications main goal is to listen for data coming in from the server and take appropriate action based on the incoming packets. In the case of the Advanced Controller, which has access to the graphical user interface, it will display the status of all Switchgear systems on the ABB local server’s network and allow control of them. This information will come as published Standalone Command

87

Application network traffic from the ABB local server which the client flagged application is automatically subscribed to.

Using the Switchgear control panel in the graphical user interface after logging into the system with valid credentials makes the client application publish commands to the Standalone Command Application network traffic. From within the graphical user interface the user is also able to access all current errors from any Switchgear system at the site and all logs generated by the client application. For the Switchgear system relay, which does not have access to the graphical user interface and therefore is unable to log in to the Switchgear system control panel, it will receive the published Switchgear system statuses from the ABB local server but will not do anything with the received traffic. Additionally, this means that access to the error report and application logs is also not possible. Instead of looking for Switchgear system status update traffic the client flagged application running on the Switchgear system relay will be looking for published Switchgear system commands from the ABB local server.

Once a command is received the client application running on the Switchgear system relay will act as a bridge and send the command to the Control Board which then sends the command to the ABB IRS. Part of the Control Board functionality includea current monitoring of the motor inside of the ABB IRS. Because the output of the Control Board depends on the current drawn by the motor inside the ABB IRS and the client application running on the Switchgear system relay reads this output, the Standalone Command Application is able to determine when the ABB IRS is moving, stopped, or blocked. The client application running on the Switchgear system will then publish this data to the server application running on the ABB local server.

Server flagged Standalone Command Applications are intended to run on the ABB local server only. A positive side-effect of the client/server and publisher/subscriber is that the network traffic generated by the Standalone Command Application is communicated across the entire network at the Switchgear system site. Should the normal ABB local server not be available, any computer that is connected to the same network as the Switchgear systems at the site will be able to act as the server for the Standalone Command Application with a simple change of the launch parameter flag. The server flagged application will also have access to the graphical user interface should the appropriate credentials be entered and will be able to control the Switchgear systems at the site.

From the graphical user interface, the user will be able to navigate to view details about specific Switchgear systems, view any errors being generated by any of the currently connected Switchgear systems, or view the logs generated by the server application. The server flagged Standalone Command Application subscribes to two types of traffic from client applications and publishes two types of traffic to the client applications.

88

The first subscribed type of traffic that the server flagged application is listening for is command packets from the Advanced Controller. Whenever the user of the Advanced Controller issues a command through the graphical user interface a packet is sent to the network and is captured by the server flagged application. This packet is then processed, logged, and published by the server back to the network for the Switchgear system relay client flagged application.

The second subscribed type of traffic that the server flagged application is listening for is status updates from the client flagged application running on the Switchgear system relay. These Switchgear system status updates are constantly being published by any client flagged application running on a Switchgear system relay. As a result, this is the largest source of network traffic from the Standalone Command Application. When the server flagged application receives a status update packet from a Switchgear system the packet will be processed, logged, and then re-published to the network for the Advanced Controller’s client flagged application to receive.

Edit- Instead of a client application we decided to use a Django REST API running on the Raspberry Pi to serve as the “Client application” which translates all of the HTTP requests to turning pins high and low on the Raspberry Pi.

DEPLOYMENT

The Standalone Command Application causes some issues regarding the local server. Being a compiled application, the operating system of the machine the application is compiled on can affect the operating systems in which the Standalone Command Application can be deployed on. Other factors such as language dependencies, software requirements, and library linking also need to be considered.

Because deployment of a software application is easier when you don’t have to locally compile the program on your machine, the language that the software application is written in becomes important.

Languages such as C# and Java are either proprietary, in the case of C#, or require the installation and maintenance of an installed application, for Java. Overall C# and Java have some of the easiest to work in and best supported graphical user interface libraries when compared to other languages such as C++ and Python.

C++ and Python, on the other hand, are both well supported across multiple operating systems such as MacOS, Microsoft Windows, and various distributions. They both come at the cost of not having great graphical user interface support when compared to C# and Java. C# has the added benefit of direct access to the .NET framework which is heavily baked into the Microsoft Windows operating system granting it access to otherwise difficult or impossible features of Microsoft Windows. Being impractical to develop an application capable

89 of natively running on multiple operating systems without different application versions unique to each operating system, the choice needs to be narrowed down. The network architecture of ABB’s Switchgear sites shows the local server as simply being a x86 Embedded Server; however, ABB has confirmed that Microsoft Windows Server is installed. Because of this, C# becomes the obvious choice for deployment purposes.

Now that Microsoft Windows Server has been established as the operating system being ran on the local server and C# is the language of choice for deployment; the issues of language dependencies, software requirements, and library linking become less of a problem. Language dependencies are not an issue because C# runs natively on Microsoft Windows operating systems, no additional software such as Java need to be installed, and libraries can remain fully dynamically linked.

ADVANCED CONTROLLER HARDWARE PLATFORM

The hardware platform that can serve as the Advanced Controller is limited for the Standalone Command Application. This is because for deployment purposes it must be able to run a recent version of the Microsoft Windows operating system. Because of this requirement the hardware specifications of the Advanced Controller must at least meet the minimum requirements of the version of Microsoft Windows being ran on the hardware platform. However, there is a positive side-effect to this requirement. Nearly all laptop, 2 in 1, and tablet computers that run a fully featured version of Microsoft Windows include wireless network connectivity, a requirement specification of the Advanced Controller. Although, there is one more requirement specification that needs to be considered. This is the requirement of an RJ45 ethernet port on the Advanced Controller to allow the Advanced Controller to still control the ABB IRS in the event the local server is down. For the most part this removes the majority of 2 in 1, ultrabooks, and tablet computers from consideration as they lack a RJ45 ethernet port. This means that the hardware platform for the Advanced Controller that is running the Standalone Command Application can be any modern laptop computer running a fully featured version of Microsoft Windows.

90

STANDALONE COMMAND APPLICATION USER INTERACTION FLOWCHART

FIGURE 47 USER INTERACTION FLOWCHART WITH STANDALONE COMMAND APPLICATION

COMMAND APPLICATION IMPLEMENTATION

Being a compiled program, the Standalone Command Application’s front end and back end will be included in the same set of source code. This means it is necessary to find a programming language that is capable of writing both a front end graphical user interface and backend networking code. As discussed previously, being able to easily deploy the Standalone Command Application onto multiple systems is an important factor as well. Additionally, long term

91 considerations such as maintainability, upgradability, and end of life time for the current version of the programming language are important.

PROGRAMMING LANGUAGE

Most modern and featured programming languages can produce a front end graphical user interface and back end networking code. However, some programming languages do it measurably better and easier than others.

C++ for instance is an extremely efficient and lean programming language when it comes to implementing back end networking code. But without 3rd party library support implementing a front end graphical user interface in it is an extremely cumbersome process as there is no standard library support for graphical user interfaces. Additionally, the entire C++ standard library is not included by default on installations of Microsoft Windows operating systems, both server and consumer versions. This would require the pre-requisite installation of the required C++ libraries or deploying the Standalone Command Application with the libraries included, creating a maintainability and upgradability problem. The C programming language also falls into all the above issues with even less built in support for both networking and graphical user interfaces.

Java is a capable language with standard libraries for both networking and graphical user interfaces. The main Java libraries that are built in for networking and graphical user interfaces are Java.net and JavaFX, respectively. Java.net has support for all the networking features that are necessary for our purposes. Likewise, JavaFX can be used to make graphical user interfaces quite handily. While using a featured integrated development environment allows for visual testing and live feedback of interface changes making interface development a relatively quick and easy. Where Java suffers though, is with the requirement of having Java (the software application) installed on the machine the Java program is running on. In the past many Java versions have had large security issues causing that version to be immediately deprecated and to be no longer recommended as a valid Java version. This creates maintainability and upgradability problems like that of C++ and C, discussed above. However, if the maintainability and upgradability issues are not a concern then Java is one of the top languages for the Standalone Command Application.

Python is one of the best programs for implementing networking code and has been used across many servers and networked applications. It features fantastic standard library support for networking code and is one of the most concise languages for any networking project. This makes developing the back-end implementation easier as it will be handling all the network traffic using a language that excels at doing just that. Python also features a standard graphical user interface library called Tkinter. While it is in the standard Python libraries included when Python is installed on the machine, it is not particularly featured enough to serve the real-time interface requirement of the Standalone Command Application.

92

Displaying all the information needed in real time and in a readable format would be more difficult than necessary using the Tkinter library. This makes Python an option for the Standalone Command Application but not a top choice.

This brings forward the final programming language under consideration for implementing both the front-end and back-end of the Standalone Command Application, C#. Previously discussed in the Deployment section, C# was the most ideal programming language for deployment purposes. This is because the overall system environment is running some grade of Microsoft Windows, the native and only operating system that supports C#. The limitation of C# only being supported by Microsoft Windows is offset by the deep integration of C# and the .NET framework. This level of integration allows C# to actively create, manage, and monitor .NET objects. Through .NET it is possible to gain access to both the graphical user interface and the network programming libraries. Since C# works so closely with both the operating system and .NET, it can leverage the already installed libraries built into the operating system. Since the libraries are already built into the operating system there are minimal maintainability and upgradability concerns. The only concern in terms of maintainability and upgradability would be that Microsoft controls the entirety of the C# language. As such, in the event Microsoft was to deprecate a library and replace it with a new one then some maintenance would need to be done to the application. This concern is lessened however by the fact that Microsoft does not immediately end support for libraries it deprecates. They simply issue an end of life date for the library, allowing developers to update their existing code to the newer library should they choose. Because of the strong integration between C#, .NET, and Microsoft Windows, the immediate access to pre-installed libraries for both the graphical user interface and networking, the great integrated development environment provided by Microsoft Visual Studio, and the minimal maintainability and upgradability concerns. C# is the best overall programming language for implementing the Standalone Command Application.

FRONT-END IMPLEMENTATION

Being that C# is the chosen programming language for the Standalone Command Application, a front-end user interface stack must be selected. Microsoft offers two user interface libraries standard with C# and .NET. These are the .NET Windows Presentation Foundation and the .NET Windows Forms. The .NET Windows Presentation Foundation is the most recent user interface stack offered by Microsoft for C#/.NET developers making desktop applications. Its features are more geared towards modern Microsoft Windows design of Microsoft Windows 7 and newer, offering visual capabilities such as transparency and reflection. The .NET Windows Presentation Foundation is a technology designed for Windows based desktop applications that require user interface complexity, styles customization, and graphics intensive scenarios for the desktop. It also allows developers to take advantage of XAML views and gain access to the asynchronous capabilities of .NET 4.5 and newer. The access to the asynchronous

93 technology within .NET 4.5 and newer is important for the Standalone Command Application.

One of the reasons that a separate software application is being considered over the Web Server Architecture is because the application does not rely on the visuals of the graphical user interface being delivered over the network. Because all the graphical user interface elements are on the local machine they only need to be retrieved from the local storage drive and the only information that needs to be retrieved from the network is the raw data values to display. This separates the work between the network interface and the local machine. By moving the graphical user interface from the web server to the local machine and taking advantage of the asynchronous technology of .NET 4.5+, only the parts of the graphical user interface that need to be changed when information is received will need to be reloaded. This substantially decreases the amount of work necessary to reload the graphical user interface on a page change because elements that are consistent throughout each page of the application will not need to be loaded again. XAML allows for rapid graphical user interface development by using a syntax closer to that of XML and HTML instead of library functions, although C# library functions can still operate on XAML objects. In terms of maintainability and upgradability, the .NET Windows Presentation Foundation is the newest user interface stack for C# and .NET. It is designed so that it can easily interact with other means of application delivery such as Windows Store and Windows Phone. This makes it a heavily invested user interface stack that is intended to scale far into the future as Microsoft continues to merge their various software platforms.

.NET Windows Forms on the other hand, is a much older user interface stack. It was first introduced back with Microsoft Windows XP and as a result lacks many of the newer user interface features that .NET Windows Presentation Foundation has such as transparency and the asynchronous technology. While an older user interface stack, .NET Windows Forms is still very applicable for internal business applications that do not require an advanced user interface. In the simpler situations that .NET Windows Forms is intended to be used in, it is faster and lighter weight than .NET Windows Presentation Foundation. XAML is not support in .NET Windows Forms, slowing graphical user interface development due to the increased complexity of implementation. In addition, the lack of XAML support prevents the extension of the graphical user interface to other Microsoft Windows platforms such as Windows Phone or the Windows Store. To do so would require a complete re-write of the interface.

Because of the newer interface designs, asynchronous capabilities of .NET 4.5+ accessible, XAML support, and increased maintainability and upgradability the user interface stack of choice is .NET Windows Presentation Foundation for the Standalone Command Application. While it is possible to implement the Standalone Command Application in .NET Windows Forms, it is an older user interface stack, with less features, and requires a more complicated implementation to achieve the same features as .NET Windows Presentation

94

Foundation. An example of the graphical user interface layout is in Figure 40 below.

FIGURE 48 STANDALONE COMMAND APPLICATION GRAPHICAL USER INTERFACE MOCKUP, REPRODUCED AND REPRINTED WITH PERMISSION OF ABB LTD.

BACK-END IMPLEMENTATION

As C# is the programming language of choice for both deployment purposes and overall capabilities necessary for the Standalone Command Application, research must be done into the available frameworks for network programming. Unlike in the front-end implementation where there are two frameworks available, there is a singular framework for C# called System.net. System.net is a namespace built into C# that can handle many network communication types such as websockets, peer- to-peer, and MIME in addition to possessing the functionality for a developer to define their own networking implementation.

For the purposes of the Standalone Command Application most of the back-end implementation will come from the System.Net.Websockets namespace. This namespace gives access to creating, configuring, and communicating websockets. Alternatively, there is a secondary socket namespace included in the System.Net namespace, System.Net.Sockets. Functionally identical to the Websockets namespace, the Sockets namespace also features security features and tighter control over the network and communication over it. Being functionally identical to Websockets and providing additional security simply built into the 95 namespace makes it the most ideal namespace to use for the back-end implementation of the Standalone Command Application. Below in Figure 41 is a diagram of the network traffic flow for the Standalone Command Application.

FIGURE 49 NETWORK TRAFFIC FLOW CHART FOR THE STANDALONE COMMAND APPLICATION

LOGGING

Any modern programming language is capable of file input and output, making logging for the Standalone Command Application completely agnostic of the programming language used to write the application. As much data as practical will be logged by the application. This includes user logins, both successful and failed, all commands issued from the Advanced Controller, and all errors generated by any of the Switchgear systems. As a base the date, time, and the source of the log entry will be recorded for any log entry. Any additional information will be specific to the log the entry is being written to.

Logging user login attempts is a necessity for security purposes. While it does not contain much information related to the individual, that information is not practically obtainable without additional security measures. Logging login attempts also shows possible points of vulnerability because if login attempts were made under a specific username or a username that is not valid, then the network administrators will be able to find where the attempts were made and report the issue appropriately.

Logging all commands issued by the Advanced Controller is necessary for responsibility and accountability. If something goes wrong with one of the Switchgear systems, then the source of the command needs to be traceable back to the user who issued it. While there are protections in the Standalone Command Application that prevent invalid commands from being issued, such as racking in the ABB IRS when the circuit breaker is already seated, it isn’t possible to stop someone from doing the wrong thing at the wrong time. Ignoring malicious intent to do harm to another individual, if a user energized or discharges a Switchgear 96 system at the wrong time it can cause wide reaching and catastrophic failures. When logging the command issued, all base logging information will be recorded and in addition the user whom issued the command, the command being issued, and the Switchgear system(s) the command was being sent to will also be recorded.

Logging all errors generated by any of the Switchgear systems at the site is also necessary. If something goes wrong with one of the Switchgear systems, even temporarily, that could be a sign that additional issues may occur or that the system could fail soon. Since Switchgear systems are designed so that they can run 24/7 for periods of time spanning decades, anything that causes an issue to occur becomes a possible point of failure. System failures or catastrophic failures can possibly have a cascading effect on the other Switchgear systems at the site running the risk of causing multiple system failures because of a single error on one system. While normally accounted for in the design of the Switchgear site itself and the number of Switchgear systems present at the site, losing even one Switchgear system could bring down whatever the site is powering. To help avoid this, logging all errors generated by Switchgear systems allows the site workers to monitor errors from the systems that occur even when the Advanced Controller or server are not being actively monitored or used.

MAINTENANCE AND ADMINISTRATION

The management of the Standalone Command Application will be handled by software developers that are proficient in C#. Since the networking, graphical user interface, and structural code would be programmed in C# using built in libraries documentation for the code used in the Standalone Command Application is readily available through Microsoft’s website. With the Standalone Command Application being a compiled application there is very little administration to be done. Whereas with the Web Server Architecture there is a web server on the site server to be maintained, upgraded, and patched, the Standalone Command Application would not need a specific individual to act as the administrator of the application. A single software developer or a team of software developers would be able to passively maintain the application. Additionally, since the configuration of the application is dependent on the network itself more than the configuration of a web server deployment of the Standalone Command Application is agnostic of the site’s network architecture. All network configuration could be done inside the application to specify which machines will receive the network traffic from the Standalone Command Application or skip network configuration and just configure the address of the machine the Standalone Command Application is running on.

COMMUNICATION PROTOCOL

Due to the nature of the Switchgear systems that the Standalone Command Application will oversee, manage, and display the status of, the speed and reliability of the network communication for the Standalone Command Application

97 is imperative. C# processes HTTP based libraries that allow an application to act as a web page of sorts regarding network communication, it will not support the speed and responsiveness needed for such a system. HTTP communication was designed as a means of unidirectional communication. However, for our use case this is an undesirable trait. A constant stream of networking traffic and a more real- time bidirectional communications system is needed.

FIGURE 50 NETWORK TRAFFIC FLOW CHART FOR THE STANDALONE COMMAND APPLICATION

TCP OVER A WEBSOCKET

TCP over a websocket is the ideal solution for the Standalone Command Application. It allows communication from the client application running on the Advanced Controller to the site server running the server application to occur at the same time it is receiving information from the site server. Allowing bidirectional communication is important because the status of a Switchgear system changes when the user is attempting to operate on it that information needs to be displayed to the user as immediately as possible.

This constant feed of information is paramount to the safety of the operator and other personnel around the Switchgear system. Using TCP over a websocket is also an extremely quick communication protocol over local networks specifically. On a wired local area network the approximate round trip time for messages sent through a websocket is around 200 microseconds. 200 microseconds is the total time it takes for a packet to go from the sender to the recipient and back. These are extremely low round trip times and are comparable to the speed of an ICMP ping. Although the speed is measurably slower, wireless speeds are still far faster than human reaction times, at approximately 2 milliseconds. The average human reaction time is around 250 milliseconds when reacting to visual stimuli. Due to this difference there is almost no concern that information needed by the operator will not arrive in a timely fashion. The capabilities of opening a websocket and communicating network traffic using TCP is built into C# under standard networking library provided by Microsoft.

98

NETWORKING AND SECURITY

The security level of an application is higher than that of a web server. A web server, and thus the Web Server Architecture, can be accessed by anyone that has access to the network that it is being ran on. This includes malicious individuals that gain access to that network from the outside. An application on the other hand that communicates over a specific port, to specific IP addresses, and uses encrypted packets is substantially more secure. Physical or remote access to the computer systems that the Standalone Command Application are running on is required to gain any kind of control over the Switchgear systems. Even with access to the computer system that the Standalone Command Application is running on, the malicious individual will still need to have valid credentials to gain control. This increases the security of the Standalone Command Application when compared to the Web Server Architecture solution. Those are both security levels that are built into the Standalone Command Application, any additional security levels such as MAC address and IP filtering will further increase security of the application. In an internal only network situation, the base level of security offered by the Standalone Command Application will be increased further.

SAFETY FEATURES

The nature of operating Switchgear systems and energizing/deenergizing them is a very dangerous process. Applying an instant load that is high current and high voltage can lead to dangerous situations. As such, safety features built into the Standalone Command Application are mandatory.

A variety of safety features can be implemented into the Standalone Command Application rather easily. The first of which is user credentials, doubling as a security feature, user credentials not only prevent unauthorized users from controlling the application, but they prevent untrained personnel from controlling the application.

The second safety feature is a timeout trigger. After a certain number of packets have not received by the application from a particular source application, the Standalone Command Application can automatically trigger an emergency stop on whatever command is currently running. This prevents the case where the operator is attempting to issue a command to a Switchgear system and the site server is not able to communicate the command to the Switchgear system. Because the System does not receive a command or a connection status from the site server the client application running on the Switchgear system knows to stop the currently operating command and return to the previous state. This make the site server running the server application a requirement in the Software Command Application software design.

The third safety feature is a state machine that can determine if the command being issued is possible from the Switchgear system’s current state. Because the

99 motorized track unit itself is unable to know what state it can and cannot enter to from its current state, this must be accounted for in the software design. Since the current state of a Switchgear system is known, the Standalone Command Application will be able to display error messages and reject the command should it be invalid given the current state. This prevents disasters from occurring due to placing the circuit breaker into an invalid position or one it should not go into.

SOFTWARE DESIGN SELECTION

As discussed in the Software Design 1 and Software Design 2 sections above, each design has its pros and cons. They both can be equally secure; however, the Standalone Command Application is inherently more secure due to the not being accessible by systems not running the application. The Standalone Command Application can be written and maintained by a single developer whereas the Web Server Architecture requires a web developer and a network administrator to be fully managed and maintained. Both can be written in C#; however, the Standalone Command Application can be written entirely in C# and does not require any additional software or technologies to be implemented unlike the Web Server Architecture. Both the Standalone Command Application and the Web Server Architecture are unlikely to encounter any issues with features being deprecated as backwards compatibility is generally maintained well with Microsoft products. Logging is more well built into the Web Server Architecture as a standard feature that does not need to be implemented, whereas the Standalone Command Application needs it to be implemented fully. Both offer similar network reliability and speed measurements and are implemented over the same network communication protocols.

With the overall favor for maintainability, security, and development requirements leaning towards the Standalone Command Application, it comes out on top as the most ideal implementation for the Advanced Controller’s software component.

SOFTWARE DELIVERABLES

OVERVIEW

The project sponsor, ABB Ltd., requested a prototype of the Advanced Controller software that works as a proof of concept in a simulated environment. In addition to the prototype the sponsor requested that research into a production implementation for the Advanced Controller software be completed along with two software designs. The two software designs are researched and discussed in the Web Server Architecture and Standalone Command Application sections of this document.

100

SIMULATED ENVIRONMENT

The simulated environment we’re going to be developing for the prototype consists of two computer systems and a microcontroller running on the same local network. The main computer system that will be representing the Advanced Controller is computer running Microsoft Windows 10, this is because most new computers that are purchased today come with Microsoft Windows 10 as their pre-installed operating system. The second computer system will be representing the site server, it will be running Microsoft Windows Server 2016. This is the operating system that is running on the production site server and gives the most realistic operating system environment as we’re unable to get access to the actual server. The microcontroller will be running a distribution of Linux.

The network that the three systems will be deployed on is a local area network. Because the communication between the deployed Standalone Command Application is done through a websocket, whether the local area network is wireless, wired, or a combination of the two will not matter. There will be a constant stream of network traffic between all three systems but on a local area network bandwidth concerns are minimal even with consumer level routers and switches.

The computer system representing the Advanced Controller will be running a client flagged version of the Standalone Command Application. Once user credentials are provided this system will be able to send commands to the server, view the status of the Switchgear system(s), view and manage application logs, and view the configurations of the various Switchgear system components. The client flagged version of the Standalone Command Application when it is not logged in will still be looking to receive network traffic from the server application. If traffic from the server is not being received, then all controls and statuses of the Switchgear systems that were last displayed on the application will display no information and be disabled. Once information is being received from the server again the fields will auto-populate and re-enable themselves once the full connection is stabled.

The computer system representing the site server will be running a server flagged version of the Standalone Command Application. As a redundancy measure, the server flagged version of the Standalone Command Application will be able to send commands to the Switchgear system(s), view and manage application logs, view the status of the Switchgear system(s), and view the configurations of the various Switchgear system components. The server will pass commands received from the Advanced Controller to the microcontroller representing the Switchgear, read the status of the Switchgear simulator running on the microcontroller, pass the status of the Switchgear simulator to the Advanced Controller, and log all updates and errors that occur.

The microcontroller representing the Switchgear system will be running a Switchgear simulator. The Simulator will be a simple program that holds a state,

101 can generate certain error conditions, and represent multiple Switchgear systems in various bank configurations. It will respond to incoming commands from the server and report its state back to the server.

102

APPENDIX

APPENDIX A – LOGIC SCHEMATIC

FIGURE 51 FULL LOGIC SCHEMATIC OF THE EMULATOR BOARD

103

APPENDIX B – FULL ELECTRICAL SCHEMATIC

FIGURE 52 FULL ELECTRICAL SCHEMATIC

104

APPENDIX C – FULL PCB DESIGN

FIGURE 53 FULL PCB DESIGN

APPENDIX D – PERMISSIONS TO USE PROTECTED CONTENT

Stored in the following PDF: https://drive.google.com/file/d/0B5CXOJ- b6M31LXlESFY2ZVhPWjg/view?usp=sharing

Includes permission to use the ABB Ltd. Logo, screenshots from the ABB provided video, and ABB name.

105