Francis Mahony https://mahony.tech Discovery Requires Experimentation - Daniel Whitehall Sun, 03 Oct 2021 04:25:29 +0000 en-US hourly 1 https://wordpress.org/?v=6.7 Networking Basics – OSI Model https://mahony.tech/networking-basics-osi-model/ https://mahony.tech/networking-basics-osi-model/#respond Mon, 06 Sep 2021 03:15:55 +0000 https://mahony.tech/?p=560 Read More »Networking Basics – OSI Model]]> Unless you’ve been living under a rock for the last 20 years, it should come at no surprise that the world has becomes more and more connected! Everything is smart this, smart that, cloud, buzzwords…ahhhhhhh! This connected world means connected systems in the building space, new expectations, and new skills to learn!

You might be thinking, “I’m not in IT, why do I need to learn networking”? Well, let me tell you why.

If you’re even tangentially involved with building automation systems (BAS), there’s something to be gained by better understanding how networks work. This obviously pertains to the people installing the BAS and those integrating with them, but it also extends to commissioning agents, and operators who simply want to access the BAS. The great thing is that the fundamentals you learn extend beyond BAS and can be applied to your home and cloud connected systems.

There are many complicated things in life that get boiled down to a model. It’s important to remember that a model isn’t exact, but a simplified representation of what is being modeled. At times, the line between models layers can be blurry, so focus on understanding the major concepts that these layers attempt to separate and don’t get stuck on the minor details (at least not now). We’re trying to gain a high level understanding of network communication, the problems that need to be solved, and not picking a side in an online holy war.

For networking we have two models: 1) The 7 Layer OSI Model and 2) the 4 Layer TCP/IP Model. The TCP/IP model is a simplified model that for most people is of sufficient complexity to explain networking. However, I’ll be using the 7 layer OSI model as the separation of roles and concepts will be important as we’re getting into the nitty gritty of networks and not just plugging in a network cable and hoping for internet magic to happen.

https://en.wikipedia.org/wiki/OSI_model

Above, is a nice summary table of the OSI model from Wikipedia. We’ll start from the bottom and explain it with BAS examples. If you’re a control contractor/systems integrator or someone responsible for the physical networking, then you’re going to want to pay extra attention to the bottom four layers of the model which are the focus of this post.

Layer 1 – Physical

As the name implies, the physical layer has to do with physical interfaces and specifications of your network. The main thing to keep in mind, is that this has to do with the transmission of raw bits over a medium. If I have two devices directly connected, how is information communicated? Digital signals are transmitted as zeros and ones. There’s either enough voltage on the line to be interpreted as one or the lack of voltage is interpreted as a zero. This lays down the infrastructure for doing so. We’re not necessarily concerned with where the signals need to go or making sense of the message (that’s the responsibility of other layers), but just making sure electrical signals get from A to B. This includes your cable, the connectors on the ends, and the sockets they go into. For a network of computers we’re talking about things like CAT-5E/6A, the RJ-45 connectors, and the physical aspect of network cards. In a BAS system, this is your RS/EIA-485/232 specifications that govern the drivers and receivers of your serial networks (i.e. BACnet MSTP).

This also includes the concept of half-duplex vs. full-duplex. If you think of wires as a highway of electrons, it makes sense that there needs to be some order for electrons to can get from source to destination reliably and without crashing. Half-duplex means that when two devices are connected, only one can speak at a time. If you have a single piece of copper connecting two devices, it makes sense that only one of the devices can put voltage on the line at a time without there being an electron “car wreck”. The protocol most of us are familiar with is BACnet MSTP which uses two copper wires to get a voltage difference to determine ones and zeros. This physical limitation in the protocol results in half-duplex communication as only one BACnet master device can speak at a time. Conversely, “ethernet cables” have multiple pairs of copper, dedicated transmitting and receiving cables, and allows for bi-directional communication.

Hubs are layer 1 devices. They receive messages on one of their ports and “broadcast” that message on all of their remaining ports indiscriminately. As you can imagine this is incredibly inefficient. Physical data lines are kept busy with messages that may or not be meant for the device on its port. This problem is addressed at the next layer.

Layer 2 – Data Link

Our next layer is the data link layer. In the previous layer we focused on two devices, directly connected, and sending raw bits to each other. In this next layer we need to solve the problem of communicating to devices that are on the same local network but not directly connected to each other. If you are sending files across your network at home, this is exactly what we’re speaking of.

With more than two devices, addressing becomes a thing. You can’t rely on sending a bit down the line and know that it’s going to exactly where you need it to go. If you’re in a small apartment complex, you still need a way to uniquely identify apartments even if it’s as simple as an apartment number. In the layer 2 world, we have the MAC address. The MAC address comes from the factory and is unique to each network interfacing port. If you have an ethernet port and a WiFi card, they will have different MAC addresses.

The layer 2 equivalent of the Hub is the network switch. A switch is a more sophisticated hub that allows for greater speeds by not sending duplicate messages to devices that don’t need it. It does this by maintaining a MAC address table. Effectively this is a lookup table. The network switch is able to interrogate the network and create a table with one column containing the MAC address of devices on the network and the second column saying what port the message should go out of to get to that MAC address. So when you send an ethernet frame containing your message and the MAC address of where your message needs to go, the network switch(es) check their MAC address table and send the message out the proper port(s).

Let’s bring this back to the BAS. It should be no surprise that BAS network architecture significantly lags their commercial counterpart. However, it’s important to understand the problems being solved and the common techniques being used by each.

Your BACnet MSTP bus (and any of your serial buses) combine concepts from Layer 1 and Layer 2. Your MSTP wire is “dasiy-chained”, so the red wire one side of the network bus is electrically connected to the red wire at the end of the bus. Same thing with the black wire. If you think to the above scenario, that means that this has to be half-duplex communication as when any one device talks, it ends up hogging the line until it hangs up. This communication is largely Layer 1 as there is no switch directing traffic, however the concept of a MAC address does exist. A MAC address in the network world is a Layer 2 concept. So while we’re blasting the entire network bus with a common message, only the device with the MAC address corresponding to the message will act on on it.

Before ending this section, Layer 2 communication is not confined to serial buses. BACnet ethernet, while quite rare in modern deployments, is still a thing. Multiple BACnet devices with ethernet ports can communicate to each other without dedicated IP addresses. They simply send messages address to each other’s MAC address and allow the network switch(es) to make the proper decisions to get the message to their destinations.

Layer 3 – Network

The network layer addresses the next logical problem… how do I get messages outside of my network? Layer 1 addressed how two devices physically connected can communicate. Layer 2 provided an addressing scheme to allow devices on a local network to communicate. Layer 3 will allow a device from one network to communicate with a device on another network. This layer introduces the concept of IP addresses and routing.

While a MAC address is a physical address assigned from the factory, an IP address is a logical construct. You can change the IP address assigned to a network interface very easily. You can even assign multiple IP addresses to a single interface. IP addresses need only be unique within their network. You and I can both have the same IP address scheme within our homes as our homes are on separate networks. We won’t cover the concept of NAT here but the ability to logically assign addresses is key to how modern systems are maintained.

Routers perform a similar role as switches, but now between networks and with IP addresses. They do this by maintaining an ARP table. ARP stands for address resolution protocol and is beyond the scope of what we’re trying to cover. However, at a high level ARP is another lookup table containing the MAC address of devices and their IP addresses.

One of the key decisions made by your computer is determining if an address is local or on a different network. If it’s local, then it will send it locally and allow switches to get the message where it needs to go. If it’s not local, then it send the message to the default gateway (i.e. the router). The router is then in charge of “routing” the message to other routers until it gets to the network containing the destination at which point layer 2 protocols are responsible for getting it the rest of the way. In the mail example, when the IP addresses is not in your apartment complex, you take it to the post office with a detailed address and through their sophisticated network it gets to it’s destination.

Bringing this back to building automation, these are where most of your higher level protocols reside. Your BACnet IP, Modbus TCP/IP, Niagara’s Fox Protocol, etc. BACnet IP is a bit special in that it’s not routable in the typical sense and if you want devices to communicate, they should be on the same VLAN. We’ll touch upon a bit in the next layer but the rabbit holes are deep and plenty and we have a lot to cover, so onward we go!

Layer 4- Transport

In layer 4 we now move away from the addressing side of networking and onto establishing a connection and make the magic happen! There are two big details that happen at this level as far aw we’re concerned; 1) Ports and 2) TCP vs. UDP.

Okay, I fibbed a bit about addressing being over. If your IP addressing contains all the information for your buddy to send a parcel to your home, the port is the recipient of the parcel. Computers are complicated devices that are providing or utilizing multiple web services at any given time. If your computer is running a web site, a BAS software with a web server, an analytics web server, a reverse proxy server, and so on and so forth, you need to make sure they’re running on different ports. If I want to go to your analytics service, then I need to uniquely identify the service I wish to speak to with the port number. It’s very much akin to going to one of those office buildings with multiple small businesses sharing a space and saying I want to speak to Business A who are in Room 80 to differentiate from all the other businesses cohabitating the same address.

Those most popular ports are 80/443 which which are the default ports for http/s. Most web services run on these ports by default. If you want to run multiple web services, you’ll need to assign them to different ports. Ports are noted by a colon after the ip address followed by the port number. For example, 127.0.0.1:81. When you put an ip address or website name in your browser it defaults to 80/443 because that’s what’s expected. BACnet, Modbus, Fox(s), all have default ports for their communication.

The second major concept handled at this layer is TCP vs. UDP. The acronym names don’t really matter as much as their philosophical differences. UDP is a “connectionless” protocol. It’s “fire and forget”. If I’m the quarterback throwing bombs to my receiver, I don’t wait to see if he caught the ball, I just keep bombing away. As you can imagine, there’s very little overhead here and I can get a lot of footballs thrown but not necessarily caught.

TCP is a “connection-oriented” protocol. It is used for reliability, where it is very important that the message gets to the recipient before you make the next throw. If the message fails to be received, you go back and do it again. This has quite a bit of overhead as you can imagine, especially compared to UDP but it is how the bulk of our communication is handled. TCP has something called the “3-way TCP handshake” that is used to initiate a session. Once again, we will resist the urge to go down this rabbit hole and move on. But very quickly, BACnet is UDP and relies heavily on broadcasts which can not leave the network. Protocols like Niagara’s Fox(s) is TCP and better suited for routing and to be used across larger networks.

Conclusion

In summary, the bottom four layers of the OSI model are fundamental to data communication. These layers cover how we physically interconnect systems, address senders/recipients, and get messages from one to the other. Most troubleshooting in the BAS/system integration world occurs at these layers. Whether it’s in a new cable run (i.e. CAT-6A or MSTP cabling), setting up a new network, or integrating systems, understanding these layers of the OSI model greatly improved your ability to determine the problem and ideally the solution!

We’ll keep layers 5-7 for another day… while important, unless you’re a developer, there’s just a lot less troubleshooting and problem solving ability you will gain from this knowledge.

]]>
https://mahony.tech/networking-basics-osi-model/feed/ 0
Energy Engineering – Planning Phase https://mahony.tech/energy-engineering-planning-phase/ https://mahony.tech/energy-engineering-planning-phase/#respond Mon, 06 Sep 2021 03:04:36 +0000 https://mahony.tech/?p=328 Read More »Energy Engineering – Planning Phase]]> “Success is where preparation and opportunity meet.” – Bobby Unser

Whether you’re a young energy engineer being thrown into your first energy audit or an experienced retro-commissioning (RCx) agent moving on to your next building, the planning phase doesn’t become any less important.

While the specifics of every project differ, we will consider the Planning Phase everything prior to the main site visit/audit/testing. Want to give your project manager a heart attack? Tell him you need to make another trip to get some nameplate data? Then when you come back tell him you need to go back out because you didn’t get all the photos you needed? Then when the report deadline is coming up and you’re in the middle of your investigation report, tell him there are trends missing and it’ll take two more trips and two weeks of delays to collect the data.

