## Lost Secrets of the H-Bridge, Part III: Practical Issues of Inductor and Capacitor Ripple Current

We've been analyzing the ripple current in an H-bridge, both in an inductive load and the DC link capacitor. Here's a really quick recap; if you want to get into more details, go back and read part I and part II until you've got equations coming out of your ears. I promise there will be a lot less grungy math in this post. So let's get most of it out of the way:

Switches QAH and QAL are being turned on and off with pulse-width modulation (PWM), to produce an average voltage DaVdc on...

## Lost Secrets of the H-Bridge, Part II: Ripple Current in the DC Link Capacitor

In my last post, I talked about ripple current in inductive loads.

One of the assumptions we made was that the DC link was, in fact, a DC voltage source. In reality that's an approximation; no DC voltage source is perfect, and current flow will alter the DC link voltage. To analyze this, we need to go back and look at how much current actually is being drawn from the DC link. Below is an example. This is the same kind of graph as last time, except we added two...

## Lost Secrets of the H-Bridge, Part I: Ripple Current in Inductive Loads

So you think you know about H-bridges? They're something I mentioned in my last post about signal processing with Python.

Here we have a typical H-bridge with an inductive load. (Mmmmm ahhh! It's good to draw by hand every once in a while!) There are four power switches: QAH and QAL connecting node A to the DC link, and QBH and QBL connecting node B to the DC link. The load is connected between nodes A and B, and here is represented by an inductive load in series with something else. We...

## Adventures in Signal Processing with Python

Author’s note: This article was originally called Adventures in Signal Processing with Python (MATLAB? We don’t need no stinkin' MATLAB!) — the allusion to The Treasure of the Sierra Madre has been removed, in deference to being a good neighbor to The MathWorks. While I don’t make it a secret of my dislike of many aspects of MATLAB — which I mention later in this article — I do hope they can improve their software and reduce the price. Please note this...

## Implementation Complexity, Part II: Catastrophe, Dear Liza, and the M Word

In my last post, I talked about the Tower of Babel as a warning against implementation complexity, and I mentioned a number of issues that can occur at the time of design or construction of a project.

The Tower of Babel, Pieter Bruegel the Elder, c. 1563 (from Wikipedia)

Success and throwing it over the wallOK, so let's say that the right people get together into a well-functioning team, and build our Tower of Babel, whether it's the Empire State Building, or the electrical grid, or...

## Implementation Complexity, Part I: The Tower of Babel, Gremlins, and The Mythical Man-Month

I thought I'd post a follow-up, in a sense, to an older post about complexity in consumer electronics I wrote a year and a half ago. That was kind of a rant against overly complex user interfaces. I am a huge opponent of unnecessary complexity in almost any kind of interface, whether a user interface or a programming interface or an electrical interface. Interfaces should be clean and simple.

Now, instead of interface complexity, I'll be talking about implementation complexity, with a...

## Isolated Sigma-Delta Modulators, Rah Rah Rah!

I recently faced a little "asterisk" problem, which looks like it can be solved with some interesting ICs.

I needed to plan out some test instrumentation to capture voltage and current information over a short period of time. Nothing too fancy, 10 or 20kHz sampling rate, about a half-dozen channels sampled simultaneously or near simultaneously, for maybe 5 or 10 seconds.

Here's the "asterisk": Oh, by the way, because the system in question was tied to the AC mains, I needed some...

## Oscilloscope review: Hameg HMO2024

Last year I wrote about some of the key characteristics of oscilloscopes that are important to me for working with embedded microcontrollers. In that blog entry I rated the Agilent MSOX3024A 4-channel 16-digital-input oscilloscope highly.

Since then I have moved to a different career, and I am again on the lookout for an oscilloscope. I still consider the Agilent MSOX3024A the best choice for a...

## How to Estimate Encoder Velocity Without Making Stupid Mistakes: Part I

Here's a common problem: you have a quadrature encoder to measure the angular position of a motor, and you want to know both the position and the velocity. How do you do it? Some people do it poorly -- this article is how not to be one of them.

Well, first we need to get position. Quadrature encoders are incremental encoders, meaning they can only measure relative changes in position. They produce a pair of pulse trains, commonly called A and B, that look like...

## Chebyshev Approximation and How It Can Help You Save Money, Win Friends, and Influence People

Well... maybe that's a stretch. I don't think I can recommend anything to help you win friends. Not my forte.

But I am going to try to convince you why you should know about Chebyshev approximation, which is a technique for figuring out how you can come as close as possible to computing the result of a mathematical function, with a minimal amount of design effort and CPU power. Let's explore two use cases:

- Amy has a low-power 8-bit microcontroller and needs to compute \( \sqrt{x} \)...

## Have You Ever Seen an Ideal Op-Amp?

Somewhere, along with unicorns and the Loch Ness Monster, lies a small colony of ideal op-amps. Op-amp is short for operational amplifier, and we start our education on them by learning about these mythical beasts, which have the following properties:

- Infinite gain
- Infinite input impedance
- Zero output impedance

And on top of it all, they will do whatever it takes to change their output in order to make their two inputs equal.

But they don't exist. Real op-amps have...

## How to Succeed in Motor Control: Olaus Magnus, Donald Rumsfeld, and YouTube

Almost four years ago, I had this insight — we were doing it wrong! Most of the application notes on motor control were about the core algorithms: various six-step or field-oriented control methods, with Park and Clarke transforms, sensorless estimators, and whatnot. It was kind of like a driving school would be, if they taught you how the accelerator and brake pedal worked, and how the four-stroke Otto cycle works in internal combustion engines, and handed you a written...

## Linear Feedback Shift Registers for the Uninitiated, Part XI: Pseudorandom Number Generation

Last time we looked at the use of LFSRs in counters and position encoders.

This time we’re going to look at pseudorandom number generation, and why you may — or may not — want to use LFSRs for this purpose.

But first — an aside:

Science Fair 1983When I was in fourth grade, my father bought a Timex/Sinclair 1000. This was one of several personal computers introduced in 1982, along with the Commodore 64. The...

## Oscilloscope review: Hameg HMO2024

Last year I wrote about some of the key characteristics of oscilloscopes that are important to me for working with embedded microcontrollers. In that blog entry I rated the Agilent MSOX3024A 4-channel 16-digital-input oscilloscope highly.

Since then I have moved to a different career, and I am again on the lookout for an oscilloscope. I still consider the Agilent MSOX3024A the best choice for a...

## Linear Feedback Shift Registers for the Uninitiated, Part X: Counters and Encoders

Last time we looked at LFSR output decimation and the computation of trace parity.

Today we are starting to look in detail at some applications of LFSRs, namely counters and encoders.

CountersI mentioned counters briefly in the article on easy discrete logarithms. The idea here is that the propagation delay in an LFSR is smaller than in a counter, since the logic to compute the next LFSR state is simpler than in an ordinary counter. All you need to construct an LFSR is

## 10 More (Obscure) Circuit Components You Should Know

The interest in my previous article on obscure but useful electronics parts, "10 Circuit Components You Should Know" was encouraging enough that I thought I would write a followup. So here are another 10:

1. "Ideal Diode" controllers

Load-sharing circuits use diodes tied together at their cathode terminal to take the most positive voltage among the sources and connect it to a load. Works great: you have a DC/DC power supply, a battery, and a solar cell, and it will use whichever output is...

## April is Oscilloscope Month: In Which We Discover Agilent Offers Us a Happy Deal and a Sad Name

Last month I wrote that March is Oscilloscope Month, because Agilent had a deal on the MSOX2000 and MSOX3000 series scopes offering higher bandwidth at lower prices. I got an MSOX3034 oscilloscope and saved my company $3500! (Or rather, I didn't save them anything, but I got a 350MHz scope at a 200MHz price.)

The scope included a free 30-day trial for each of the application software modules. I used my 30-day trial for the serial decode + triggering module, to help debug some UART...

## Another 10 Circuit Components You Should Know

It's that time again to review all the oddball goodies available in electronic components. These are things you should have in your bag of tricks when you need to design a circuit board. If you read my previous posts and were looking forward to more, this article's for you!

1. Bus switches

I can't believe I haven't mentioned bus switches before. What is a bus switch?

There are lots of different options for switches:

- mechanical switch / relay: All purpose, two...

## Modulation Alternatives for the Software Engineer

Before I get to talking about modulation, here's a brief diversion.

A long time ago -- 1993, to be precise -- I took my first course on digital electronics and processors. In that class, we had to buy a copy of the TTL Data Book* from Texas Instruments.

If you have any experience in digital logic design you probably know that TTL stands for Transistor-transistor logic (thereby making the phrase "TTL Logic" an example of RAS...

## Thoughts on Starting a New Career

I recently completed a 16-year stint at an engineering company. I started there fresh out of college in June 1996. This June I just started a new career as an applications engineer in the area of motor drives at Microchip Technology in Chandler, Arizona. The experience I had in switching jobs was a very enlightening one for me, and has given me an opportunity to reflect on my career. I want to share some of that reflection with you.

Disclaimer: the opinions expressed in this and other blogs...

## Oh Robot My Robot

Oh Robot! My Robot! You’ve broken off your nose! Your head is spinning round and round, your eye no longer glows, Each program after program tapped your golden memory, You used to have 12K, now there is none that I can see, Under smoldering antennae, Over long forgotten feet, My sister used your last part: The chip she tried to eat.

Oh Robot, My Robot, the remote controls—they call, The call—for...

## Linear Feedback Shift Registers for the Uninitiated, Part III: Multiplicative Inverse, and Blankinship's Algorithm

Last time we talked about basic arithmetic operations in the finite field \( GF(2)[x]/p(x) \) — addition, multiplication, raising to a power, shift-left and shift-right — as well as how to determine whether a polynomial \( p(x) \) is primitive. If a polynomial \( p(x) \) is primitive, it can be used to define an LFSR with coefficients that correspond to the 1 terms in \( p(x) \), that has maximal length of \( 2^N-1 \), covering all bit patterns except the all-zero...

## Linear Feedback Shift Registers for the Uninitiated, Part XIV: Gold Codes

Last time we looked at some techniques using LFSR output for system identification, making use of the peculiar autocorrelation properties of pseudorandom bit sequences (PRBS) derived from an LFSR.

This time we’re going to jump back to the field of communications, to look at an invention called Gold codes and why a single maximum-length PRBS isn’t enough to save the world using spread-spectrum technology. We have to cover two little side discussions before we can get into Gold...

## The Dilemma of Unwritten Requirements

You will probably hear the word “requirements” at least 793 times in your engineering career, mostly in the context of how important it is, in any project, to agree upon clear requirements before committing to (and hastily proceeding towards) a deadline. Some of those times you may actually follow that advice. Other times it’s just talk, like how you should “wear sunscreen when spending time outdoors” and “eat a diet low in saturated fats and...

## Linear Feedback Shift Registers for the Uninitiated, Part XI: Pseudorandom Number Generation

Last time we looked at the use of LFSRs in counters and position encoders.

This time we’re going to look at pseudorandom number generation, and why you may — or may not — want to use LFSRs for this purpose.

But first — an aside:

Science Fair 1983When I was in fourth grade, my father bought a Timex/Sinclair 1000. This was one of several personal computers introduced in 1982, along with the Commodore 64. The...

## Efficiency Through the Looking-Glass

If you've ever designed or purchased a power supply, chances are you have had to work with efficiency calculations. I can remember in my beginning electronic circuits course in college, in the last lecture when the professor was talking about switching power converters, and saying how all of a sudden you could take a linear regulator that was 40% efficient and turn it into a switching regulator that was 80% efficient. I think that was the nail in the coffin for any plans I had to pursue a...

## Implementation Complexity, Part II: Catastrophe, Dear Liza, and the M Word

In my last post, I talked about the Tower of Babel as a warning against implementation complexity, and I mentioned a number of issues that can occur at the time of design or construction of a project.

The Tower of Babel, Pieter Bruegel the Elder, c. 1563 (from Wikipedia)

Success and throwing it over the wallOK, so let's say that the right people get together into a well-functioning team, and build our Tower of Babel, whether it's the Empire State Building, or the electrical grid, or...

## Linear Feedback Shift Registers for the Uninitiated, Part XII: Spread-Spectrum Fundamentals

Last time we looked at the use of LFSRs for pseudorandom number generation, or PRNG, and saw two things:

- the use of LFSR state for PRNG has undesirable serial correlation and frequency-domain properties
- the use of single bits of LFSR output has good frequency-domain properties, and its autocorrelation values are so close to zero that they are actually better than a statistically random bit stream

The unusually-good correlation properties...

## Linear Feedback Shift Registers for the Uninitiated, Part XVII: Reverse-Engineering the CRC

Last time, we continued a discussion about error detection and correction by covering Reed-Solomon encoding. I was going to move on to another topic, but then there was this post on Reddit asking how to determine unknown CRC parameters:

I am seeking to reverse engineer an 8-bit CRC. I don’t know the generator code that’s used, but can lay my hands on any number of output sequences given an input sequence.

This is something I call the “unknown oracle”...

## Linear Feedback Shift Registers for the Uninitiated, Part VI: Sing Along with the Berlekamp-Massey Algorithm

The last two articles were on discrete logarithms in finite fields — in practical terms, how to take the state \( S \) of an LFSR and its characteristic polynomial \( p(x) \) and figure out how many shift steps are required to go from the state 000...001 to \( S \). If we consider \( S \) as a polynomial bit vector such that \( S = x^k \bmod p(x) \), then this is equivalent to the task of figuring out \( k \) from \( S \) and \( p(x) \).

This time we’re tackling something...