uNav INS

Also! Lets debug the slave handler:
Code:
  Serial.print("Length: "); Serial.println(length);
  Serial.print("Length2: "); Serial.println(sizeof(buffer)/2);
    for ( uint16_t i = 0; i < length; i++ ) {
      Serial.print(buffer[i]); Serial.print(" ");
    } Serial.println();
}


output:
Code:
Length: 12
Length2: 2
0 0 46080 16568 0 0 46336 16568 0 0 46592 16568 
Length: 12
Length2: 2
0 0 49152 16568 0 0 49408 16568 0 0 49664 16568 
Length: 12
Length2: 2
0 0 52224 16568 0 0 52480 16568 0 0 52736 16568 
Length: 12
Length2: 2
0 0 55296 16568 0 0 55552 16568 0 0 55808 16568 
Length: 12
Length2: 2
0 0 58368 16568 0 0 58624 16568 0 0 58880 16568 
Length: 12
Length2: 2
0 0 61440 16568 0 0 61696 16568 0 0 61952 16568 
Length: 12
Length2: 2
0 0 64512 16568 0 0 64768 16568 0 0 65024 16568


the 12 dwords transfer is INTACT, why cant you sizeof the buffer (length2) ? because sizeof on a POINTER returns the size of the POINTER (4), and dividing by 2 gets you, well, 2. This is why when passing arrays to functions the length is specified by the USER sketch.

AFAICT, the library is doing it's job properly at both ends, a new demo will need to be exercised to fix the bad length. You might also gain performance without that 3x overhead traffic! :)
 
By the way it does work for doubles but you have to increase the size of the buffer in the SPI_MSTransfer to 300
 
What am I missing?

As I wrote the TVMaster.ino - it was properly specified as 48 WORDS for this:
Code:
teensy_gpio.transfer16((uint16_t *)MST_PrintVals, sizeof(MST_PrintVals) / 2, 55, 1);

shows this::
with :: double MST_PrintVals[12];
sizeof ( MST_PrintVals ) >>>> 96
sizeof ( MST_PrintVals )/2 >>>> 48
1

With this code:
Code:
double MST_PrintVals[12];
Serial.println( "with :: double MST_PrintVals[12];   " );
Serial.print( "sizeof ( MST_PrintVals ) >>>> " );
Serial.println( sizeof ( MST_PrintVals ) );
Serial.print( "sizeof ( MST_PrintVals )/2 >>>> " );
Serial.println( sizeof ( MST_PrintVals ) /2  );
 
OK, got it working for all 62 residuals parms. I'm going to take a break, but then add the 15 P terms, and then finally update the TViewer txt file, and send out another release. May be the morning before I get the new version out... Looking good!!
Don
 
if you cast to floats you;d save half the traffic, 32bits vs 64 for doubles (too much padding).
Either way to fix it is to increase the buffer, the point was i was trying to explain that the transfer16 is working properly and the size is not calculates by its own function
The casting is padding the printvals to be larger so its sent properly over the 16bits and rebuilt properly at other end
using uint16_t arrays there is NO issue at all, but your still wasting 2x traffic using 64bit casting instead of 32, you might get a performance increase (2x F&Fs instead of 1x :)

Guess I wont need to make the 32/64 transfers then?
 
Thanks Don, so 200 is low it seems, any ideas for a better buffer size? should we go back to 1024 or 2048? It's not like teensy doesnt have ram...
 
No need for 32 or 64 transfers - it was working perfectly ??? See post #306 - no extra - 48 bytes was the size of the data to be transmitted ... and it was ...

The only casting was to LIE about the nature of the pointer - which works fine ... and sizeof as used gives size of the array in bytes - without regard to the type?
 
Yea, the sizes were throwing me off, sorry... but we need to fix the buffer size based on current MST usages (like today)

the queue size is set to 12 slots, with 200 indices (200x12) == 2400 dwords + 200 for the slave main buffer, so keep that in mind

500x12 == 6000 + 500 == 6500 dwords == 13Kbytes
 
Ok, here's Ver4 of uNavINS_CB and TVSlave. TViewer only shows me ~30 parms for building the txt file, so I will see if I can manually build the TViewer txt file tomorrow. But at least all the parms are streaming to Slave !! Seems to be working well !!

View attachment uNavINS_CB_Ver4.zip
View attachment TVslaveDKV4.zip

On a side now, my yaw looks to be drifting, but I suspect it's cuz I still haven't gone back and re-calibrated my IMU after we started the SPI work...

Don
 
OK, got it working for all 62 residuals parms. I'm going to take a break, but then add the 15 P terms, and then finally update the TViewer txt file, and send out another release. May be the morning before I get the new version out... Looking good!!
Don

Don: So you downsized the doubles to float for transfer - The morning would be fine.

8 sets of buffer space should be plenty - doesn't it need to be a power of TWO? ... probably even 4 buffers ...
 
no, the 200 is not a power of 2, but wait..... your absolutely right!
#define QUEUE_SLOTS 12
this should be 8 or 16 !
200 is the array storage itself, can be any size

what size should we set then? 300? 500?..
 
no, the 200 is not a power of 2, but wait..... your absolutely right!
#define QUEUE_SLOTS 12
this should be 8 or 16 !
200 is the array storage itself, can be any size

what size should we set then? 300? 500?..

See tonton81 - I read at least a critical part of your DOC !!!!!! :)
 
Ok. Running new version. Not sure what changed but in terms of yaw I am seeing a increased variation but its staying pretty constant between 1-2 degrees. Same applies for pitch and roll. This is over the previous version. but very low variation.

For Latitidude: seems to only constant through the 4 decimal place after that the variations start. Really need it good out to about 6. Maybe going to floats lost something in translation.

BTW: the double version will work just need to increase the size of the buffer to 400.
 
Mike,
Where is the buffer size set? I was thinking it would be in TVslave but not seeing it there. If you're seeing only 4 decimal places or so in Lat, prob best to go back to Doubles and increase buffer to 400.
Don
 
Don, SPI_MST .H file
change the define at the top (currently set to 200)

please fix the QUEUE SIZE define too, must be 8 or 16! NOT 12! thanks :)
 
Hi Don, Guess tonton81 beat me to it. Was working on a new version of the telemetry viewer based on some else's fork. Trying to make the one panel scrollable :)
 
Attached is an updated version of the TViewer txt file, with all labels, colors, etc added. Pretty amazing watching it all stream by.

In a bit, I'll bump the SPI buffer up to 400 and switch everything back to doubles...

Mike - curious to hear what you're doing on an updated telemetry viewer, sounds neat!

View attachment TV_Layout_CFVer8.txt
 
Don:
I should ready this afternoon to see and work with your best current version and try to get a new stable time base. A bunch of 'fires' tamped down - and the woodstove fired up.

I had a thought about adding one SPARE value to TVslave.ino - you can set it to ZERO for now - but if there was a spare field we could use that for DEBUG from the slave - how many Bad_CRC or print rate or whatever may come up so the slave has a way to provide 'that' TBD value as development continues? It doesn't have to come from TVmaster - it has its own DEBUG screen - but after transferring/printing all the desired values - have the slave spit out ONE MORE value it could be used to see Slave issues while staring at just TViewer. Ideally if this were displayed before or after the RTC time it could be monitored on the SerMon without scrolling to the far end when TViewer not active - but that may be a nightmare to arrange in TViewer.
 
Back
Top