Forum Rule: Always post complete source code & details to reproduce any issue!
Page 13 of 28 FirstFirst ... 3 11 12 13 14 15 23 ... LastLast
Results 301 to 325 of 683

Thread: uNav INS

  1. #301
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,117
    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!

  2. #302
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    417
    Mike,

    I attempted to convert Double to float in the Serial_Print tab and TVSlave ino. I'm getting a Ban Length 88 error on Slave side now, so guessing I missed some setting on the Slave side. Any suggestions?
    Don

    TVslaveDKV2.zip
    uNavINS_CB_Ver4.zip

  3. #303
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,213
    Yea = to make life easier, change the 4 to a 2 where its testing for the packet length.

  4. #304
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    417
    Mike,
    seems like that was it

  5. #305
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,213
    By the way it does work for doubles but you have to increase the size of the buffer in the SPI_MSTransfer to 300

  6. #306
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,963
    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  );

  7. #307
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    417
    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

  8. #308
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,117
    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?

  9. #309
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,117
    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...

  10. #310
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,963
    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?

  11. #311
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,117
    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

  12. #312
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    417
    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 !!

    uNavINS_CB_Ver4.zip
    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

  13. #313
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,963
    Quote Originally Posted by Don Kelly View Post
    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 ...

  14. #314
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,117
    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?..

  15. #315
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,213
    4 or 8 should work fine. 2 I would be concerned about.

  16. #316
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,117
    yeah, you might overrride lots of times your F&F's :P

  17. #317
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,963
    Quote Originally Posted by tonton81 View Post
    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 !!!!!!

  18. #318
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,213
    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.

  19. #319
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,117
    double has more precision than float 64 vs 32bit

  20. #320
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,213
    I finally found the post on float precision vs doubles: https://forum.pjrc.com/threads/48048...nversion-maybe

  21. #321
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    417
    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

  22. #322
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,117
    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

  23. #323
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,213
    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

  24. #324
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    417
    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!

    TV_Layout_CFVer8.txt

  25. #325
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,963
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •