Built into the LPC55S69 is a powerful coprocessor called the “PowerQuad”. In this article we are going to introduce the PowerQuad and some interesting use cases. Over the next several weeks we will look at using some of the different processing elements in the PowerQuad using the “Mini-Monkey” board.
Figure 1: NXP PowerQuad Signal Processing Engine
The PowerQuad is a dedicated hardware unit that runs in parallel to the main Cortex M33 cores inside the LPC55S69. By using the PowerQuad to work in parallel to the main CPU, it is possible to implement sophisticated signal processing algorithms while leaving your main CPU(s) available to do other tasks such as communication and IO. This is a very import use case in distributed sensor systems and the Industrial Internet of the Things (IIOT). Over the next several weeks, I am going to show some practical aspects of using the PowerQuad in some various applications. I feel it is a very good fit for many tightly embedded applications need a combination of the general-purpose processing, IO, and dedicated signal processing while maintain a very low active power profile.
Embedded Systems, Sensors and Signal Processing
Before we get started, I think it is helpful to review some concepts and explain why some of the functions of the PowerQuad are useful. Even though many engineers may have learned about Digital Signal Processing (DSP) in college or university, there is often little connection to real hardware and code. Many introductions to DSP begin with formal explanations (i.e. heavy math!). While this formalism is important for developing the underlying algorithms, it is easy to get lost when trying to make something work. As an example, one of core algorithms to many DSP applications is the Fast Fourier Transform. It can be difficult for one to understand to how use at a black box level software if all you have ever worked with was the mathematical formalism. Being able to link the formalizing with real application is where real magic can happen! In these upcoming articles, I will break down what is actually happening in the code so it is a bit easier to use the PowerQuad hardware.
For an overwhelming majority of sensor and industrial IOT applications, we encounter “time series” data. By time series, all we mean is that we take some sort of measurement at a constant interval and put the recorded data into a bucket. We might process this data one sample at a time as it comes in or wait to our bucket fills up to a level before working with the information. A key feature here is that we have some measurement (temperature, pressure, voltage level) that is captured fixed rate. What we end up with is a data set that spans some amount of “time”. We do not have infinite resolution in the measurement “amplitude” nor can we take measurements infinitely fast. For example, if we take voltage readings over time, our “step” size might be 1milli-second with 1milli-volt resolution in our amplitude. The details of how fast and with how much precision is application dependent.
Figure 2: A Time Series Cartoon
In Figure 3, notice that the "dots" are not connected to indicate that we have a discrete set of data. Many times we fill in the space between the dots on a chart to get a better visualiztion of the signal but what we have to work with is a discrete bucket of data.
Let’s take a look at an example using the LPC55S69 on the “Mini-Monkey”. The Mini-Monkey circuit has a digital microphone connected via an I2S interface to the MCU and a 240x240 pixel display connection via SPI. Using the display, we can visualize the time series (my voice). As a demonstration, I grabbed of a bucket of 256 samples from the microphone via the I2S interface and rendered raw time series data on the display. The microphone on the Mini-Monkey (Knowles Acoustic SPH0645LM4H-B) was setup to output data at a rate of 32KHz. The resolution in amplitude from this device is 18-bits. Since my OLED screen is 240 pixels high, I divided down the amplitude of the samples so they would fit.
Here is an animated .gif of the result:
A video with corresponding audio:
All I am doing is collecting data into "buffer" and then continually displaying the information on the screen. It is an easy way to visualize what is going on. Now, instead of a using microphone measuring acoustic pressure, you could sample something else. A velocity measurement, a voltage signal, etc. The time series data set is your starting point. Now it is time to start doing something with the numbers and that is where PowerQuad can help. Most signal processing algorithms boil down to simple, repetitive operations over arrays of data. Just about everything can be boiled down to a multiplication and add. This is why you may have heard quite a bit about multiply and accumulate units (MAC) in DSP engines. It is a ideal use case for a coprocessor.
The PowerQuad at its core has the logic to handle the most common “building blocks”. Sometimes when you have a time series, you process the data in a manner to preserves all of the “time information”. Meaning, the get information out the “signal processing black box” that is still a set of datapoints correlated to some block of time. They just might be filtered or modified in some way. For example, maybe you have a a signal where you want to remove 60Hz noise. You might consider a digital FIR or IIR filter. Other times you “transform” your data into information that is “correlated” to something else, such as a rate or “frequency”. We will be exploring both of these application in future articles but the PowerQuad help with both of these use cases.
LPC55S69 PowerQuad Application - Machine Condition Monitoring
The LPC55S69 can bring in time series data via several interfaces. In this article I measured acoustic pressure with a digital MEMs microphone over a digital audio port (I2S). You could also take measurements with the analog to digital converter. For example, I have a little breakout board for an ADXL1001BCPZ accelerometer I built last year:
Figure 4: ADXL1001BCPZ Accelerometer Board (Left)
This ADXL1001BCPZ is high bandwidth accelerometer useful for machine monitoring and vibration analysis applications. Many common MEMS accelerometers do not have a high enough bandwidth to capture all the dynamic information in a vibrating system. The -3dB bandwidth of the ADXL1001 stretches to 11KHZ, making it ideal of vibration problems. Low-cost accelerometers used for simple motion detection and orientation have a very low bandwidth and may not be able to capture the dynamics you are looking for in a vibration application. Furthermore, many of the MEMs device that can measure in multiple axis do not have the same bandwidth and noise performance on all axes. We can use the internal ADC in the LPC55S69 to sample the accelerometer over time and build up a time series to understand how something is vibrating. While microphones can pick up sound traveling in air, accelerometers can be used to understand sound traveling through a physical structure. Using signal processing techniques, we even combine information from multiple sensors (measuring the same thing in different ways) to better understand a problem.
In the neck of the woods where I grew up, there were lots of experienced auto mechanics who could quickly identify problems without even opening the hood. The first method to debug a problem was to take the car for a drive or start the motor and “listen”. Many of these individuals were well trained could know exactly what an issue was is simply by listening. All mechanical systems vibrate. *How* they vibrate is dependent on their size, shape, material properties, and operating conditions. These mechanical vibrations couple to the air and we can “hear” what is going on. If you have some situational awareness of the mechanical system, you know how something *should* sound when the system is operating normally. If a component starts failing, the mechanical system changes and it will vibrate differently. Because the “boundary conditions” of the system changed, the nature of the sound produce changes. We can instrument the machine with sensors, say an accelerometer, and capture the time series. Using some math (DSP) and our a-priori knowledge of how the system is supposed to behave, it is possible to see predict failure before it occurs.
Our global industry is driven by large and expensive electro-mechanical machines. All the things we consider essential for life, say Oreo cookies and toilet paper, are produced in large factories with large, high dollar value processes. It makes absolute sense to automate the measurement and analysis of high value machines in as the money saved from unplanned downtime is incredible. The LPC55S69 can be a good fit for many “smart sensor” applications as it can be packed in tight spaces, consume little power and be able to do a 1st level data reduction at the sensor. Instead of transmiting large amounts of data from a system, the LPC55S69 can allow for significant signal processing to reduce a complex time series into other metrics that can be analyzed at an enterprise level to determine if a failure will occur. The LPC55S69 with the PowerQuad is a great fit for the Industrial IOT.
LPC55S69 PowerQuad Application - Power Line Communications and Metering
A completely different but interesting use-case for the LPC55S69 PowerQuad is Power Line Communications (PLC). There are many sensor applications where you need to transmit and receive data, but you only have access to DC or AC power lines. Many new smart meters attached to you home employ this technology. PLC uses sophisticated techniques such as Orthogonal Frequency Division Multiplexing (OFDM) to transmit data on a power line. OFDM is an interesting technique as it allows you to send data bits down a communications channel *in parallel* across several frequency bands. It is tolerant to noise as you can achieve high bit rates by using many parallel channels/bands where each band contains slowly moving data.
A core requirement of any OFDM solution is being able to compute Fast Fourier Transforms (FFT) in real time on an incoming time series. If you can efficiently compute an FFT, it is straightforward to encode/decode data on both the transmitting and receiving ends of the system. Using bins of the FFT, data is encoded using the real and imaginary components (amplitude and phase) to make up bits of a data "word". Once you encode data in the "bins", you can use an inverse FFT to get a time signal to output to a digital to analog converter. Decoding is essentially figuring out when you signal starts and then using an FFT to get the "bins". Once you have your frequency bins, you look at amplitude/phase information to reconstruct your data word.
Figure 5: OFDM Time Series, Frequency Domain Symbol Spectrum and QAM Symbols.
This is a gross simplification of the OFDM process but accelerators such as the PowerQuad are a key element to making it work The LPC55S69 is well suited to this particular application as most of the complexities of the algorithm could be implemented using the PowerQuad leaving your computational resources (such as the Cortex M33) to implement your metering and measurement application. All of this can be done while consuming very little active energy in a small package. At one time, you would have needed a power-hungry IC to perform this process.
Moving Forward with the PowerQuad
I hope you are now interested in some of use cases of the LPC55S69 and the PowerQuad engine. In the coming articles we can going to dive into some of the different aspects of the PowerQuad engine and demonstrate some processing on the Mini-Monkey platform. Stay tuned and feel free to check out the LPC55S69. And in case you missed it, here are some other LPC55S69 blogs/videos: