Sparx Engineering https://sparxeng.com/ Mon, 23 Feb 2026 19:10:29 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 https://sparxeng.com/wp-content/uploads/2023/01/favicon.svg Sparx Engineering https://sparxeng.com/ 32 32 Introduction to PLC Programming https://sparxeng.com/blog/software/introduction-to-plc-programming https://sparxeng.com/blog/software/introduction-to-plc-programming#respond Thu, 18 Dec 2025 20:28:40 +0000 https://sparxeng.com/?p=8468 Getting Started with Industrial Automation If you’re new to robotics programming or industrial automation, jumping into the world of real-time control systems can feel overwhelming. Fortunately, Programmable Logic Controllers (PLCs) offer a powerful and accessible starting point. This guide will walk you through the basics of PLCs and provide a simple example using a traffic […]

The post Introduction to PLC Programming appeared first on Sparx Engineering.

]]>
Getting Started with Industrial Automation

If you’re new to robotics programming or industrial automation, jumping into the world of real-time control systems can feel overwhelming. Fortunately, Programmable Logic Controllers (PLCs) offer a powerful and accessible starting point.

This guide will walk you through the basics of PLCs and provide a simple example using a traffic light controller, so you can begin programming your own automation systems even with little experience.

In this article, you’ll learn:

  • What a PLC is and how it works
  • The basics of PLC programming languages (IEC 61131-3 standard)
  • Common functions like Set/Reset and TON timers
  • A practical traffic light control example in Function Block Diagram (FBD)

By the end, you’ll be ready to start building your own PLC control logic — even with minimal experience.

What Is a PLC (Programmable Logic Controller)?

A PLC is a ruggedized computer specifically designed for real-time control of machinery and industrial equipment. It excels at:

  • Fast input/output processing
  • Predictable behavior
  • Continuous scanning and logic execution

PLCs are widely used in assembly lines, robotics, HVAC systems, and safety mechanisms—anywhere where rapid and deterministic response is essential.

Introduction to PLC Programming Languages (IEC 61131-3)

You normally have a choice among multiple PLC programming languages specified in the IEC 61131 standard. The standard includes five PLC programming languages that include Structured Text, Ladder Diagram, Function Block Diagram, Sequential Function Chart, and Instruction List, though Instruction List is deprecated and not used in modern PLCs. I will discuss the first four of those IEC 61131 standard languages, but keep in mind that there may be more options or variations of these options depending on the PLC.

While it is possible to implement all or most of a PLC program in a single language, it is often better to use a combination of languages to take advantage of each of their benefits. Multiple lines or blocks of code in one language could be reduced to a single line or block in another.

Overview of Common PLC Languages

LanguageTypeBest For
Structured Text (ST)Text-basedLoops, math, conditionals
Ladder Diagram (LD)GraphicalElectrically intuitive logic
Function Block Diagram (FBD)GraphicalVisual programming, beginner-friendly
Sequential Function Chart (SFC)GraphicalStep-based sequences, state machines

Structured Text (ST)

Structured Text (ST) is the programming language that is most similar to programming in BASIC or C. The biggest advantage to this language is being able to perform mathematical operations most efficiently. It is also ideal for features like if statements and for loops.

Ladder Diagram (LD)

A Ladder Diagram (LD) is a graphical programming language modeled after electrical connections. Using Ladder Diagrams is especially intuitive for electrical engineers and is the most common seen in PLCs. At a minimum, even the cheapest PLCs should support LD and ST, if not any other languages.

Function Block Diagram (FBD)

Function Block Diagram (FBD) for PLCs is a higher-level graphical programming language with an emphasis on processing data through function blocks. This is generally a more intuitive PLC language. Depending on how well the programmer organizes the program structure, even those with no programming experience should be able to follow what the program is doing. However, while intuitive, the Function Block Diagram approach is not as efficient a language as ST or LD in many cases.

Considering the intuitiveness of this language, the examples below are all using FBD.

Sequential Function Chart

Sequential Function Charts are another high-level graphical programming language that is specialized to only model sequential processes and not write control logic. It does not support many of the features of the other PLC programming languages, such as data structures, loops, or conditions. Instead, this is the ideal language to implement a state chart, while low-level control logic is programmed in a different language.

Many PLC programs mix languages to leverage the strengths of each, and it is a very common approach to do so. For example, you might use LD for inputs/outputs, ST for math, and SFC for process control.

Programming Basics: Boolean Logic, Set/Reset, and Timers

The best place to start when learning PLC programming is Boolean variable manipulation. Booleans, or binary on-off variables, are often the most widely used variables on a PLC. Booleans can control which step of sequence is active, as well as describe the system status.

Set/Reset

Common bit operations are setting and resetting. These operations are important for allowing a Boolean to retain its value after a particular sequence is inactive.

Below is an example of setting a Boolean variable. Note that the gray box on the left indicates a variable. This is generally used for non-binary variables (INT, WORD, etc.) or when using a Boolean as an input (as in this case). The circle on the right is called a coil, which essentially places a Boolean on the receiving end of a function. The “S” in the circle indicates that this is a Set coil.

By connecting the Boolean variable set_test to the Boolean variable var1 within a Set coil, you can toggle the value of set_test to set var1 to TRUE. Note that var1 stays TRUE after set_test is set back to FALSE.

Similarly, a Reset coil – indicated by “R” – can be used to set a Boolean to FALSE.

TON Function Block (ON Delay Timer)

Another common operation is to enable an output after a certain amount of time. The way to achieve this is to use a TON function, otherwise known as an ON delay timer. When the TON function is enabled (IN = TRUE), it receives an input amount of time (PT) and waits for that amount of time to elapse before enabling the output (Q). TON functions typically have another output variable ET which reports the amount of time elapsed from the time the function was enabled to the end time PT.

Note below that var1 is not set to true until the TON function is enabled for at least 5 seconds. The TON function is reset so it can be used again by disabling the input IN.

PLC Programming Example: Traffic Light Control in FBD

Even just using these few basic PLC programming concepts, one can get a long way in practical applications. Here is an example PLC program that employs only the concepts already discussed. Note that comments are in green text boxes. Also, there is no need to define the ET output in a TON function if it will not be used.

A key takeaway from this example is the overall program structure. At the top of the program, look at the traffic light displays. These serve no purpose other than to represent two traffic lights at an intersection. This demonstrates my favorite reason to program via FBD, which is to take advantage of visual cues to test your program.

Beneath that is the control logic, determining the light change order and timing. There are many ways to program this sequence, but I highly recommend keeping the implementation as simple as possible. I personally chose to structure the sequence in this way because each state of the sequence is clear according to variables on the left. And within each line of the sequence, it is easy to tell what changes by the end of that line.

Final Thoughts: Learning by Doing

At Sparx Engineering, we believe the best way to learn PLC programming is through hands-on application. Starting with small projects like the traffic light controller helps build foundational skills for real-world automation systems.

💡 Reminder: Each PLC brand (Siemens, Allen-Bradley, etc.) has its own software interface for downloading, compiling, and debugging. Refer to your vendor’s manual for step-by-step details.

Note that this introduction does not cover compiling or debugging, as those procedures vary between PLC manufacturers, which usually employ different programming software. Most PLC software manuals cover this in detail for their specific products, so further reading will be necessary in that area.

I hope to cover more PLC programming examples, useful functions, and general tips in the future, so stay tuned!

The post Introduction to PLC Programming appeared first on Sparx Engineering.

]]>
https://sparxeng.com/blog/software/introduction-to-plc-programming/feed 0
Why Choose a Career in PCB Design: Becoming a PCB Designer https://sparxeng.com/blog/hardware/why-choose-a-career-in-pcb-design https://sparxeng.com/blog/hardware/why-choose-a-career-in-pcb-design#respond Fri, 07 Nov 2025 19:43:39 +0000 https://sparxeng.com/?p=8484 Exploring One of the Most In-Demand Careers in Electronics There are thousands of career paths out there — but as someone who’s built a profession around Printed Circuit Board (PCB) design, I can confidently say: becoming a PCB Designer is one of the most rewarding and in-demand careers today.From consumer electronics to AI infrastructure to […]

The post Why Choose a Career in PCB Design: Becoming a PCB Designer appeared first on Sparx Engineering.

]]>
Exploring One of the Most In-Demand Careers in Electronics

There are thousands of career paths out there — but as someone who’s built a profession around Printed Circuit Board (PCB) design, I can confidently say: becoming a PCB Designer is one of the most rewarding and in-demand careers today.From consumer electronics to AI infrastructure to electric vehicles and aerospace, nearly every modern innovation relies on well-designed PCBs. As global industries push toward smarter, smaller, faster, and more connected devices, the demand for skilled PCB Designers continues to grow rapidly.

What does a PCB Designer do?  

The simple answer: PCB Designers design printed circuit boards.

The complete answer is much broader.

The short and sweet answer is they design PCBs (Printed Circuit Boards). The more in-depth answer is they design PCBs to fit a certain application and set of requirements for a customer to meet their customer’s need. They start by coming up with a circuit that fits their requirements and then use PCB design CAD tools to make schematics and PCB layouts to capture their circuit. Then they work with PCB fabrication shops and assembly shops to build the PCBs and put electrical parts on them. Once they get the assembled PCBs in hand, they test, troubleshoot, and reiterate until they have a circuit that meets their requirements. Below are some key aspects of a PCB Designer’s job and the image below shows the PCB design process flowing from problem identification to computer circuit design to finished PCB to integrating the PCB into a product to a final solution with real world impact. Just like an amputee receiving an advance prosthetic!

  • E-CAD Tools: Designers find themselves getting really knowledgeable in electrical design concepts as well as skilled with PCB CAD software. Here’s an article of the Top PCB Design Softwares in use today. Altium and Cadence dominate in the professional design software industry, and KiCad is a great free, open-source software to get started learning how to design PCBs.
  • Hands On: Design work is not always at a computer. Good designers have hands-on skills in soldering, inspecting electronics, working with test equipment, running wiring, and prototyping full devices.
  • Cross-Discipline: PCB Designers will also work with other disciplines like software and mechanical engineering to make sure their design supports the software’s hardware needs and implements the right physical features to interface with the real world.
  • Full Spectrum: PCB Designers can find themselves in one area of this process or all of it. This leads designers to have a very comprehensive view of the design and manufacturing process.

Where does a PCB Designer work?

Anywhere and everywhere. Every industry uses electronics; Medical, Oil & Gas, Aerospace, Military, Consumer Products, Industrial, Automotive, Underwater Applications, Robotics, Computers, Energy, Research, and the list goes on and on. Several online reports show there are about 10,000 PCB Designers in the US currently, but many more are needed to support the continual demand for a more electronic world. PCB designers also find themselves at a range of sizes of companies from huge international companies down to smaller local companies which again just shows that Designers are needed everywhere. The Bureau of Labor Statistics groups PCB Designers under Electrical & Electronics Engineering and gives promising projections for this field over the next decade.

What does it take to become a PCB Designer?

The main path is a Bachelor’s of Science degree in Electrical Engineering from a 4 year accredited University. Here you will learn all the fundamentals of electricity and get an intro to circuit design. (It’s really important that your degree is from an ABET accredited program so employers will recognize your degree and so that you can get licensed. You can look up ABET accredited engineering degree programs here.)  Past that, real world experience in a junior engineering position and tinkering with electronics on your own will help build you into a competent designer. Just as the world of electronics is quickly growing so is the world of hobbyist electronics who document their projects and lessons learned online. There is no shortage of material to learn from and nerd out over. (Here are several great Youtube channels to learn from.) A Master’s or PhD in Electrical Engineering is not a requirement, but they only improve your knowledge base for PCB design. Additionally, pursuing your Professional Engineering (P.E.) license helps designers stay sharp out in the field. The rigorous study for the exams followed by continuing education every year afterwards promotes designers that are always growing and staying on top of modern electronics developments. This isn’t a requirement to become a PCB designer, but P.E.’s stand out among designers. Learn more about the licensure process here.

Key Skills of a Modern PCB Designer

ECAD Tools & Design Software

Designers become experts in tools like Altium Designer, Cadence OrCAD/Allegro, or open-source tools like KiCad. These platforms allow engineers to draw schematics, create PCB layouts, and export manufacturing files.

Hands-On Prototyping

PCB design isn’t just screen time. Great designers also:

  • Solder prototypes

  • Use multimeters, oscilloscopes, and logic analyzers

  • Build harnesses and wire assemblies

  • Physically inspect and debug real boards

Cross-Functional Collaboration

PCB Designers work with software, mechanical, and test engineers to ensure the circuit board mechanically fits, can properly run the firmware, and performs as expected. 

Full Lifecycle Perspective

Designers often support the entire lifecycle. From concept to manufacturing to field support PCB designers give them deep insight into how their boards impact real products.

Why Sparx Engineering is a Great Place to Be a PCB Designer

At Sparx Engineering, our PCB Designers work across the full spectrum of the product development lifecycle — from blank-sheet concept to real-world integration.

Our team:

  • Uses industry-leading PCB CAD tools

  • Works with fabricators and assembly houses regularly

  • Prototypes, solders, and tests PCBs hands-on

  • Supports a wide range of industries and technologies

Whether you’re an engineer looking to expand your technical breadth or a business seeking high-reliability PCB development, Sparx Engineering provides the environment to push boundaries.

An Engineering Career with Real-World Impact

There’s lots of great reasons to become a PCB Designer, and at Sparx Engineering, our PCB Designers get to work the full spectrum of what a PCB Designer can do. A Sparx PCB Designer is well versed in PCB Design Software, has vast knowledge of the PCB fabrication & assembly process, and is experienced in troubleshooting, soldering, and testing. Sparx PCB Designers get this experience because Sparx designs for every industry and works with a wide range of technologies. Sparx is a great place for engineers who want a wide range of PCB design experience and for businesses in need of engineering support for their product’s PCB needs.

At Sparx Engineering, our PCB Designers gain experience across industries and technologies, building both technical depth and manufacturing expertise.

If you’re considering a career in electronics or need engineering support for your next product, PCB design is one of the most exciting and impactful paths available.

The post Why Choose a Career in PCB Design: Becoming a PCB Designer appeared first on Sparx Engineering.

]]>
https://sparxeng.com/blog/hardware/why-choose-a-career-in-pcb-design/feed 0
Convert Design Files from KiCad to Altium https://sparxeng.com/blog/software/convert-design-files-from-kicad-to-altium https://sparxeng.com/blog/software/convert-design-files-from-kicad-to-altium#respond Tue, 16 Sep 2025 15:55:49 +0000 https://sparxeng.com/?p=8378 With the increasing popularity of Altium Designer in the electronics industry, many professionals and hobbyists are transitioning from other PCB design tools to Altium to take advantage of its advanced features and user-friendly interface. As a result, converting existing KiCad PCB files to Altium has become a common task. This blog will guide you through […]

The post Convert Design Files from KiCad to Altium appeared first on Sparx Engineering.

]]>
With the increasing popularity of Altium Designer in the electronics industry, many professionals and hobbyists are transitioning from other PCB design tools to Altium to take advantage of its advanced features and user-friendly interface. As a result, converting existing KiCad PCB files to Altium has become a common task. This blog will guide you through converting your KiCad PCB files to Altium, ensuring a smooth transition and helping you leverage the full potential of Altium’s powerful design capabilities.

Why Convert from KiCad to Altium

Altium Designer is renowned for its robust design tools, extensive library management, and superior integration with other engineering workflows. While KiCad is an excellent open-source tool, Altium provides a more polished user experience, better support, and advanced features such as interactive routing, 3D visualization, and design rule-checking. Transitioning to Altium can significantly enhance productivity and PCB quality.

Preparing for the Migration

Before you begin, consider why you need to import your data. Here are some common considerations:

  • Do you have any critical data that must be preserved?
  • Is it more efficient to start new designs rather than rework imported data?
  • How will you verify the imported data?
  • Do you need to leverage Altium specific features?
  • How will you maintain library integrity and design authority?

Steps to Import KiCad Project into Altium Designer

1. Prepare Your KiCAD project:

Ensure all your KiCad files are organized and complete. You only need your .pro, .sch, and .kicad_pdb files to migrate from KiCad to Altium Designer. To convert models and components, .lib files are also needed. Here is a guide to the files needed for your import:

  • KiCad pro Files (*.pro)
  • KiCad kicad_pro Files (*.kicad_pro)
  • KiCad sch Files (*.sch)
  • KiCad kicad_sch Files (*.kicad_sch)
  • KiCad kicad_pcb Files (*.kicad_pcb)
  • KiCad lib Files (*.lib)
  • KiCad kicad_sym Files (*.kicad_sym)
  • KiCad kicad_mod Files (*.kicad_mod)

2. Open Altium Designer:

Launch Altium Designer on your computer.

3. Enable the KiCad Importer Extension

To use the KiCad Importer, ensure it is installed. Access the Extensions & Updates view by clicking the control at the top-right of the workspace, then choose Extensions and Updates from the menu. If the KiCad Importer extension is not listed, you will need to install it. Open the Purchased tab, find the KiCad Importer extension, and click to download it. Restart Altium Designer when prompted.

Options (names and logos) for software extensions

4. Importing the KiCad Project:

Go to File > Import Wizard. In the Import Wizard, select KiCad from the list of supported formats and click Next.

Screenshot image of import wizard intro screen
Screenshot image of import wizard file type selection window

5. Select the KiCad Files:

Browse and select the KiCad schematic and PCB files you want to import. Make sure to select both the schematic (.sch) and PCB layout (.kicad_pcb) files.

Import window in KiCad Import wizard for adding KiCad designs
Import window in KiCad Import wizard for adding KiCad Libraries

6. Configure Import Options:

Review and configure the import options. Adjust settings based on your specific project requirements, such as handling of net names, design rules, and component footprints.

7. General Import Options:

Use the General Options dialog to set up general log reporting options. Enable options like Log All Errors, Log All Warnings, and Log All Events.

8. Log of Analyzing:

The Log of Analyzing dialog lists any errors/warnings found during the scanning of the KiCad files you are importing.

9. Review Output Project Structure:

Review the output project structure and specify the Output Directory where the files will be imported.

10. Schematic Import Options:

Set the import options for your schematic. Check the desired options.

11. PCB Import Options:

If the KiCad project includes a PCB, there will be additional PCB Import Options and Current Board Layer Mapping pages displayed. Complete these as required and click Next.

12. Complete the Import:

Once the above options have been specified, the Importing Progress page will display. When the progress bars reach 100%, the KiCad Import Wizard is completed. Click Finish in the Wizard to close it. The result of the import can be seen in the Projects panel.

Import Wizard show that the KiCad Import Wizard is complete

Post Import Tidy Up

Once the import is complete, review the imported schematic and PCB layout in Altium Designer. Ensure everything is correctly translated and optimized for Altium’s environment. Here is a checklist of key checks:

  • Physical Check
    • Verify board shape and cutouts
  • Electrical Check
    • Verify netlist and design rules
  • Rules
    • Ensure all design rules have been imported
    • Perform a design rule check
  • Power Check
    • Verify nets, planes, and polygons
  • Documentation Check
    • Ensure layers, text/strings, and legends are correctly imported
    • Verify the number of components/nets and that all nets are routed
  • Gerber Files Check
    • Generate Gerber files for the imported project and view them with Altium’s Camtastic Viewer to ensure they are consistent with the KiCAD files.

Conclusion

Converting your KiCad project to Altium Designer can be straightforward with the right tools and steps. Altium’s Import Wizard makes the transition smooth, allowing you to take full advantage of Altium’s powerful features and improve your PCB design workflow. By following the steps outlined in this guide, you can ensure a successful conversion and start leveraging the benefits of Altium Designer for your future projects.

References

  1. https://www.altium.com/documentation/altium-designer/kicad-import#using-the-kicad-importer
  2. https://www.altium.com/altium-designer/migrate/kicad-eda
  3. https://resources.altium.com/p/moving-altium-designer-kicad

The post Convert Design Files from KiCad to Altium appeared first on Sparx Engineering.

]]>
https://sparxeng.com/blog/software/convert-design-files-from-kicad-to-altium/feed 0
Mechanical Engineering File Types https://sparxeng.com/blog/mechanical/mechanical-engineering-file-types https://sparxeng.com/blog/mechanical/mechanical-engineering-file-types#respond Thu, 24 Jul 2025 15:55:29 +0000 https://sparxeng.com/?p=8372 Understanding 3D Modeling File Types: A Guide for SolidWorks Users In the world of 3D CAD modeling, every software has its own native file type and varying degrees of support for interchangeable file formats. This makes managing files across different platforms and programs a challenge—especially when you’re unsure which files are editable, viewable, or even […]

The post Mechanical Engineering File Types appeared first on Sparx Engineering.

]]>
Understanding 3D Modeling File Types: A Guide for SolidWorks Users

In the world of 3D CAD modeling, every software has its own native file type and varying degrees of support for interchangeable file formats. This makes managing files across different platforms and programs a challenge—especially when you’re unsure which files are editable, viewable, or even importable.

In this guide, we’ll explore the most common 3D modeling file types, their roles in SolidWorks, and which formats offer full editing capability, limited functionality, or no compatibility at all.

Popular CAD Programs

There are a variety of programs available for 3D modeling, each with its own file structure.  Depending on the program used, the file structure will look a little different from another program. Some of the commonly used programs are:

At Sparx Engineering, our standard CAD platform is SolidWorks, and this guide is written with SolidWorks users in mind.

Core 3D CAD File Categories

Engineers typically work with three main file types across all CAD programs:

  1. Parts – Single components (e.g., bolts, brackets, housings)

  2. Assemblies – Collections of parts constrained together

  3. Drawings – 2D documentation for manufacturing or assembly

Let’s break these down by file type and compatibility.

Parts

A part file is a singular component. A part file is where the highest detail of a design is done. A part is built up by creating different features, which control the thickness, hole patterns, shape, etc. of the given part. A part is composed of a feature tree, which is the list of all the features used to design that part. These are singular components such as a bolt, bracket, beam, cover, etc.   

Part Feature Tree in SolidWorks

Native

  • SLDPRT

The file type for a single part component is referred to as the file extension (.SLDPRT) in SolidWorks. These are parts made and saved in the SolidWorks CAD program, and allow the most detailed editing when used in SolidWorks. This means that when imported into SolidWorks, it allows for the entire feature tree to be seen and edited.

Generic 3D Geometry

  • STEP
  • IGES / IGS

A generic, or general 3D geometry files give access to the part and what is looks like, but does not allow editing of the feature tree used to create that part. Although the feature tree is not accessible, new features can still be added to change the design of the part. Generic 3D geometry files are typically used to exchange part files when two companies may have not used the same 3D CAD modeling program.

Generic 3D Mesh

  • STL
  • OBJ
  • WRL

A 3D mesh file uses lines and data points to create surfaces that represent the part.  While geometry is viewable, the files are often large – even for small components – and difficult to work with.  The feature tree is not accessible and accuracy of features is not easily measured. Generic 3D mesh models are most commonly used for 3D printing.

Alternate Native Files – Importable

  • Inventor – IPT
  • Cadkey – PRT
  • Catia Graphics – CGR
  • Creo – PRT / XPR

The other CAD programs also use their own native files which Solidworks is able to import, listed above.  These files will have limited access to feature history and tree, but are able to be viewed and edited with new features.

Alternate Native Files – Non-Importable

  • Catia – CATPART

There are also file types that Solidworks is unable to import and work with, which are listed above.  While a different program may be able to use these files, Solidworks cannot.

Part Example

Part component - link arm.

Assemblies

An assembly is a document that is comprised of multiple parts. The parts are arranged using constraints which help define where parts start and stop. In more advanced assemblies constraints can  sometimes allow parts to move as they might when assembled in the real world. Assemblies are used to model multi-body components as well as a collection of parts that have movement involved. Some examples of an assembly would be a gearbox, power tool, and enclosure with electronic components.

Native

  • SLDASM

These are assemblies made and saved in the Solidworks CAD program, and allow the most detailed editing when used in Solidworks. When imported into Solidworks, it allows the constraints to be edited.  The constraints are able to be added, deleted, and have the details changed as necessary.  We are also able to see each part and add / remove parts as necessary.  For an assembly to be imported properly, all of the part files within the assembly will be required as well.

Generic 3D Geometry

  • STEP
  • IGES / IGS

A generic 3D geometry files gives access to the assembly and the general arrangement of components, but does not allow editing of the specific parts or constraints that were originally used.

Generic 3D Mesh

  • STL
  • OBJ
  • WRL

A 3D mesh file uses lines and data points to create surfaces that represent the parts.  While geometry is viewable, the files are often large – even for small assemblies – and difficult to work with.  These file extensions are often not usable within SolidWorks for assemblies.

Alternate Native Files – Importable

  • Inventor – IAM
  • Cadkey – CKD
  • Catia Graphics – CGR
  • Creo – ASM / XAS

The other CAD programs also use their own native files which SolidWorks is able to import, listed above.  These files may have limited access to the constraints or ability to edit but are able to be viewed.

Alternate Native Files – Non-Importable

  • Catia – CATPRODUCT

There are also file types that SolidWorks is unable to import and work with, which are listed above.  While a different program may be able to use these files, SolidWorks cannot.

Assembly Example

Assembly of several link arms tied together with hardware.

Drawings

Drawings are 2D representations of given parts or assemblies. They are used to give manufacturing directions, dimensions, tolerancing, assembly instructions, and information about the product without needing the CAD file.  A drawing is created based on the part or assembly and is used as supplemental information to the 3D data.  Drawings are also used to help control revision history of parts and assemblies. If an existing product is changed, the drawing will help document said changes and allow necessary parties to see the updates.

  • Part drawings are often used for fabrication of individual parts and provide enough information for the overall geometry and dimensions. It often also includes tolerances, which govern how accurate the dimensions need to be for the part.
  • Assembly drawings are used to give part lists, general assembly details, and needed information of how the assembly fits together.  Sometimes dimensions are present but are not always required.

Native

  • SLDDRW

This file type is a drawing created in SolidWorks and requires the given SolidWorks part to be correctly opened.  For part drawings, the SolidWorks part is required to open properly.  If the drawing is for an assembly, the assembly file along with all of the part files are required to open properly.

If both the part and drawing are provided, we are able to completely adjust all aspects of the drawing.  We can add / remove dimensions, tables, change drawing views, and adjust the drawing to the required format.

Generic 2D Geometry

  • DWG
  • DXF

The DWG and DXF files are able to be imported into SolidWorks and allow us to view the drawing and its information.  The part files are not required, and the files can be opened by themselves.

We are able to make minor adjustments to the drawings, but are limited in adding tables, changing view angles, and editing the format due to the generic aspect of the file.

Alternate Native Files – Non-Importable

  • Adobe – PDF

PDFs are able to be viewed outside of SolidWorks, but unable to be used in SolidWorks.  If changes are desired, and only PDFs are available, we often recreate the drawing in SolidWorks based on the provided PDF to achieve the necessary changes.

Drawing Example

Drawing of link arm

Summary Table: Best File Types for SolidWorks

File Type Format Editable in SolidWorks Notes
Part .SLDPRT ✅ Full access to feature tree Native
Assembly .SLDASM ✅ Full access to constraints Native
Drawing .SLDDRW ✅ Requires linked part/assembly Native
Geometry Exchange .STEP, .IGES ✅ Geometry only (no history) Good for cross-platform use
Mesh Files .STL, .OBJ ❌ View-only or 3D print Not suitable for editing
2D Drawings .DXF, .DWG ⚠ Limited edits No parametric features
PDF .PDF ❌ Recreate if edits are needed

Conclusion

In review, the best possible file types to work with is the native file type for each CAD program.  While multiple types are usable, the native file type offers up the best ability to make any desired changes.

For SolidWorks specifically, the best file types to import are SLDPRT (part), SLDASM (assembly), and SLDDRW (drawing).  If these are unavailable, the next best options are STEP for parts and assemblies, and DXF for drawings. 

Need Help Choosing the Right File Format?

If you’re unsure what file types you have or which ones are best for your project, Sparx Engineering can help. Our team works across industries and software platforms to convert, clean up, and deliver production-ready CAD files.

The post Mechanical Engineering File Types appeared first on Sparx Engineering.

]]>
https://sparxeng.com/blog/mechanical/mechanical-engineering-file-types/feed 0
PID Controllers and Constrained SISO Systems: A Practical Control Design Challenge https://sparxeng.com/blog/software/pid-controllers-and-constrained-siso-systems-a-practical-control-design-challenge https://sparxeng.com/blog/software/pid-controllers-and-constrained-siso-systems-a-practical-control-design-challenge#respond Wed, 11 Jun 2025 07:25:19 +0000 https://sparxeng.com/?p=8137 Introduction: The Role of PID in Feedback Control Systems Proportional-Integral-Derivative (PID) controllers are among the most widely used control systems in engineering today. They are especially effective in single-input, single-output (SISO) applications where continuous feedback is required to maintain a desired output. Given a plant process P that maps control actuator to system action , […]

The post PID Controllers and Constrained SISO Systems: A Practical Control Design Challenge appeared first on Sparx Engineering.

]]>
Introduction: The Role of PID in Feedback Control Systems

Proportional-Integral-Derivative (PID) controllers are among the most widely used control systems in engineering today. They are especially effective in single-input, single-output (SISO) applications where continuous feedback is required to maintain a desired output.

Given a plant process P that maps control actuator u(t) to system action x(t), select u(t) so that x(t) achieves a reference value x_{\text{ref}}.

A classic example is the basic cruise control system you might find on your car.  The control input signal is from the vehicle’s speed from the speedometer.  The control output signal is the throttle position.  From time to time, the car may encounter hills or other disturbances that necessitate a time-varying throttle output to maintain the speed reference.

Extending the Problem: Constrained SISO Systems

Given a plant process P, and system actions x_1(t) and x_2(t), select an single control actuator output u(t) so that x_1(t) achieves a reference value x_{\text{ref}} subject to the constraint that x_2(t) \leq x_{2\text{lim}}.

For example, maybe your car is actually a racecar, and there’s a torque limit on the tires that the engine should not exceed.  In that case, the cruise control system needs to take the torque into account when setting the throttle, and there may be some situations, such as during an initial acceleration, when a normal SISO control loop wants to select throttles that would make the car exceed the torque specification.

In such a constrained-SISO problem there are three possible operating environments:

  • The x_2 limitation is not a factor: x_2(t) \ll x_{2\text{lim}}. In that case, we want the controller to perform like a pure SISO controller on x_1.
  • The x_2 limitation dominates the controller, so that it is not possible to get close to x_1 = x_{\text{1ref}}. In that case, we want the controller to perform like a pure SISO controller on x_2, with x_{2\text{lim}}.
  • In transitions between these two regimes, we want a smooth hand-off from the dynamics of one controller to the other.

In such a constrained-SISO problem there is a natural inclination to want to use PID feedback control to handle both stages.  After all, PID is intuitive and ubiquitous in industry.   The question is:  How do you combine two feedback loops that both have control of only a single output signal?  Many common approaches to the “merge problem” result in undesirable modal behaviors—where there are abrupt transients “handing off” from one loop to the other.

One Solution Approach

Here is one solution, that unfortunately I cannot take credit for:

PI controller with constraint
Figure 1: PI controller with constraint

The intuition here is as follows:  We want to control the x_1 signal, so create PID feedback loop on x_1. Most real PID controllers already have output saturation—that is, the output actuator is clipped at limits determined by the physical system[1]. To implement the constraint on x_2, we simply lower the upper control limit on the main PID loop when necessary to keep x_2 at x_{2\text{lim}}.

But what is the upper limit on u that makes x_2 = x_{2\text{lim}}? The simple answer is that if we ever get the system into a state where x_2 = x_{2\text{lim}}, and the control output happens to be u = u_{\text{lim}}, then we have found limit. We declare that the limit output is either above or below whatever the current output is, in proportion to how close x_2 is to the x_{2\text{lim}}. This estimate of the limit will be inaccurate when the controller is operating far away from the x_{2\text{lim}} condition, but it can be expected to become more and more accurate as x_2 approaches x_{2\text{lim}}.

First Solution Analysis

Looking back at Figure 1, there is an algebraic loop, where the output signal u feeds back to compute u_{\text{lim}}.

Figure 2: Algebraic loop highlighted in red
Figure 2: Algebraic loop highlighted in red

Like any good Simulink problem, we can resolve this by adding a one-frame delay block to break the loop, and it turns out that this is the key to why this solution works.

Figure 3: Breaking the algebraic loop with a delay
Figure 3: Breaking the algebraic loop with a delay

To see why, let’s work out what an actual discrete-time controller is doing here[2].  The output saturation block works like this,

u[k+1] = \begin{cases} u_{\text{PID}}[k+1], & u_{\text{PID}}[k+1] \leq u_{\text{lim}}[k] \\ u_{\text{lim}}[k+1], & u_{\text{PID}}[k+1] > u_{\text{lim}}[k] \end{cases}

And the limit output u_{\text{lim}} is computed as

u_{\text{lim}}[k+1] = u[k] + k_{\text{lim}} \left( x_2[k+1] - x_{2\text{lim}} \right)

After some algebra we arrive at the following two conclusions.

When the main loop dominates the limiter loop…When the limiter loop dominates the main loop…
u_{\text{PID}}[k] \leq u_{\text{lim}}[k]u_{\text{PID}}[k] > u_{\text{lim}}[k]
u[k+1] - u[k] \leq k_{\text{lim}} \left( x_2[k+1] - x_{2\text{lim}} \right)u[k+1] - u[k] = k_{\text{lim}} \left( x_2[k+1] - x_{2\text{lim}} \right)

From this, we can see that the x_2 limiter loop has the form of a rate limit, where the rate limit is proportional to the x_2 error. If x_2 overshoots x_{2\text{lim}}, the limiter even forces u to retreat at a minimum slew rate, regardless of the main loop error[3]

\dot{u}(t) \approx \frac{1}{\delta t} \bigl(u[k+1] - u[k]\bigr) \leq \frac{k_{\text{lim}}}{\delta t} \left( x_2[k+1] - x_{2\text{lim}} \right)

We can also use this result to analyze the controller in the continuous-time Laplace domain.  When the limiter loop is dominating the main loop, we have

\delta t \cdot \dot{u}(t) = k_{\text{lim}} \left( x_2(t) - x_{2\text{lim}} \right)

And after taking the Laplace transform (neglecting the constant):

\delta t \bigl(s \cdot U(s)\bigr) = k_{\text{lim}}  X_2(s)

Which rearranges to,     

\frac{U(s)}{X_2(s)} = \frac{\frac{k_{\text{lim}}}{\delta t}}{s}

This has the form of an integral-only (I) controller, where the k_{\text{lim}} gain we specified is scaled by k_i = \frac{k_{\text{lim}}}{\delta t}.

But integral-only control is not appropriate for many plant systems.  Can we operate a PI controller instead?

To do so, we want to modify the transfer function so that it reads:

\frac{U(s)}{X_2(s)} = k_p + \frac{k_i}{s}

But from the block diagram, above we need a u_{\text{lim}}(t) signal that is related to the output signal by \delta t \cdot \dot{u}(t) = u_{\text{lim}}(t). The Laplace transform of that equation gives

\mathcal{L}\bigl(\delta t \cdot \dot{u}(t)\bigr) = \delta t \bigl(s U(s) - \dot{u}(0)\bigr) = U_{\text{lim}}(s)

Neglecting the \dot{u}(0) term, we can rearrange to show that

U(s) = \frac{U_{\text{lim}}(s)}{\delta t \cdot s},

So

\frac{U_{\text{lim}}(s)}{X_2(s)} = \delta t \cdot s \left(k_p + \frac{k_i}{s}\right) = (\delta t \cdot k_p) s + (\delta t \cdot k_i)

So to run PI control on the x_2 limiting signal using the intuitive scheme we selected, we need to compute an instantaneous derivative.  For many systems this is not practical to achieve—if you want to compute the derivative of the input signal, you need a filter or compensator to estimate the derivative, and this introduces additional poles and zeros to the controller.

We can also reach a more general conclusion from all these Laplace transforms:  The effect of breaking the algebraic loop using a delay is to apply one integrator to all control terms.  Derivative terms become proportional terms; proportional terms become integral terms; and integral terms would become double-integral terms.

Can we redraw the block diagram so that we can have PI control on the x_2 signal in the limiting case, without computing a derivative?

Let’s try it.  The simplest, naïve way to get PI control on the main x_1 signal and have a different PI control on the x_2 signal is simply to run two PI controllers and take the minimum output signal[4].

Figure 4: Double-PI controller for a SISO-with-constraint problem
Figure 4: Double-PI controller for a SISO-with-constraint problem

The question is:  Does the merge using a min operation introduce undesirable modal switching behavior?  That is, when we’re handing off from one loop to the other, do we get sudden and abrupt changes in the output signal?

To analyze this let’s look at the specific case where the main x_1 loop is the minimum loop on frame k_0, but the limiter x_2 loop is the minimum on the very next control frame, k_0 + 1.

On the first frame, the control output is given by

I_{x_1}[k_0] = I_{x_1}[k_0 - 1] + \delta t \cdot k_i \left(x_1[k_0] - x_{1\text{ref}}\right)

u[k_0] = u_{x_1}[k_0] = k_p \left(x_1[k_0] - x_{1\text{ref}}\right) + I_{x_1}[k_0]

Meanwhile, on the next frame the control output is given by

    \begin{align*}     I_{x_2}[k_0 + 1] &= I_{x_2}[k_0] + \delta t \cdot k_{i_{lim}}\left(x_2[k_0 + 1] - x_{2lim}\right) \\     u[k_0 + 1] = u_{x_2}[k_0 + 1] &= k_{p_{lim}}\left(x_2[k_0 + 1] - x_{2lim}\right) + I_{x_2}[k_0 + 1] \\     u[k_0 + 1] &= \left(k_{p_{lim}} + \delta t \cdot k_{i_{lim}}\right)\left(x_2[k_0 + 1] - x_{2lim}\right) + I_{x_2}[k_0]. \end{align*}

Now recall the same scenario with the original rate-limiting control scheme.  In the same situation where the x_2 limit takes control on frame k_0 + 1, we had

u[k_0 + 1] - u[k_0] = k_{\text{lim}} \left(x_2[k_0 + 1] - x_{2\text{lim}}\right)

u[k_0 + 1] = k_{\text{lim}} \left(x_2[k_0 + 1] - x_{2\text{lim}}\right) + u[k_0]

We can line up these two equations.  Remember that on the second equation we effectively have k_{p_{lim}} = 0 and k_{\text{lim}} = \delta t \cdot k_{i_{lim}}. After remembering that, we can find the necessary condition to ensure smooth control hand-off:

