Internet Explorer is not a supported browser for TI.com. For the best experience, please use a different browser.
Video Player is loading.
Current Time 0:00
Duration 9:23
Loaded: 0%
Stream Type LIVE
Remaining Time 9:23
 
1x
  • Chapters
  • descriptions off, selected
  • en (Main), selected

The real implementation of the PCB looks like this. So we can recognize the two inductors with a 5 millimeter diameter, each, very close to each other, to be able to sit in front of the metal plate of the rotation disc.

And we have several SMD components really a small size 0402 and several connectors just to connect to a CC1350 launchpad or some other [? F06 ?] evolution port.

Here is how the LC-sensing circuitry operates. On the left, you can see the schematic of the two identical sensors, called LC-sensor1 and LC-sensor2. And we will sample them one after the other.

For this purpose, we will do an oscillation kick, where we send the negative pulse on the flow trigger pin on the left-hand side. Then we use the Comparator A, with a maximum sampling frequency of 1 megahertz, to measure a number of full oscillations, which passed the comparator threshold of 1.27 volt, which is an internal reference value available in the sensor controller engine.

Then we wait for a certain period of time, which can be adjusted. In our case, it's 30 microseconds. And then we check the TDC value, where we expect a number of approximately 2,400 or 2,500 ticks, where one tick is 10.67 nanoseconds.

If the number of oscillations wasn't achieved, the TDC will report back a value of 2, which is the dampened condition. So we measured the sensor 1 and then the sensor 2. And we create a L1L2 state, which we compare to a previous state, Lold1 and Lold2 which help us implement a simple state machine, which is also the case as a-- in a simple quadrature in code.

And of course, we need, also, to handle errors if we have some unallowed states like moving or jumping from a state 00 to 11. And we also need to handle some jitter, which means that sometimes, the state could jump back and forward. And this also needs to be taken care of. For example, when a water tap is closed, there will be a flow back from the water until the pressure is equalized.

If we look at the oscilloscope here for Sensor1 and Sensor2, we will see the blue line, which shows the oscillation. And the red line is the Comparator A threshold of 1.27 volts.

It is important to remember that, due to the inductors being so close to each other, they will influence each other as well, unless we ground the output of the second sensor while the first one is oscillating and vice versa. When we measure the second sensor, we need to make sure that the output of the first sensor is grounded. This is the only way to avoid interference between the Sensor1 and Sensor2 during the measurement.

There is a dedicated software tool, called Sensor Controller Studio, which is used to program and test the sensor controller engine. In this screenshot, you can see part of the implementation of the rotation detection. And on the right-hand side, the red circle is highlighting the ticks for Nonmetal1 and Nonmetal2.

So this will be the case if we have a undampened oscillation. In the case where metal is in front of the disc, this number will be just 2. So we have a very simple way to detect metal on nonmetal condition in front of the respective LCsensor or inductor.

Now let's have a look, quickly, at the essential functions in this software. The TDC is a clock block that we need to detect the number of full oscillations.

So here, we see a number of 19. So basically, we want to see 19 full oscillations if there is an undampened condition. We can also set the threshold, which is here seen as sensor threshold equals 5 on the top right, above the red circle. And this can also help us differentiate between a metal, nonmetal if the attenuation is not strong enough to reduce it down to 2.

By detecting a state of metal on nonmetal, we can simply create a state machine. So for one sensor, we will have a signal high or signal low or signal means metal on nonmetal. And if we add the second sensor, we will have the blue line, which will show the similar curve, but obviously delayed by the rotation of the disc.

And it is very important that here, in the middle, we have a high condition for both sensors. So basically, both inductors should report metal in front of them. Only then, we can build a simple [? quadrature ?] called a signal and, using a state machine, detect the rotation and the direction of this rotation.

Here's the state machine diagram for Sensor1 and Sensor2. We start the condition as 0 on top, with the right line circle. So this is our condition 00 or both inductors are nonmetal. And then if we have no change in condition, we stay at the same position.

But if the disc starts turning, we will move from S0 to state S1, to the right, clockwise direction. Because we will move, now the metal will be turning and will be in front of the first sensor.

If we continue turning in the same direction, we will have the two sensors in front of the metal, which means we're in State S2 at the bottom middle. And we have 11 as the state.

And then, turning in the same direction, we will have State 3, where the second sensor will see metal, but the first one will see nonmetal. And this, of course, works in anti-clockwise direction as well. And these are the numbers being shown here.

So we have the four states. And the starting point is the previous state condition for the LC-sensor1 and 2. The movement around the state diagram is the result of the current measured states.

And after [INAUDIBLE] the LC-sensor1 and 2, we move to the new state. And then we move the values, which we just measured, to become the previous state. And we start the process from the beginning.

We have seen, already, the Sensor Controller Engine Code for the CC1350 device. But it really only programs the controller block. And now, to be able to use the radio and the sensor controller engine, we need the software code to control the full device, which is the CC1350 wireless MCU.

So a complete example code in C, on the Code Composer Studio 7, has been developed. This code also is based on the TI RTOS operating system, version 2.21.

And to be able to do measurements with different sampling frequency, the adjustments can be done in this Code Composer Studio project. An example for the 16 samples per second is given here, in blue. And if we want to do 64 samples per second, please remember one sample means we're checking the two sensors, one after the other. Then there is the line in green, here, which shows a commented out command line.

Then, after doing the measurement, we have an adjustable parameter, where every 200 or 400, or any other number of samples, the sensor controller will report the value it has measured to the Cortex-M3 core on the device. And the application will read out the number of turns.

This number of turns will be, then, used and encoded into our C-mode Wireless M-Bus packet and periodically transmitted over the air at 868.95 megahertz.

Thanks for your attention.

This video is part of a series