Prop Shield Beta Test

Status
Not open for further replies.
@Wozzy - is this your problem from post #211?

Yes... I definitely missed that (setting Pin 7 high to enable the shields 5V buffers) when looking at the diagram.
I can't wait to get home to try it out.
 
Last edited:
Maybe just create the PDF version and include a small piece of paper with the link might suffice for the first batch? I think it's pretty important to convey information such as the "enable" pins and how to hook up the speaker (no gnd connection) and how many LEDs maximum with USB-power...
There is lots of good information and ideas scattered through this thread, it might be helpful, if there was some summary like posting, like updates to posting #1, which gives hints, like:

Download the following libraries...

To try out Speaker, connect ... And test programs for speaker are at ...

How to use the APA102...

Again great stuff!
 
+1 KurtE - perhaps best saved for a shield released thread, with first post holding this info (in lieu of a wiki). I imagine, however, that this would actually be all in the shield webpage when it goes up, with all of the gotcha captured from this thread and nicely distilled in a single coherent 'how to get this shield working' page.
 
... that this would actually be all in the shield webpage when it goes up, with all of the gotcha captured from this thread and nicely distilled in a single coherent 'how to get this shield working' page.

Yes, exactly. I was planning to start the page this weekend, after another round or two of improvements to the calibration app.
 
So yes, just ran the previous APA102 orientation sketch with pinmode(7, OUTPUT) and digitalWrite(7,HIGH) in setup, and 5DCG connections work (of course they do!). They are useable as expected with declaring pins 11 and 13. the sketch below uses the orientation sketch and outputs direction indicator. I left pin 7 high for the whole program.
Code:
#include <NXPMotionSense.h>
#include <Wire.h>
#include <EEPROM.h>
#include <FastLED.h>

#define NUM_LEDS 11 //number of leds in strip length on one side
#define DATA_PIN 11
#define CLOCK_PIN 13
CRGB leds[NUM_LEDS];


NXPMotionSense imu;
NXPSensorFusion filter;

void setup() {
  Serial.begin(9600);
  imu.begin();
  filter.begin();
    // FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN>(leds, NUM_LEDS);
     FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
    pinMode(7, OUTPUT); 
     digitalWrite(7, HIGH);
}

void loop() {
  float ax, ay, az;
  float gx, gy, gz;
  float mx, my, mz;
  float roll, pitch, heading;

  if (imu.available()) {
    // Read the motion sensors
    imu.readMotionSensor(ax, ay, az, gx, gy, gz, mx, my, mz);

    // Update the SensorFusion filter
    filter.update(gx, gy, gz, ax, ay, az, mx, my, mz);
  }

 //   roll = filter.getRoll();
 //   pitch = filter.getPitch();
    heading = filter.getYaw();
  
  if(heading<(-1)){
  for (int x=0;x<4;x++){
       leds[x]=CRGB(0,55,255);
     FastLED.show();
    }
}
  if(heading>(1)){
  for (int x=7;x<11;x++){
       leds[x]=CRGB(200,155,0);
     FastLED.show();
    }
}
if(heading>(-1)&& heading<1){
  for (int x=5;x<7;x++){
       leds[x]=CRGB(0,155,0);
     FastLED.show();
    }  
}

  for (int x=0;x<NUM_LEDS;x++){
       leds[x]=CRGB(0,0,0);
     FastLED.show();
    }
}


// Decide when to print
bool readyToPrint() {
  static unsigned long nowMillis;
  static unsigned long thenMillis;

  // If the Processing visualization sketch is sending "s"
  // then send new data each time it wants to redraw
  while (Serial.available()) {
    int val = Serial.read();
    if (val == 's') {
      thenMillis = millis();
      return true;
    }
  }
  // Otherwise, print 8 times per second, for viewing as
  // scrolling numbers in the Arduino Serial Monitor
  nowMillis = millis();
  if (nowMillis - thenMillis > 125) {
    thenMillis = nowMillis;
    return true;
  }
  return false;
}
 
BUT.... prop shield does NOT fit on octows2811 adapter board on top side using standard female header adapters. Its about 3mm too long - i have my shield bottom mounted. oh no..
 
Does anyone know the maximum current @ 5V the PropShield can pass through to the 5DCG APA102 port?
I've been using an external 5V power supply, with the ground tied to the Propshield/Teensy3.1, to power the LED strip, but I'm guessing that the idea is to connect directly to the 5DCG APA102 port.
Thanx
 
@Paul

The I2C part of the Gyro is working just not the sensor part. Your library checks that anyway. But in any case here is the output of the Scanner as requested.

Code:
Scanning...
Device found at address 0x1E  (LSM303D,HMC5883L,FXOS8700,LIS3DSH)
Device found at address 0x20  (MCP23017,MCP23008,FXAS21002)
Device found at address 0x60  (MPL3115,MCP4725,MCP4728,TEA5767,Si5351)
done

The fact that the AMP was never working on arrival, and the gyro was working but then stopped, makes me wonder if something happened to it during transit, or I just got unlucky with a duff board.
 
Just tried out my strand of 60 APA102s... First test failed... My strand came with connectors on one side, so I tried using them,

Problem was, the connector was on the Output side not input side :eek:, so it failed. So added connection to other end, now it is working.

Also side note: the 4 pin connector on the shield does not have the same order of signals (VCC, DATA, CLOCK, GND) that is on the APA strand (VCC, CI, DI, GND).

The Strand test now works (after telling IO Pin 7 to go high). Morton's program does something, not sure yet what, but does change as I move the board


Kurt
 
The fact that the AMP was never working on arrival, and the gyro was working but then stopped

My amp doesn't work either, or rather is makes buzzing and popping noises but no talkie sound out.

At least my gyro works... so far.
 
FWIW - Mine works.
I've put hours on my AMP and it is working well from +/- 0.5W speaker and headphone. it is fully socketed to a T_3.2. I have not used the APA102 pins. Just did flash erase and hardware test and reprinted the same calibration data. Also my GYRO is giving good data to IMU with Calibrate, and the here is my just updated Calibration print - followed by Flash erase,test.

<edit>: Only minor Oddity is the IMU app won't pick up Serial sometimes. I can select, unselect, see data on TYQT then disable TYQT Monitor and IMU won't get data until I reset the unit and reconnect IMU app. And when IMU won't show data it does have the port because TYQT cannot get it (Winodws10).

Magnetic Calibration
Hard Iron Offset
37.12
14.83
117.04

Soft Iron Mapping
1.0112 -0.0082 -0.0173
-0.0082 0.9917 0.0323
-0.0173 0.0323 0.9986
Flash Memory has 8388608 bytes.
Erasing ALL Flash Memory:
estimated wait: 20 seconds.
Yes, full chip erase is SLOW!
...................
Erase completed
actual wait: 19 seconds.
Raw SerialFlash Hardware Test

Read Chip Identification:
JEDEC ID: EF 40 17
Part Nummber: W25Q64FV
Memory Size: 8388608 bytes
Block Size: 65536 bytes

Reading Chip...

Writing 4096 signatures

Double Checking All Signatures:
all 4096 signatures read ok

Checking Signature Pairs
all 2047 signature pairs read ok

Checking Read-While-Write (Program Suspend)
write 256 bytes at 256
write time was 441 microseconds.
read-while-writing: 00 00 00 00 15 F5 95 4B
test passed, good read while writing

Checking Read-While-Erase (Erase Suspend)
erase time was 166322 microseconds.
erase correctly erased 65536 bytes
read-while-erasing: 00 00 00 00 15 F5 95 4B
test passed, good read while erasing

All Tests Passed :)

Test data was written to your chip. You must run
EraseEverything before using this chip for files.
 
Last edited:
I tried to investigate why my Prop Shield shows drift and had a look at the raw gyro output provided by
Code:
void readMotionSensor(float& ax, float& ay, float& az, float& gx, float& gy, float& gz)
and wrote this to get a moving average to see the offset:

Code:
#include <NXPMotionSense.h>

NXPMotionSense imu;
const int ledPin = 13;
int ledState = LOW;
elapsedMillis ledMillis = 0;
elapsedMillis serialMillis = 0;

void setup() {
  Serial.begin(115200);
  while (!Serial) ; // wait for serial port open
  imu.begin();
  pinMode(ledPin, OUTPUT);
}

float movingAverage[3];
void loop() {
  float gyro[3]; //gyro data in order x y z
  float dummy; //a dummy int where readMotionSensor can dump the accel data


  // get data
  if (imu.available()) {
    imu.readMotionSensor(dummy, dummy, dummy, gyro[0], gyro[1], gyro[2]);
	//recalculate averages
	for (int i=0 ; i<3 ; i++) {
		movingAverage[i] = movingAverage[i]*0.999f + gyro[i]*0.001f;
	}
  }
  //print to serial
  if (serialMillis >= 500) {
	  serialMillis -= 500;
	  Serial.print(movingAverage[0], 5);
	  Serial.print(", ");
	  Serial.print(movingAverage[1], 5);
	  Serial.print(", ");
	  Serial.print(movingAverage[2], 5);
	  Serial.println("");
  }
  
  //blink LED
  if (ledMillis >= 1000) {
	ledMillis -= 1000;
	if (ledState == LOW) digitalWrite(ledPin, ledState = HIGH);
	else digitalWrite(ledPin, ledState = LOW);
  }
}

my output after some time:
Code:
-0.84893, 0.86430, -0.09326
-0.84667, 0.86420, -0.09219
-0.84867, 0.86518, -0.09173
-0.84748, 0.86680, -0.09283
-0.84604, 0.86525, -0.09367
-0.84852, 0.86463, -0.09165
-0.84878, 0.86428, -0.09439
-0.85037, 0.86443, -0.09540
-0.85026, 0.86683, -0.09417
-0.85017, 0.86826, -0.09538
-0.85107, 0.86773, -0.09533
-0.85257, 0.86840, -0.09655
-0.85200, 0.86745, -0.09800
-0.85093, 0.86623, -0.09696
-0.85047, 0.86623, -0.09711
Then after shaking it and letting it settle again for a couple minutes:

Code:
-1.34035, 0.90906, -0.11356
-1.33845, 0.91073, -0.11148
-1.33725, 0.91161, -0.11435
-1.33792, 0.91184, -0.11460
-1.34183, 0.91223, -0.11400
-1.34252, 0.91236, -0.11414
-1.34392, 0.91208, -0.11436
-1.34487, 0.91015, -0.11354
-1.34541, 0.91029, -0.11263
-1.34278, 0.91131, -0.11257
-1.34313, 0.91252, -0.11180
-1.34338, 0.91340, -0.11340
-1.34475, 0.91323, -0.11154
-1.34332, 0.91596, -0.11416
-1.34294, 0.91321, -0.11297
-1.34327, 0.91095, -0.11272
-1.34219, 0.91169, -0.11136
so the offset changed :confused:

Notice I use floats, so this is in degrees per second, not an average of the raw integer values.

If some of you would be so kind to run this code for some minutes and post results? Do your Prop Shields behave the same?

-Ben

Edit: Code's also here: https://github.com/Ben-Rheinland/NXPMotionSense/tree/master/examples/TestGyroscope
 
Last edited:
I'm seeing this, with the one that's on my desk right now (same as the one I logged yesterday with the plotter)

Code:
-0.05944, -0.16238, -0.14935
-0.05749, -0.16098, -0.14897
-0.05449, -0.16069, -0.14927
-0.05210, -0.15898, -0.15031
-0.05385, -0.15895, -0.15127
-0.05415, -0.15820, -0.14912
-0.05351, -0.15895, -0.15041
-0.05318, -0.15829, -0.15199
-0.05139, -0.15831, -0.15188
-0.05335, -0.15680, -0.15171
-0.05411, -0.15773, -0.15200
-0.05561, -0.15742, -0.15084
 
I gave my board a very vigorous shake for several seconds, then let it settle. Now I'm seeing this:

Code:
-0.03475, -0.14212, -0.12813
-0.03416, -0.14235, -0.12915
-0.03388, -0.14054, -0.12969
-0.03787, -0.14303, -0.12819
-0.03777, -0.14283, -0.12675
-0.03887, -0.14247, -0.12647
-0.03645, -0.14157, -0.12542
-0.03870, -0.14204, -0.12572
-0.04091, -0.14277, -0.12654
-0.04022, -0.14199, -0.12671
-0.04048, -0.14185, -0.12665
-0.04136, -0.14095, -0.12530
 
@Paul your offset looks much better than mine and seems to recover better from shaking. I will investigate further on the weekend.
 
I ran the code above for a bit and got this - it seemed to return when going back to my wooden desktop and shaken in free air. You can see iif it shows what you are looking for.

start . . . .
-0.04247, -0.10901, 0.02902
-0.06639, -0.18005, 0.04410
-0.11375, -0.24709, 0.06488
-0.13281, -0.31292, 0.08098

5:46 PM 3/17/2016 << SHAKEN ------

-0.59318, -1.51788, 0.42819
-0.58274, -1.51893, 0.42942
-0.58738, -1.51972, 0.42839
-0.57681, -1.52116, 0.42955
-0.59812, -1.50247, 0.42839
-0.65898, -1.38084, 0.43402
-0.25908, -1.63214, 1.44146
0.14189, 0.06166, 8.98632
3.02387, 2.91671, 14.67131
0.66231, -2.42216, 8.66873
-1.31853, -2.32576, 6.60831
-1.17767, -7.79408, 5.01112
-3.46747, -8.11082, 2.89802
-5.42296, -6.96765, 4.24515
-6.10721, -2.44790, 6.41113
-14.44281, -4.94015, 0.33017
2.65920, -0.94411, 1.12840
1.31437, 0.33808, -0.58399
-2.00174, 1.72423, 4.66322
-10.22663, -4.30171, 2.26541
-3.60680, -4.13442, 15.68208
-10.63062, -7.40791, 16.42157
-3.90650, -11.72521, 26.51940
-10.97616, -16.72645, 27.21338
-23.27667, -20.32959, 26.55439
-9.62276, -32.31821, 38.67164
-21.80443, -28.03357, 38.99112
-28.18420, -23.33231, 36.39219
-15.59743, -20.68818, 35.60229
-15.64517, -20.55730, 31.66413
-15.28123, -20.39620, 31.36851
-13.62677, -19.14669, 30.07308
-12.73997, -18.11305, 28.78445
-12.28807, -17.02123, 27.35917
-11.72452, -16.24940, 26.02020
-11.21889, -15.43207, 24.69112
-10.69281, -14.75488, 23.50751
-10.19556, -14.11033, 22.38184
-9.72129, -13.49634, 21.30986
-9.27108, -12.91413, 20.29208
-8.84080, -12.35932, 19.32423
-8.43734, -11.83174, 18.40151

.....

5:47 PM 3/17/2016

-0.48299, -1.55495, 0.44116
-0.48422, -1.55546, 0.44034
-0.48626, -1.55626, 0.43960
-0.48260, -1.55343, 0.43997
-0.48470, -1.55185, 0.43926
-0.48321, -1.55095, 0.43906
-0.48041, -1.55131, 0.44045
-0.47650, -1.55069, 0.43943
-0.47687, -1.54943, 0.43912
-0.47565, -1.54971, 0.43813
-0.47556, -1.54871, 0.43860

...


5:50 PM 3/17/2016

-0.50408, -1.56597, 0.43822
-0.50244, -1.56552, 0.43693
-0.50187, -1.56409, 0.43657
-0.49845, -1.56345, 0.43589
-0.49353, -1.56108, 0.43424
-0.48901, -1.56221, 0.43391
-0.48772, -1.56082, 0.43308

...

5:53 PM 3/17/2016

-0.48281, -1.54704, 0.42940
-0.48391, -1.54445, 0.42945
-0.48389, -1.54641, 0.43032
-0.48273, -1.54937, 0.42987
-0.48642, -1.55147, 0.43049
-0.48792, -1.55275, 0.43046

...

5:54 PM 3/17/2016 SHAKEN -----------

-0.49586, -1.55172, 0.43597
-0.50018, -1.54983, 0.43538
-0.50000, -1.55112, 0.43399
-0.49940, -1.54848, 0.43287
-0.49826, -1.54931, 0.43223
-0.49491, -1.59703, 0.43003
-0.49002, -1.57563, 0.43150
1.28545, -2.61965, 1.63388
6.46129, 3.88872, 10.08814
8.22576, 7.54464, 11.63682
4.93702, 3.75111, 0.01044
5.35784, -19.14593, -4.40086
9.40530, -18.00746, 5.93152
4.47634, -21.19606, 4.80288
3.85115, -22.13147, 4.60667
2.13024, -12.96994, 7.73207
4.80907, -15.34549, 8.33710
5.28452, -16.29916, 7.15517
6.85971, -13.02245, 8.16220
3.80305, -11.93313, 3.55960
5.15795, -9.09268, 1.02516
11.93230, -16.75019, 4.95976
12.76663, -16.15040, 5.06468
7.54164, -4.99982, -1.33484
8.11709, -6.08714, 0.14008
12.11487, -16.91682, 3.41119
7.58032, -16.25744, 3.28042
3.48484, -16.52768, 2.05204
3.53077, -16.89972, 3.21459
2.02319, -15.30025, 2.63088
1.90327, -14.76658, 2.53200
2.47600, -14.14725, 2.36687
2.32917, -13.53267, 2.27178
2.18840, -12.94291, 2.17907
2.06383, -12.38399, 2.09223
1.93189, -11.85363, 2.01160


...

5:56 PM 3/17/2016

-0.58058, -1.50875, 0.42752
-0.57788, -1.50825, 0.42826
-0.58097, -1.50870, 0.42810


...

5:58 PM 3/17/2016

-0.59716, -1.52556, 0.42761
-0.59407, -1.52492, 0.42695
-0.59543, -1.52583, 0.42655
-0.59634, -1.52402, 0.42593


...

6:04 PM 3/17/2016

-0.60611, -1.50448, 0.42727
-0.60418, -1.50658, 0.42704
-0.60132, -1.50609, 0.42868
-0.60488, -1.50792, 0.42989
-0.60348, -1.50779, 0.43117
-0.60405, -1.50784, 0.43032
-0.60153, -1.50988, 0.43049
-0.60123, -1.51133, 0.43034
-0.60304, -1.50955, 0.42771

Note : I ran IMU with calibration. When I went to set it down it went near my 'MSFT BAND watch' ( running cortex in it that messes up AM radio held in that hand ) and it BLURB'd my IMU image - I left it sit and here is the odd Egg shaped collection I got later with outlier SPEW that I think was the watch proximity - if you have any outside influence you might be seeing this effect?

nxp_cal4.jpg
 
There's a known issue with mechanical stress, which is common to all MEMS-based sensors. If you bend or twist the PCB, it can create significant offsets due to the mechanical stress placed on the chip's plastic package.

This is something we probably need to mention well on the product page.

Almost everyone else is doing a calibration process to measure and subtract these gyro and accelerometer offsets. Looks like we probably should too. In Freescale's huge algorithm, there seems to be code which tries to learn the gyroscope offsets, but I must confess I don't fully understand everything they're doing in that code.
 
Well Paul if you don't fully understand something I'm really out of this loop.
Thanks for all that are participating in the developpement of the prop shield.

Seriously all I need to do is make APA102 LEDs work with the teensy so should I wait or use the OCTOWS2811 shield? I don't need the gyro or the sound amplifier.
 
Many APA102s work with 3.3V signals, so you might just try wiring pins 11 and 13 to the data and clock lines and see if it works.

Of course, if you have any other SPI chips connected, the APA102s will hear that communication. The prop shield has gates to prevent the APA102s from responding to the communication with other chips. It has a SPI flash chip, which eventually we'll use for images. So much code to write.....
 
Sorry to derail too much.

Yeah they work at 3.3V here too but not after 24'' of 144/m APA102. I'd like to get more than double that and I know I can use the level shifters mentioned everywhere here on this forum but I'm lazy and frankly not very smart so I need something more plug and play LOL.
So its either the OCTO WS2811 with a hacked code (I think?) or I wait for the prop shield to happen.

Still its very interesting to see this new product being tested and libraries being created.
Good job everyone and thanks for your efforts.
 
Last edited:
Oh well, live and learn.

Be careful when de-soldering the APA102 connection, since it is near something with the NXPMotion sensors. I had soldered a right angle female header to the 4 pins, and decided I really wanted 4 cables instead. So I tried to de-solder the header. I got 3 of the pins removed, but the fourth one was stuck. Other than the LEDs, it was working fine.

I went to the local electronics guy, asking if he had anything in the shop smaller than the picks I had (which would not fit in the holes), and he tried his hand at removing the solder. Evidently he damaged something, and the i2cscanner gives errors when it runs. If I plug another i2c device into the bus (the Adafruit 8x8 i2c backpack), it can find that device, but none of the 3 devices on the chip. Once when I removed the Adafruit device, it was able to find the other 3 devices, but every other time I've tried to replicate it, it fails.

Hopefully, it will appear in the retail shop soon, so I can buy another one to play with the sensors. The sound amplifier does work. I haven't tried the flash memory yet. I can blink normal LEDs if I attach wires to the APA102 lights, but without soldering the wires down, neopixels didn't run (I'm not sure it was do to my using bare wires, or something is corrupting the data stream).
 
Status
Not open for further replies.
Back
Top