## 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} \)...

## 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...

## Linear Feedback Shift Registers for the Uninitiated, Part IV: Easy Discrete Logarithms and the Silver-Pohlig-Hellman Algorithm

Last time we talked about the multiplicative inverse in finite fields, which is rather boring and mundane, and has an easy solution with Blankinship’s algorithm.

Discrete logarithms, on the other hand, are much more interesting, and this article covers only the tip of the iceberg.

What is a Discrete Logarithm, Anyway?Regular logarithms are something that you’re probably familiar with: let’s say you have some number \( y = b^x \) and you know \( y \) and \( b \) but...

## Hot Fun in the Silicon: Thermal Testing with Power Semiconductors

Here's a trick that is useful the next time you do thermal testing with your MOSFETs or IGBTs.

Thermal testing?!

Yes, that's right. It's important to make sure your power transistors don't overheat. In the datasheet, you will find some information that you can use to estimate how hot the junction inside the IC will get.

Let's look at an example. Here's a page from the IRF7739 DirectFET datasheet. I like this datasheet because it has almost all the thermal stuff on one page,...

## Stairway to Thévenin

This article was inspired by a recent post on reddit asking for help on Thévenin and Norton equivalent circuits.

(With apologies to Mr. Thévenin, the rest of the e's that follow will remain unaccented.)

I still remember my introductory circuits class on the subject, roughly as follows:

(NOTE: Do not get scared of what you see in the rest of this section. We're going to point out the traditional approach for teaching linear equivalent circuits first. If you have...

## 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...

## 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...

## 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 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...

## 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...

## 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...

## 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...

## R1C1R2C2: The Two-Pole Passive RC Filter

I keep running into this circuit every year or two, and need to do the same old calculations, which are kind of tiring. So I figured I’d just write up an article and then I can look it up the next time.

This is a two-pole passive RC filter. Doesn’t work as well as an LC filter or an active filter, but it is cheap. We’re going to find out a couple of things about its transfer function.

First let’s find out the transfer function of this circuit:

Not very...

## 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...

## 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...

## 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...

## 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...

## 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...

## 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”...

## Hot Fun in the Silicon: Thermal Testing with Power Semiconductors

Here's a trick that is useful the next time you do thermal testing with your MOSFETs or IGBTs.

Thermal testing?!

Yes, that's right. It's important to make sure your power transistors don't overheat. In the datasheet, you will find some information that you can use to estimate how hot the junction inside the IC will get.

Let's look at an example. Here's a page from the IRF7739 DirectFET datasheet. I like this datasheet because it has almost all the thermal stuff on one page,...