I_{x_2}[k_0] = u[k_0] = u_{x_1}[k_0]

That is, the integrator state for the x_2 loop must match up with what the main x_1 was doing on the previous frame.  Here’s a detail on how that might work.

Figure 5: Implementing the double-PI controller in discrete time
Figure 5: Implementing the double-PI controller in discrete time

Instead of computing the absolute u[k] for each PI loop, we are computing the change requested by each: u[k+1] - u[k].

Notice that this is again equivalent to computing the derivative of the input signal.  In particular the k_p term on each loop is now k_p \bigl(\epsilon[k+1] - \epsilon[k]\bigr) \approx k_p \cdot \delta t \cdot \dot{\epsilon}(t). We have fundamentally failed in our goal of not computing a derivative!

Figure 6: Each PI loop effectively computes the derivative of its input signal.
Figure 6: Each PI loop effectively computes the derivative of its input signal.

However, we do get one major benefit from implementing the discrete-time controller in this manner.  The “derivatives” that we do compute are pre-scaled by the discrete time period and by the k_p gains into control output units.  This form of computation minimizes the loss of numerical precision.

In Conclusion…

Engineering teams, including Sparx Engineering, continue to select PID controllers to solve control problems because they are easy to use, intuitive to design, and they work well on a wide variety of problems.

In this post, we looked at two non-linear extensions to the PID architecture to solve the constrained single-loop control problem.  This is a common situation that Sparx has had to deal with in diverse problem domains.  In both extensions, we found that individual P-, I-, and D- terms are effectively integrated one level into I-, II-, and P- terms.  This effect can be compensated by differentiating all controller terms, but beware of complications that may arise from computing instantaneous derivatives. 


[1] In the cruise control example, the throttle valve can never be more than 100% open or less than 0% open.

[2] For simplicity, I will set k_d = 0 (turning PID into PI), I will implement integrators with Euler’s method, and I will gloss over other saturation limits, rate limits, and other elements that might be in a real control law.

[3] When x_2 > x_{2\text{lim}}, the term k_{\text{lim}} \left(x_2[k+1] - x_{2\text{lim}}\right) becomes negative, representing a minimum negative slew rate, when k_{\text{lim}} is configured for negative feedback.

[4] Once again, I am leaving out several features that would be in a real control law, like output saturation and anti-windup protection.

Featured Image Credit: https://benchmarkpdm.com/importance-of-shaft-alignment-parallel-angular-pump-alignment/

The post PID Controllers and Constrained SISO Systems: A Practical Control Design Challenge appeared first on Sparx Engineering.

]]>
https://sparxeng.com/blog/software/pid-controllers-and-constrained-siso-systems-a-practical-control-design-challenge/feed 0
Navigating PCB File Types: What You Need for Design Handoff and Manufacturing https://sparxeng.com/blog/hardware/navigating-pcb-file-types-what-you-need-for-design-handoff-and-manufacturing https://sparxeng.com/blog/hardware/navigating-pcb-file-types-what-you-need-for-design-handoff-and-manufacturing#respond Fri, 30 May 2025 17:53:40 +0000 https://sparxeng.com/?p=7201 Introduction: Why PCB Files Matter Whether you are trying to handover a design to your engineering team, understanding how to interface with your contract manufacturing vendors, or trying to resurrect an old project, sifting through Printed Circuit Board (PCB) files can be challenging for those that are not working in PCB design as their primary […]

The post Navigating PCB File Types: What You Need for Design Handoff and Manufacturing appeared first on Sparx Engineering.

]]>
Introduction: Why PCB Files Matter

Whether you are trying to handover a design to your engineering team, understanding how to interface with your contract manufacturing vendors, or trying to resurrect an old project, sifting through Printed Circuit Board (PCB) files can be challenging for those that are not working in PCB design as their primary role.

Locating the full and complete file set is critical to ensure a design can be updated, fabricated, and assembled consistently.

PCB projects encompass various file types, each serving a specific role in communicating the design’s details. Here’s an overview of these file categories: 

  • Design Files: Files that are native to the Electronic Computer-Aided Design (ECAD) software to fully capture the PCB design, including schematics, layout, and other project files. These files are required for your engineering team, but typically not sent to manufacturers.
    • Project File: Defines the overall configuration of the project and links all other files to the project.
    • Schematic Files: Graphical representation of all components and connection.
    • Library Files: Contains symbols and footprints used in the design.
    • Other:  CAD Drawing files (Altium Draftsman), Output job files, simulation, etc.
  • PCB Fabrication files: Files required to build the unpopulated circuit board.
    • Fabrication Drawings: Defines the major board dimensions, layer stack-up, fabrication notes.
    • Gerbers or ODB++ Files: Sets of files to communicate the physical construction of the PCB.
    • Drill file: Provides location and drill size for all holes on the PCB.  Multiple drill files may be provided if there are both un-plated and plated holes.
  • PCB Assembly Files: Files required to install components on to the PCB
    • Pick & Place Files: Contains the location and orientation of each component, used for automated machine placement of components.
    • Bill of Materials: Complete list of the components to be placed on the PCB, includes part numbers, descriptions, quantities, designators, and potential alternatives.
    • Assembly Drawings: Contains information about any processes to be completed after components have been populated on a PCB.

PCB Design Files (Native ECAD Files)

Design files are created in Electronic Computer-Aided Design (ECAD) software and contain schematics, PCB layouts, and component libraries. These are used by engineers for editing, simulation, and generating manufacturing outputs but not typically sent to manufacturers.

Common ECAD Platforms

  • Altium Designer
  • Cadence OrCAD
  • KiCad
  • Eagle
  • Siemens PADS

Each ECAD platform uses unique file extensions. Here’s a quick reference:

File TypeAltiumOrCADKiCadEaglePADS
Project File.PrjPcb.opj.kicad_pro.epf.prj
Schematic.SchDoc.dsn.kicad_sch.sch.sch
PCB Layout.PcbDoc.brd, .max.kicad_pcb.brd.pcb
Symbol Library.Schlib.olb.kicad_sym.lbr.c, .p
Footprint Library.Pcblib.psm, .pad.kicad_mod.lbr.d

Key Design File Types

  • Project Files: Organize and link all schematic, layout, and output files
  • Schematic Files: Represent circuit logic and electrical connections
  • PCB Layout Files: Contain board dimensions, trace routing, and physical component placement
  • Library Files: Define reusable component symbols (schematics) and footprints (PCB pads)

While libraries aren’t always required to open a completed project, they are vital for reuse and modification in future designs, interconnect schematic, PCB, and output files to ensure that every layer of the project is appropriately placed in the design. Here’s an example project structure in Altium Designer:

Library Files

Library files are used by ECAD software to match individual part number’s symbols to their footprint, allowing for reuse of common symbols and footprints throughout a project. These library files create the building blocks for schematics and PCB designs.

Component symbols are visual representations of the connections and functions of a component. Common standard passive components (resistors, diodes, capacitors) each have a unique identifying symbol that many will be familiar with, but individual integrated circuits (ICs) each require a unique symbol to be created for them.

Component schematic image

Component Footprint files are dimensioned visual representation of the pads for electrical components, these are placed within the PCB design to dictate the position and size of the exposed copper to solder components to.

Component footprint image

Design Source Files

Schematics – Within ECAD software, schematics house the electrical design of the PCB and allow others reading them to understand how the PCB is intended to function.

Schematics

PCB Layout – PCB layout files are dimensioned visual representations of the PCB, showing the physical sizing, stack up order, and routing within the design. Footprints are placed and connected throughout the design to generate fabrication files which manufactures can use to create PCBs.

PCB Layout in Development Environment

PCB Fabrication Files

Manufacturers typically shouldn’t need the design files unless they’re also verifying the functionality of the PCBs with tests such as fly probe tests.  Manufacturing files provide a PCB manufacturer with the details of the physical placement of fiberglass, conductors, and holes throughout a design allowing the bare PCB to be assembled. While assembly files inform them of special requirements that may be necessary during the build process such as potting locations or assembly orientations.

Gerbers and Drill Files

Gerber files (RS-274X format) describe individual PCB layers. While aging, they’re still widely accepted by manufacturers.

Common Gerber Extensions

  • Copper Layers: .GTL (Top), .GBL (Bottom), .G1, .G2 (Inner)
  • Silkscreen: .GTO (Top Overlay), .GBO (Bottom Overlay)
  • Solder Mask: .GTS, .GBS
  • Paste Layers: .GTP, .GBP
  • Board Outline/Mechanical: .GKO, .GML, .GMx
  • Drills: .DRL, .TXT, .PHO, .D, .ART

Use Altium CAM viewer (or other CAM tools) to validate your Gerber and drill files before sending to the fabricator.

ODB++ Files

ODB++ Files are a more modern file type and often preferred over Gerber files.  ODB++ files contain more information than Gerbers.  Check with your manufacturer on their file type preference between ODB++ and Gerbers.  

ODB files are a large set of file often storred as a single .zip or .tgz comressed file.  The compressed file typically contains folders such as fonts, input, matrix, misc, steps, symbols, each of which may contain many subfolders and files.  

PCB Fabrication Drawing

To help ensure your PCB is built to specification, a pdf drawing should be provided with fabrication notes, layer stackup table, drill table, or other specific information about the desired quality of construction of the PCB. These drawings can often be created within the PCB layout itself and exported within the manufacturing files as well.

PCB Assembly Files

Your PCB Assembly contract manufacturer will need the Gerber or ODB++ files. In addition to those files, they will need a few other files.

Pick and Place

A pick and place file, or sometimes referred to as an “XY” file typically has a .txt extension and contains the X and Y coordinates and orientation of each component. This file is use for automated machine placement of parts on an assembly line.

Bill of Materials

The Bill of Materials should contain part numbers, description, reference designators, quantities, and other critical information such as approved alternate parts. This is often in .xlsx or .csv format.

PCB Assembly Drawing

The PCB Assembly Drawing is typically a PDF and would include notes required for assembly, such as special installation instructions, solder requirements, conformal coating instructions, and other critical details.

Conclusion: Start with the Right Files

For the best results in editing, manufacturing, and assembly, always work from native ECAD files when possible. Here’s a quick reference:

TaskFile Type
Design.PrjPcb, .SchDoc, .PcbDoc
Manufacture .GTL, .GBL, .DRL, or .ZIP ODB++
Assemble.TXT (PnP), .CSV (BOM), .PDF (Assembly Drawing)

Understanding what each PCB file does — and when to use it — helps ensure your project moves forward without costly delays or confusion.

Help! I am Missing Files

If you’re missing critical files or only have a physical board, don’t panic.

At Sparx Engineering, we can:

  • Reverse-engineer your design from a physical PCB
  • Recreate missing schematic or layout files
  • Update or modernize legacy designs
  • Generate manufacturing-ready file sets

Contact us if you’re unsure what you need — we’ll help you sort it out.

The post Navigating PCB File Types: What You Need for Design Handoff and Manufacturing appeared first on Sparx Engineering.

]]>
https://sparxeng.com/blog/hardware/navigating-pcb-file-types-what-you-need-for-design-handoff-and-manufacturing/feed 0
Home Backup Power, Battery or Generator? https://sparxeng.com/blog/hardware/home-backup-power-battery-or-generator https://sparxeng.com/blog/hardware/home-backup-power-battery-or-generator#respond Thu, 03 Apr 2025 17:21:41 +0000 https://sparxeng.com/?p=7972 Which is best for home backup power, a fuel burning generator or a home backup battery? The answer is really neither because “best” is relative to your perspective, preferences, and situation.  I never found a resource that tried to fairly lay out the comparisons and tradeoffs.  So, here’s my take with as little bias as […]

The post Home Backup Power, Battery or Generator? appeared first on Sparx Engineering.

]]>
Which is best for home backup power, a fuel burning generator or a home backup battery?

The answer is really neither because “best” is relative to your perspective, preferences, and situation.  I never found a resource that tried to fairly lay out the comparisons and tradeoffs.  So, here’s my take with as little bias as I can.

Disclaimer: This is a moving target.  One small shift in technology, market conditions, government regulations, or whatever could make this analysis obsolete.  But logical thinking never goes out of style.  In this article, generator is a source of electricity that burns fuel to make power, not a battery pack that stores and provides electricity.  Lots of places are now selling “battery generators” which is an unnecessary confusion of terms to me. 

In the great Texas freeze of 2021, the local grid was up and down dozens of times and spent more than 27 hours down.   My house had a natural gas generator, and it ran flawlessly while friends and neighbors dealt with burst pipes from no heat.  When I built a new home in 2022, I knew I would be adding backup power to my new house.  And despite wanting to go green and be grid independent with battery plus solar, I eventually chose to install another backup generator.  Here’s why: 

Best Tool for the Job

Home batteries certainly provide backup power but that is not their primary designed purpose.  They are designed as a way to “time shift” the energy from solar panels.  Solar panels make most of their power during a narrow window of peak sunlight.  Batteries let you capture the excess energy during the day and then use it later. Most consumer battery systems offer emergency power as a side effect of solar storage, not their designed purpose.  Generators’ sole reason to exist is emergency power. 

Batteries with Benefits

Batteries can help reduce your recurring energy bills.  Some electricity plans offer cheaper rates during the night.  You could charge batteries when rates are low and then run off batteries when rates are high.  Similarly, batteries can store power from your solar panels so you can use less from the grid at night.  Generators are a one trick pony that will never do anything more than sit there and wait for an outage while a battery can help you with everyday life.  

Total Cost of Ownership

When comparing a battery backup system to a generator, it’s important to look beyond just the initial price tag. One useful way to assess long-term affordability is through the concept of Total Cost of Ownership (TCO), which includes more than just the upfront cost. TCO = Cost of Acquisition + Cost of Operation + Cost of Disposal – Value at End of Service Life. This formula gives a fuller picture of what you’re really paying over the lifespan of the system.

Acquisition

Batteries are more expensive up front.  About 1.5 – 3 times generator cost depending on variables.  This is assuming you buy a battery system that provides whole home power.  If you can live without some appliances during an outage, you can pay less.  But typically the first thing you would sacrifice would be the high current draw of starting an air conditioner.  Not a compromise for me.

Operation

Batteries are much cheaper per kWh.  They simply store electricity for when you need it, so you pay almost no more for emergency power than you pay for grid power, just shifted in time.  KWh into a battery cost the same as wherever you normally get power (grid / solar).   There are some efficiency losses so something like 100 kWh (kilowatt hours) bought and put into a battery is 90 kWh delivered in an emergency.  Gas generators on the other hand will cost you way more than grid cost per kWh in fuel costs.  If you plan to install solar with a battery, then you are getting some monetary benefits every day that battery charges and discharges. 

Disposal

Not a large consideration but generators win here.  They are just metal and plastic and such.  Mostly recyclable, maybe rebuildable if you replace wear items like rings and the stator.  Batteries can be recycled too but they are a bit more expensive to dispose of due to their chemistry and potential fire hazard.

Value at End of Life

A worn-out battery is mostly value-less.  There is not much you can do with batteries at the end of their life besides recycle them.  My generator itself was only about 1/3 of my total cost to have it installed.  The rest was infrastructure (gas piping, 200A wiring, transfer switch, high flow gas meter) and labor to install, connect, permit and commission.  If and when my generator dies / fails, my replacement cost is way lower than my initial installation because the infrastructure generally does not wear out.  When a battery pack reaches its end of life, its replacement cost is pretty much the same as the initial purchase cost.  But you may not care because you may not live there in 15 years and most certainly technology will have new options to consider at that point. 

Hassle / Convenience / Maintenance / Cost of Operation

Batteries win hands down in almost every consideration here.  They are quiet, zero maintenance devices with no ongoing costs once installed.  Generators are loud.  Their exhaust is bad for the climate, smells bad, and can kill you if improperly vented.  They require periodic maintenance to change the oil and spark plugs and such.  If you don’t have gas as a provided utility, you will have to arrange storage and replenishment of fuel onsite.  That said, I never resented my loud, stinky generator when it was keeping me comfortable.

Generator in backyard with back compartment opened.

Load Capacity

Generators kick battery butt here and this was the primary factor for me in picking the generator.  At the time I made the decision, my total generator install cost was just about the same as the cost of one Tesla Powerwall 2.  The generator could provide 20kW, almost the same capacity as the grid feeding my house.  In an outage, I can run every load in my house without fear of running out of capacity.  The Powerwall could only power up to 12 circuits in my box with a total peak current draw of 20A.  A single Powerwall could not even start my air conditioner because of the peak current limit.  Backup power in Southeast Texas without AC is a waste of time.  I’m not going to sit in a 110-degree house and be thankful that I can watch TV and surf the internet. 

Response Time to Grid Outage

Batteries are instantaneous.  If the grid drops in the middle of the Superbowl, your TV won’t even flicker on battery power.  My generator takes about 5 seconds to detect the loss, start, spin up to speed, and switch over to generator power.  My microwave and oven clocks will reset and any load not on a uninterruptible power supply (UPS) will reset. 

Run Time

Generators will run until they break or run out of fuel.  Batteries run until fully discharged.  In 7 total years of generator ownership, there was only one event where that would have made a difference for me.  My grid outages were usually minutes to hours.  And once the generator ran for 27 hours straight in about 10 degrees F (-12 C).  A battery system and some conservation probably would have kept me warm too.

Things to think about for your Situation:

  1. How reliable is your grid?  If you expect your grid to be up and down often for brief periods, batteries make more sense.
  2. Are you going to do solar anyway?  That tips a lot of the economic calculus.
  3. Do you have a reliable source of fuel for a generator?  (The only time I have been without city gas in 50 years in Texas is when my dad cut the line installing a sprinkler during Thanksgiving one year).  If you have to truck in fuel, that adds to the hassle of a generator. 
  4. What energy source are your major loads?  Does oven, range, water heater, home heat run off natural gas or electricity?  The more electrical loads you have, the more power you need to deliver.  Ironically since every house in my neighborhood has a gas range and water heater, it is likely I will have reliable gas service for a generator.
  5. What’s the minimum total load you would want protected in an outage?  If you can live in the power budget of a battery, it is a convenient piece of technology. 

My Personal Decision

I really wanted solar + battery to be a combination of climate friendly, economically tolerable, and functional.  But the current limitation of the battery pack was the deal killer.  One battery without AC in an outage was intolerable.  Two batteries were too expensive.  But ultimately a generator was the best choice for my situation in my logical and biased analysis.  I hope you can find what you need, feel free to drop a comment below if you have any questions.

Generator in a backyard

The post Home Backup Power, Battery or Generator? appeared first on Sparx Engineering.

]]>
https://sparxeng.com/blog/hardware/home-backup-power-battery-or-generator/feed 0
Understanding Infrared (FTIR) Spectroscopy for Chemical Analysis: How Infrared Light Reveals Chemical Fingerprints https://sparxeng.com/blog/chemical/understanding-infrared-ftir-spectroscopy-for-chemical-analysis-how-infrared-light-reveals-chemical-fingerprints https://sparxeng.com/blog/chemical/understanding-infrared-ftir-spectroscopy-for-chemical-analysis-how-infrared-light-reveals-chemical-fingerprints#respond Wed, 26 Mar 2025 16:58:25 +0000 https://sparxeng.com/?p=7851 Introduction Direct chemical analysis of unknown substances without further chemical manipulation is rare. Even more uncommon is performing this analysis without breaking down or destroying the sample. However, when chemical testing is rapid, reliable, and repeatable, it becomes a powerful technique. Fourier Transform Infrared (FTIR) Spectroscopy is one such technique. By using infrared light (heat), […]

The post Understanding Infrared (FTIR) Spectroscopy for Chemical Analysis: How Infrared Light Reveals Chemical Fingerprints appeared first on Sparx Engineering.

]]>
Introduction

Direct chemical analysis of unknown substances without further chemical manipulation is rare. Even more uncommon is performing this analysis without breaking down or destroying the sample. However, when chemical testing is rapid, reliable, and repeatable, it becomes a powerful technique.

Fourier Transform Infrared (FTIR) Spectroscopy is one such technique. By using infrared light (heat), the instrument interacts with the sample through molecular vibrations. Much like playing a musical note produces a unique tone, infrared waves can be used to make different chemical bonds to vibrate. When these bonds vibrate, the energy to a detector decreases. Therefore, when playing a series of notes, or a broadband spectrum of continuous wavelengths, then recording the ‘notes’ where energy decreases, unique chemical fingerprints are generated.

How Does Infrared (FTIR) Spectroscopy Work?

FTIR spectroscopy is rooted in quantum mechanics, which explains how matter and energy interact at the atomic and subatomic levels. Once classical physics failed to explain the interactions of light and matter, alternate explanations were sought. The result of that inquiry over many years is the foundation of the modern electronics age brought about by harnessing the nature of matter at the atomic level. 

The instrument uses a mathematical technique called the Fourier Transform (FT) to convert raw data from the time domain into a readable frequency spectrum.  Electrons are the negative particles that complement the positive protons and the neutral neutrons.  These three particles are the simplest common reduction of matter to common components to uniquely identify the basis of all matter, the elements.  These elements as documented by the periodic table provide the basis through which modern chemistry is possible. 

The Role of Light in Chemical Analysis

Light is a spectrum of frequencies.  Visible light impacts daily life for it is the range through which our eyes view the world.  This idea is illustrated well by the rainbow which is the separation of white light into different frequencies, we recognize as color from the interaction of white light with water vapor.  UV, Infrared, X-rays, radio waves all are light of different frequencies, or energies.

Thanks to quantum mechanics, we understand that light only interacts with matter when the energy “note” matches a molecular vibration. This principle makes infrared spectroscopy incredibly powerful for identifying compounds based on how their bonds absorb IR energy.

What is FTR Spectroscopy?

The infrared experiment is called infrared or FTIR spectroscopy.  The ‘FT’ is a mathematical transformation that allows the spectrum to be collected in the time domain, but the data is transformed to the reciprocal of time, which is frequency.  Light energy is the combination of frequency and a constant named after Planck.  The speed of light constant is the product of the light frequency and the wavelength. In the infrared region, this corresponds to the frequency that bonds vibrate.  If atoms are considered spheres, and bonds are considered springs, then it is straightforward to imagine that atoms of different masses with different strength bonds will vibrate at different frequencies. There is a subset of carbon-based compounds that can be grouped by unique sets of atoms vibrating in unison.  These are described as functional groups that allow the trained eye to quickly identify the unique fingerprint of the type of molecules. 

Practical Applications and Real World Impact

Since a complex molecule will have unique ‘chords’, every material has a unique fingerprint. With the advancements of mathematical matching against a library of known compounds, in a matter of seconds, one can learn the most probable type of material that is being analyzed. Certain crime shows often show these results, and this test does work on TV time, as it often takes longer to prepare the sample than run the test. At Sparx Engineering, we use FTIR spectroscopy for a variety of real-world applications, including:

  • Identifying unknown substances
  • Detecting water in plastic materials
  • Monitoring chemical reactions
  • Characterizing polymers and plastic types

With advanced spectral libraries and fast data matching algorithms, we can determine a material’s identity in seconds, often faster than the time it takes to prepare the sample.

Example 1

Spectroscopy testing comparing acetaminophen vs ibuprofen.

For context, the power for the identifications of two unknown chemical substances is straightforward.  In this case, household pain relievers acetaminophen and ibuprofen were analyzed, then matched versus the spectral library owned by Sparx. First it is easy to distinguish the two.  In cases like this, unknowns have been identified for projects at Sparx when a customer part failed and an unknown substance was observed as part of the failure mode.  In one example, a battery failure was identified, instead of the customers part, by analyzing substances on the outside of the battery.

Example 2

FTIR Diagnostic ID of water from improperly dried plastic. Image shows graph of FTIR results of authentic polycarbonate with an overlayed result of water in polycarbonate. It can show where the water was affecting the results.

In this example, product injection molded parts were failing.  The molder blamed the plastic, the customer questioned the choice of plastic.  In a matter of minutes, Sparx was able to show that both were not correct.  The molder was not drying the plastic according to vendor specifications.  The result was water damaging the polymer.  From an engineering point of view, the water damage resulted in plastic with weaker structural properties, and the plastic was cracking during field use.  By correcting the drying problem, Sparx was able to get parts prepared according to specification that met teh customer requirements.

Example 3

Bag placed of spectroscopy tester

This picture shows the ATR accessory. For solids like plastic, the sample can be simply clamped to the sample platform. With this accessory, the infrared light is manipulated with mirrors to the diamond sample platform. This accessory makes the instrument accessible to untrained engineers to evaluate plastic. The preparation of chemical samples by transmission requires training to produce quality samples. For this use case, as customer specified high density polyethylene. The the sample was compared with the authentic libary compound, it was evident that the molder had infused a polyester to cut cost. This resulted in a plastic that did not meet engineering requirements for mechanical strength.

Image of spectroscopy testing results to ID plastic. Plastic shows similar wavenumbers to standard polyethylene.

Conclusion

FTIR is a powerful nondestructive technique for the evaluation of samples usually within minutes. At times expert review of the data is needed to draw conclusions of value to the customer. After a high level summary of the method, examples were shown for the ID of substances with common household pain relievers. Next it was shown that a molding failure was a result of improper drying of the polymer before it was injected into the mold. Finally, a part advertised to be comprised with pure high density polyethylene was instead shown to be contaminated with polyester.

FTIR is a power chemical analysis technique. This is one of the tools Sparx uses to support customers, aid engineering and troubleshoot failure modes when they occur in the field or as part of the development process. Whether you’re analyzing plastics, coatings, or contamination, Sparx Engineering’s FTIR capabilities can help you get fast answers and smarter solutions.

The post Understanding Infrared (FTIR) Spectroscopy for Chemical Analysis: How Infrared Light Reveals Chemical Fingerprints appeared first on Sparx Engineering.

]]>
https://sparxeng.com/blog/chemical/understanding-infrared-ftir-spectroscopy-for-chemical-analysis-how-infrared-light-reveals-chemical-fingerprints/feed 0
Allthenticate – Next Gen Secure Entry Technology with the Nordic NRF52 https://sparxeng.com/blog/hardware/allthenticate-next-gen-secure-entry-technology-with-the-nordic-nrf52 https://sparxeng.com/blog/hardware/allthenticate-next-gen-secure-entry-technology-with-the-nordic-nrf52#respond Wed, 26 Feb 2025 22:02:00 +0000 https://sparxeng.com/?p=7784 Challenge Allthenticate is a forward-thinking startup dedicated to bringing innovative solutions to the cybersecurity landscape. Allthenticate worked closely with Sparx to develop an access control proximity-based authentication device capable of locking and unlocking doors based on wireless connectivity. At a high level, the device needed to: Solution Sparx Engineering prepared, designed, and delivered a custom […]

The post Allthenticate – Next Gen Secure Entry Technology with the Nordic NRF52 appeared first on Sparx Engineering.

]]>
Challenge

Allthenticate is a forward-thinking startup dedicated to bringing innovative solutions to the cybersecurity landscape. Allthenticate worked closely with Sparx to develop an access control proximity-based authentication device capable of locking and unlocking doors based on wireless connectivity.

At a high level, the device needed to:

  • Accept 12-24V DC
  • Determine cell phone proximity via Bluetooth
  • Connect to facility Wi-Fi
  • Integrate with Allthenticate user software
  • Fit within a light fixture switch housing
  • Provide visual indication of lock status
  • Drive a 12V or 24V DC power lock
Main PCB inside front half enclosure

Solution

Sparx Engineering prepared, designed, and delivered a custom embedded solution that met all requirements. This solution included three PCBs (printed circuit boards) and a soft-tooled injection-molded enclosure for full production.

Sparx maintained engineering support after the project was completed by facilitating mold vendor and PCB fabrication support. We also worked with Allthenticate to ensure seamless integration with their proprietary software.

Sparx Capabilities Demonstrated

  • Embedded hardware development
    • Power optimization
    • Bluetooth, Wi-Fi, ethernet functionality
  • Software integration advising
  • Injection molded enclosure
  • Functional safety design (FCC certified)
  • Production management

Architecting Success with Nordic Semiconductor

When Allthenticate engaged Sparx to improve their door access control product, they already had a first-generation Raspberry Pi-based system that worked well. However, Sparx improved the following:

  • BOM cost optimization
  • Supply chain security with more available parts and fewer sole-sourced components
  • Improved thermal performance with higher-rated components in a lower-power package
  • Smaller physical package that was easier to install
  • Modern industrial design
  • Interchangeable power supply modules to allow AC mains input or PoE deployment
Nordic Semiconductor Logo
Main PCB underside w/Nordic chip

Prioritizing Quality Where It Counts

While many things can be optimized for cost, no one wanted to cut corners on reliability, so the device needed a quality wireless radio.

The heart of Allthenticate’s access control platform is a simple and convenient user experience that “just works.” Their product uses a Bluetooth Low Energy (BLE) radio to identify the phones of authorized users as they approach, unlocking the door without any required user interaction. The BLE radios on the first-generation Raspberry Pi and the selected system-on-module (SOM) could only manage 2–3 simultaneous links with incoming phones. This led to poor responsiveness as the software struggled to juggle this limited resource.

To explore other options, Sparx and Allthenticate collaborated on a prototype using an NRF52-DK with open-source Nordic firmware as a BLE adapter and immediately achieved 10 simultaneous connections. The final design included a low-cost, FCC pre-certified NRF52 module, and the system performance has been excellent.

Bluetooth radios have become commonplace in everything from toothbrushes to water bottles, with some estimates suggesting more than twice as many radios are produced as there are humans on the planet. Sparx’s experience with Nordic’s products shows that not all radios are created equal. At Sparx, we have used Nordic chipsets in several designs and have never regretted the decision from a cost, performance, or ease-of-integration perspective.

Disassembled Allthenticate device photo image
Sparx Reduced the Power Consumption of Existing Prototype by 50%

Electronics

Sparx designed a compact carrier board for an off-the-shelf system-on-module (SOM), Bluetooth Low Energy (BLE) module, and radar module. This carrier board was responsible for communicating with users’ phones and access readers to unlock/lock electronic door locks and providing power to external access readers.

Main PCB rendered image

Daughterboards

Sparx also designed two daughterboards enabling AC and PoE power conversion for the carrier board. The daughterboard architecture allowed for integrating the Allthenticate product into an existing network and providing compact power solutions by delivering power over Ethernet (PoE) or tapping into AC lines nearby.

Rendered daughterboard image

Additional Electronic Elements

Connectors, LEDs, cabling, and other electronics were also selected to ensure all requirements were met. Notably, Sparx reduced the power consumption of the existing prototype by 50% by implementing efficient on-board power solutions and power staging.

The two daughterboards enabled a compact and modular power solution, eliminating the need for additional external power supplies.

Exploded view of Allthenticate device

Mechanics

Sparx developed an injection-molded enclosure design for Allthenticate. This allowed Allthenticate to achieve high consistency, aesthetics, and cost-effectiveness for their large volumes. The enclosure consists of two separate elements. The first is the PCB housing, which uses mounting holes to align the PCBs.

The second is the front enclosure half, that is seen by the user when in use. This half needed to clearly indicate the lock/unlock status as well as prevent light leak from the LEDs.

Project Outcome

The Allthenticate product is modular, sleek, and optimized for mass manufacturing. Allthenticate has continued to be a close partner for Sparx as the device will be iterated and improved over many generations.

Main PCB inside front enclosure alternate angle photo image

Allthenticate Feedback

“Having an engineering partner like Sparx on our project made all the difference. Their experienced team was able to overcome every challenge efficiently in order to produce an exceptional product. I highly recommend Sparx.” – Chad Spensky Allthenticate CEO

The post Allthenticate – Next Gen Secure Entry Technology with the Nordic NRF52 appeared first on Sparx Engineering.

]]>
https://sparxeng.com/blog/hardware/allthenticate-next-gen-secure-entry-technology-with-the-nordic-nrf52/feed 0
A Quick Guide to Communication Protocols https://sparxeng.com/blog/hardware/a-quick-guide-to-communication-protocols https://sparxeng.com/blog/hardware/a-quick-guide-to-communication-protocols#respond Wed, 22 Jan 2025 19:43:41 +0000 https://sparxeng.com/?p=7182 RS-485, I2C, SPI. CAN, USB, Ethernet. How do you choose? In this quick guide to serial communication, we will go over the most common communication schemes and how to approach system architecture decisions.   The secret to making sense of it all is the Open Systems Interconnection (OSI) model. It is a framework that divides […]

The post A Quick Guide to Communication Protocols appeared first on Sparx Engineering.

]]>
RS-485, I2C, SPI. CAN, USB, Ethernet. How do you choose? In this quick guide to serial communication, we will go over the most common communication schemes and how to approach system architecture decisions.  

The secret to making sense of it all is the Open Systems Interconnection (OSI) model. It is a framework that divides communication into seven layers, allowing engineers to have a working understanding of complex systems and abstract technical intricacies.  

Table 1: The OSI Model

Not all systems implement every layer, and there can be overlap. For embedded systems, we are primarily focused on the data link layer and the physical layer. To choose a communication scheme, there are several factors to consider:  

  • Distance between devices  
  • Data transfer rate  
  • Noise immunity  
  • Available hardware resources & efficiency  
  • Power consumption  
  • Ease of implementation  
  • Specific application requirements  

With this in mind, we can now compare some of the most common interfaces.  

UART

UART stands for Universal Asynchronous Receiver/Transmitter and has been around since the 1960s. It is important to note that UART refers to the hardware used for serial communication and is technically not a communication protocol. It operates at the datalink layer and is used to implement protocols such as RS-232, RS-422, and RS-485. These standards have defined electrical (physical layer) characteristics such as common mode voltage range and signal levels. RS-232 is the default protocol for serial communication with a computer. It is easy to implement, point-to-point, and its wiring is typically TX, RX, and GND. Two optional lines (RTS/CTS) can be added for flow control. RS-422 and RS-485 are similar to RS-232 but have key distinctions: multi-point capability, longer range, faster speed, and industrial applications. For more information the importance of differential signaling, see our Mastering Differential Signals blog.  

SPI

Serial Peripheral Interface (SPI) is a synchronous protocol meant for processors to talk to peripherals within a board or very short distance. It requires four types of connections, as summarized in the table below.  

Table 2: SPI Wiring

A bus will have 3 + n wires, where n is the number of slave devices. The high wire count is a disadvantage, but the benefit is that the SPI interface is the easiest to implement in firmware. It is so simple that a bit-bang interface can often be used.  

Take a deeper dive into achieving high data rates with SPI in Analog Devices’ blog.

I2C

Pronounced “I squared C” or “I 2 C,” I2C stands for inter-integrated circuit and is sometimes referred to as “two-wire interface.” Like SPI, it is meant for short distance communication within a board or box. Its key features are minimal wires and multiple masters and peripherals. The tradeoff is a more complicated driver – a state machine is needed to handle bus arbitration. Thus, I2C falls under 3 layers of the OSI Model (up to Network).  

NXP provides an excellent I2C User Manual that is great for both hardware and software engineers.

Table 3:  I2C Wiring

1-Wire

1-wire features a single wire for communication and power (…and a second wire for ground of course!). Its implementation is like that of I2C but has an implicit clock at 100Kb/s. It was originally invented for use in a momentary contact environment; the most common application for 1-wire is authentication chips. Even so, it can be used for other specialized applications. The 1-wire data rate is relatively low, but its range is surprisingly high—up to 10m, and up to 100m using a special cable.  

CAN Bus

Controller Area Network (CAN) is a serial bus defined by the International Standardization Organization (ISO) in ISO-11898. It was developed for the automotive industry and is now popular in many industrial applications due to its simple two-wire linear bus topology, high electromagnetic interference (EMI) immunity, bus arbitration protocol, and error checking features. ISO-11898 follows the OSI model and thus the physical layer, datalink layer, and network layer are well defined. See the figure below for the standard architecture, taken from Texas Instruments application report SLOA101B.

The Layered ISO 11898 Standard Architecture
Table 4:  CAN Differential Pairs

USB

Universal Serial Bus (USB), as indicated by its full name, was designed to standardize the many serial and parallel ports of computers and their peripherals. This industry standard is exceptionally useful in that it defines power delivery and data exchange. There are too many USB variants to provide an accurate summary, but at its core it consisted of: 2 data signals (a differential pair), 5 volts, and ground. It is asynchronous, asymmetric, and requires significantly more complicated software compared to the previously discussed protocols. A USB cable can be as long as 5 meters without signal integrity issues.  

A common source of confusion is the difference between connectors, generation specifications (i.e., USB 1.x, USB2.x), data rates, and power levels. Names are often used interchangeably to reference different specs, so knowing the OSI model is again useful for navigating the evolving standards. 

Ethernet

Ethernet is a broad, complicated family of networking technology commonly used for computer LANs or internet. It technically is the data link layer, but having ethernet almost always means having a network layer, transport layer, and operating system included. It is an asynchronous, symmetric, robust protocol capable of the highest speeds. Data rate varies with ethernet type and cable length, but expect speeds on the order of Megabits/s or Gigabits/s.  

Parallel Communication

While the protocols discussed up to this point have been serial, it is worth mentioning parallel communication. Put simply, it is many data lines with multiple bits sent back and forth simultaneously. Parallel interfaces are generally more expensive due to the higher number of I/O lines. They are commonly used for applications requiring high data throughput such as external memory and LCDs.  

Choosing the Right Communication Protocol 

In truth, there are likely many viable solutions for whatever application you may have. A typical microcontroller will always support I2C, SPI, and UART. If you are working with higher level industrial hardware, you are probably going to have Ethernet, RS-485, CAN, or a similar interface. While there are many factors to consider, it ultimately comes down to the application and its core requirements.  

Table 5: Serial Protocol Summary

Notes 

  1. The number of wires refers to signals, not GND. A wire for ground is always needed.  
  2. An asymmetric protocol has communication controlled by a master device 
  3. Synchronous- is there a clock signal or is the clock implicit? 
  4. 100 Gbps is used for data centers and telecom networks; however, home devices typically have hardware capable of 100Mbps or 1Gbps.

Additional References

https://www.omega.com/en-us/resources/rs422-rs485-rs232

https://www.ti.com/lit/ug/sprugp1/sprugp1.pdf

https://standards.ieee.org/beyond-standards/higher-ethernet-speed-smoother-data-transfer-and-increased-range

https://www.digikey.com/en/articles/decoding-the-usb-standards-from-1-to-4

The post A Quick Guide to Communication Protocols appeared first on Sparx Engineering.

]]>
https://sparxeng.com/blog/hardware/a-quick-guide-to-communication-protocols/feed 0