This site work is most likely going to be the most expensive part of the project… and oh can it get expensive. Every site visit regardless of the work to be done, has down time traveling to site, walking from location to location, waiting to check in/meet your escort, in addition to any travel costs. A small mishap leading to an additional site visit is at minimum a half-day wasted. So plan right if you want to come in on budget.

Engineering also suffers with poor planning. Nothing is more embarrassing than proposing an energy conservation measure (ECM) and being told that they’re already doing it, scoping a measure and finding out it can’t be implemented, or being called on the ridiculousness of the listed savings. Your reputation is your brand. So plan if you want a long successful career as an engineer.

Hopefully that’s enough to get you motivated. With that out of the way let’s get on to what you can do to crush the planning phase.

Step 1 – It’s a Business

It should be no surprise but sometimes we need to remind ourselves that we’re all working to make a living. This includes yourself, your coworkers, and your client(s). So before we get to the engineering let’s talk business. Below are three of the most important items you should be crystal clear on.

  • Contract – Scope of Work and Budget
  • Client’s Goal(s)
  • Your business’ strategic objective

EVERYONE needs to read the contract. If you have a part in the project… read the contract. The scope of work (SoW) contains the task to be performed and deliverables to be submitted to receive payment. The scope of work is literally your contractual obligation. Your opinion of what an energy audit is or what RCx covers means nothing when the client points to a line in the scope of work as a reason to withhold payment. While you might not be responsible for the budget (you have a separate project manager), it’s important to understand the expected effort. Effort in this sense doesn’t mean how hard you work but how many hours are allotted to the tasks you’re responsible for. Remember, it’s a business… don’t be the engineer that dies on the hill of over-engineering and blows every budget and misses every deadline… trust me… that bravado gets old. That doesn’t mean to stay quiet if you think the budget is unreasonable. Conversations happen that you might not be in the loop on or you might misinterpret the scope. If not, at the end of the day, the numbers don’t like, and it’s best for this information to come to light when something can still be done about it.

While having the scope of work on your side is great in a battle of lawyers, it’s best to never get to this point. Acquiring new clients is very expensive and its good business to grow these relationships. While one of your PM’s primary goal is managing client expectations, you as the designated engineer have a large role to play. Most project don’t exist in a vacuum. Your project might be one step in a large corporate initiative for your client. Knowing how your client wants the next phase to start will be a guiding light on how your current project should end.

As we just discussed, new clients are expensive. The period from initial introduction to first contract in our industry is almost always greater than 6 months and in my experience, closer to 18-24 months on average. During this period, dozens and dozens of hours are spent writing emails, making phone calls, presenting, understanding the client’s needs, writing proposals, following-up, and eventually (hopefully) getting a signed contract. This doesn’t include the majority of opportunities that don’t turn in to contracts. Bouncing from a one-off project to the next one-off project, isn’t a sound strategy. If your business is willing to invest in a client, it’s usually because they see a longer term partnership/opportunity. Maybe their site needs a lot of help and your business development team is eyeing these follow-up projects. Maybe the client has several sites and this is the pilot for a larger rollout. Or maybe it simply is a resource utilization filler or project for junior staff to gain experience on. Whatever the case, you should know the larger picture and what’s at stake.

Step 2 – Document Collection

Now that we know our contract and have perspective on the project, let’s move on to the engineering… well sort of. Remember, site visits are expensive. The goal of the planning phase is to solidify the task to be performed in the investigation phase (i.e. what equipment am I going to visit, what test am I going to perform, what points am I going to trend, etc.). One of the best ways to do this is by reviewing documents and having a theoretical understanding of the site before ever stepping foot on site. Your client isn’t going to know what you need so you’ll need to provide a request-for-information (RFI). RFIs are a formal request for additional information. While it’s not uncommon to provide this in the body of an email, a word document, or PDF, I highly recommend creating an easy to use and understand excel document for your client. Your client has a full-time job and is weaving you into their busy day. Help them help you. Also, you will almost never receive all your requested documents on the first go round. An excel document functions much better as a tracker. So without further ado, here’s what to ask for:

  • Drawings
    • Mechanical
    • Controls
    • Electrical/Lighting/Reflective ceiling
    • Plumbing
  • Utility Data
    • Electrical
    • Gas
    • Water
  • Operational Practices
    • Operating hours
    • Setpoints
    • Maintenance practices

