Week 6: Moo Concrete Deployment Cont. (Troubleshooting)

This past week was spent mostly updating the current Moo firmware and troubleshooting issues with the temperature and accelerometer sensor readings in preparation for the concrete deployment next week.  Originally, we had intended on modifying the software from the last deployment, which used a remote procedure call (rpc) command to toggle between three different applications: kill, beep, and read temperature.  However, after struggling for several days to get the firmware to successfully report back the accelerometer (and temperature) readings via the 2B data field (known as ackReply), we decided to completely change direction with how we programmed the Moo devices.  After a string of emails between Ben, Shane, and Andres, I requested a meeting to iron out some of the details that may have been lost over email communication.

Mike and I worked on adding functionality to toggle the accelerometer and external temperature sensors directly by using the existing application (SENSOR_DATA_IN_ID) and calling a new sensor header file (sensor.h) which includes the required functionality to initialize, read, and sample both of these sensors.  After gaining access to the Umassmoo GitHub page, we created a new branch (Moo_Concrete_MI) and committed all of our changes directly to the online repository.  A link to the GitHub branch with the most up-to-date version of the software can be found here.  Note that this software was modified from the software used to run the “Saturn Demo”.  Some superficial changes were made to the Impinj Reader Software Application in order for reader to interpret the 12-bit ADC values correctly.  Using the sensor_counter along with a simple modulus operation, we were able to achieve the toggling function in a few lines of code.  The appropriate sensor data is then sent back via the EPC directly (6 B of data for accelerometer and 2B for temperature).  The first byte indicates the sensor type (0x0B for Accelerometer and 0x0F for external temp sensor).  Though this solution is slightly less elegant than sending a rpc command directly to the Moo device, it requires less memory overhead and results in a significantly better tag rate at short distances from the reader.  Since the concrete will increase attenuation of the signal from the reader, it is very important that we keep the communication between the reader and the Moo devices simple to avoid excess energy consumption.

After logging some “noisy” temp data from the Moo devices, I did some further investigating to figure out some of the sources of the sensor variations and why they seemed to be inconsistent between trials.  I found that the temp Data appeared different if one were to vary the tag rate (i.e. distance from the reader) or step-through the code with the JTAG Debugger.  This led me to further probe several of the pins on the Moo device in order to get to the root of the problem.  Using the Fluke multimeter, I looked at Vreg, Vout, and Temp_Data_Analog to see if these voltages were consistent between experiments.

Below are a list of peculiarities that may need to be addressed in future revisions of the hardware and/or software.

1. Vreg (i.e. output of the voltage regulator) operates at 3.4 V when the JTAG Debugger is connected as opposed to it’s regulated value of 1.8 V when powered strictly by the reader.  Even when changing the configuration of the jumper on the Moo header board, Vreg remains at around 2.8 – 3.0 V when the JTAG device is plugged in.  This will likely cause some variations in the sensor readings (due to multiple power levels) and overall performance of the Moo devices when plugged in.  In order to minimize variations between the plugged-in vs. reader-powered performances of the Moo, we should consider connecting the JTAG (3.4 V) power supply to Vout (i.e. input to the regulator) as opposed to the regulator output directly.  This will allow the regulator to step-down the voltage to 1.8V for the MCU and sensor periphals (hence keeping the operation more consistent).

2. The MSP430 Chip supports an internal Voltage reference of either 2.5V or 1.5V that can be configured via the software and used to keep ADC and sensor readings consistent.  However, I noticed that originally the External Temperature Sensor function (adapted from quick_accel_sensor.h) was set to use the 2.5V volt reference instead of the 1.5V for ADC sampling.  This poses a problem because the functionality (and hence temp sensor data) will be different based on whether or not the JTAG device is plugged in (i.e. the power supply of the MCU changes).  I was able to confirm these differences using some simple math (NADC = 4095 * Vsense/Vref), and modified the code to work with the 1.5V reference generator in order to keep the measurements more consistent.  Note: A 2.5V reference generator will likely get clipped to the voltage supply (Vss = Vref = 1.8V) on the chip and not return a consistent measurement.  I fixed this problem by making a simple modification to the temp sensor code.

3. In the user manual for the MSP430 chip, it mentions that a 10 uF cap in parallel with a 0.1 uF cap should be connected between Vref and AVss- on the chip in order to keep the internally generated voltage more stable.  I did not see this cap present on the schematic and/or PCB board.  While I do not find it to be of critical importance, we should make sure to include this on the next generation of the Moo.

I also spent some time last week modifying the sensor.c file to sample from the internal temperature sensor on the MSP430.  The code was adapted from the int_temp_sensor.h file found on Hong’s old computer.  However, I was not able to get the code to run correctly.  Specifically, the code gets stuck in a infinite loop waiting for the ADC to sample the voltage from the ADC and set the ADC12BUSY pin low.  I have requested a copy of the internal temp sensor code that was used by Ben in the past.

I performed some thermal chamber experiments to help further validate (and/or calibrate) the external temperature sensor on the Moo devices.  I placed the Reader Antenna and Moo device directly in the chamber and swept the temperature from 25 deg C to 60 deg C with a rate of 3 deg C/min and let the device cool back down to room Temp.  The details of the experiment can be found below along with a plot of the data.  As can been seen from the plot, the ADC value (and hence voltage) do indeed decrease as the sensor is heated up.  This agrees with the temp sensor spec sheet provided here.  From the ADC value I was able to to calculate the analog voltage of the temp sensor using the equation: V_temp_analog = 1.5 * ADC_Value/ 4095 and then calculate the expected temperature using the look-up table provided in the spec sheet (using the lowest gain setting).  At 26 deg C and 60 deg C, I found that the expected temp agreed with the actual temperature with less than 2 deg error.

Thermal Chamber Experiment

thermal chamber plot

Next Steps to be completed before Deployment

1. validate all working Moo devices with latest firmware.  Make sure to flash devices with correct serial # (change MOO_ID in mymoo.h to correspond to correct tag identifier listed on device).

2. re-solder antennas onto semi-working (yellow) Moo devices and retest functionality.  record results in google doc.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s