If you can only have one or two pages, it’s going to be the mechanical schedules. “Schedules” are tables summarizing equipment, mechanical capacity, design values, and other pertinent information. Planning reports typically include an equipment summary and initial list of equipment to be tested. The mechanical schedules will get you most of the way to completing this portion of the deliverable.

Utility data is typically gathered early on during business development, as part of the the financial proposition for going down this road. Typically the planning report will include a utility section with baseline numbers and utility disaggregation. This will be the basis that savings are claimed against as well as a sanity check for the proposed ECMS.

Finally, you want to understand the operator’s belief of how the building operates. This conversation will tell a lot not just about energy opportunities, but the facility’s pain points. Event schedules can be hard to maintain and instead equipment runs 24/7. Similarly, when hot calls and cold calls happen, and time is short, overrides becomes the new normal. This information isn’t to be taken at face value but to be verified. Saving energy and make facility’s like easier is a win win.

Step 3 – Initial Site Visit (Optional)

Here it is! You finally get to go on site, meet the staff, and challenge your theoretical understanding of the site. Depending on how your project was priced, you may or may not have budget for this task. However, if you do, it’s usually a portion of a single day where a facility representative will walk you around site to gather your pictures, ask your questions, rummage through the drawing room, and fill in the gaps in your knowledge.

There’s a few goals for this visit.

  • Gather information to finish your planning report
  • Gather information to solidify the test and tasks for your investigation
  • Decide whether the project should be continued

I bet not every one of you saw that last one coming but it’s true. Another name for the planning phase, is the PFA (preliminary feasibility analysis). With the utility analysis, you’ll have a good understanding of the building’s energy consumption as it compares to its peers. After your initial site visit, you’ll have a general idea of the low-hanging fruit (i.e. schedules, resets, VFDs, economizers, overrides, equipment condition, etc.). For many energy projects this is the last chance to pull-out and cut losses, before significant cost is sunk and

Step 4 – Planning Report

Now, the planning report! The capstone of the initial phase. Your scope of work (remember that!) might stipulate exactly what needs to be included and can very greatly. Typical items included are:

  • Basic site information (i.e. building age and size)
  • Mechanical system summary (i.e. DX vs. chilled water, VAVs vs. dedicated units, DDC vs. pneumatic)
  • Mechanical Details
    • Equipment photos
    • Major equipment information (i.e. motor size, efficiency, insulation class, variable speed)
  • Utility Metrics
    • Establish baseline
    • Comparison to peers
  • Monitoring Plan
    • Which building automation points to trend
    • Which data loggers to be installed
    • What power readings and spot measurements to take
  • Preliminary opportunities

As long as there are enough opportunities to justify the project continuing, the planning report ends up being a milestone to make sure you didn’t skip steps and miss information required in the following phases.

Much of the information just gathered is going to be used during the investigation phase. You should now have enough information to setup a testing plan. Which equipment you’re going to test, how you’re going to test them, and what opportunities you’re going to keep a particular eye out for. You’re also going to be using the mechanical information and monitoring points to identify opportunities and calculate their energy savings.

The final report and/or systems manual, as the names hint, put a bow on the project. Savings are finalized and verified here… so no skipping on the baseline! You also need to update the systems. Many of the equipment will stay the same, and will be a simple copy and paste, only if you did you job during the planning phase.

Conclusion

So there we have it… the planning phase from start to finish. Not the most glorious but like most things, proper preparation makes the rest of the tasks that much easier and valuable. In this section we covered why:

  • Taking a step back to understand the scope of work and the business objective for both (if not more) parties is important for project success.
  • What documents to include in an RFI and which of these to put extra emphasis on gathering.
  • What tasks to be accomplished on your planning phase site visit
  • What to include in a planning report to improve the chance of success in future phases.
]]>
https://mahony.tech/energy-engineering-planning-phase/feed/ 0