Forum Rule: Always post complete source code & details to reproduce any issue!
Page 5 of 28 FirstFirst ... 3 4 5 6 7 15 ... LastLast
Results 101 to 125 of 679

Thread: uNav INS

  1. #101
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    414
    Will switch to posted #92 and look...

    I have the Gnd-Gnd hooked up. Not thinking it's the numSV<6 issue 'cuz I see output on the master serial terminal...

  2. #102
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,556
    If Master showing TViewer data then the configs setting is not? :: #define TViewerSPI 1

  3. #103
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    414
    Still getting good data to Master serial terminal (com14 for me), nothing to slave terminal (com4 for me). Got to go run some errands, but when I get back I think I'll fall back and make sure I can get the SPI_Transfer sample example running...

  4. #104
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,556
    Quote Originally Posted by Don Kelly View Post
    Still getting good data to Master serial terminal (com14 for me), nothing to slave terminal (com4 for me). Got to go run some errands, but when I get back I think I'll fall back and make sure I can get the SPI_Transfer sample example running...
    Sounds like this "#define TViewerSPI 1 " is commented out in A_configDefines.h for (DK). When that is defined then Master Serial is free of TViewer output - only debug SPEW.


    I'm testing a " if ( std::isnan( MST_PrintVals[jj] ) ) { " in serialPrint before passing to Slave. Will have to wait some hours perhaps to see if that catches on Master or still shows on Slave ...

  5. #105
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,012
    slave must be running slave.events() in loop too

  6. #106
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,556
    Quote Originally Posted by tonton81 View Post
    slave must be running slave.events() in loop too
    He's using common Slave code to Mike and myself so that is there. With data on Master it is not trying to send to Slave with SPI_MST.

  7. #107
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,335
    Tim

    "You might get away with higher speed now. I should enable the events again to see how many were pushing with .events() in loop() now that it is counted." - that I think was causing the problem - had i2c set at 1Mhz. Put it back and it worked.

    "How many Loop# does T_3.5 setup give?" - don't know. went back to rerun to let you know. Now having problems with IMU and getting enough satellites. Arrg I will update when I get something.

  8. #108
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,335
    Code:
    slave must be running slave.events() in loop too
    Yep - don't you need it?

  9. #109
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,012
    definately, the master’s f&f’s need slave to fire them from slave’s event() loop

  10. #110
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,556
    Yes, it is required and it is present:
    TVslaveDK.ino:
    Code:
    void loop() {
    	slave.events();
    }
    Mike - would be nice if you can get the 3.4 MHz i2c working to minimize wasted time on T_3.5.

    BTW: i2c_t3 has a CALLBACK option - though I've not tested or seen it work - that would be cool, though MPU messages are short it does take time ...

  11. #111
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,335
    Re. That's what I thought on the slave.events, I confuse easy

    Part of the problem was the aHRS.events. I put it back but wrapped it in a 100ms timer, and it was causing havoc. Removed it and it started working. Syptoms - too much data.

    Tim, as to your question, here is what I get right after startup:
    Code:
    Loop#:26698 IMU#:0
    	 #1  @18:15.4_306320 [fix:3 #:7
     WARNING: Apparent loss of IMU data !!
    	 #2  @18:15.4_200306451 [fix:3 #:7
    	 #3  @18:15.4_400306582 [fix:3 #:7
    	 #4  @18:15.4_600306713 [fix:3 #:7
    	 #5  @18:15.4_800306844 [fix:3 #:7
    -----Loop#:287732 IMU#:51
    	 #6  @18:15.5_306974 [fix:3 #:7
    	 #7  @18:15.5_200307105 [fix:3 #:7
    	 #8  @18:15.5_400307236 [fix:3 #:7
    	 #9  @18:15.5_600307367 [fix:3 #:7
    	 #10  @18:15.5_800307498 [fix:3 #:7
    -----Loop#:300557 IMU#:51
    	 #11  @18:15.6_307628 [fix:3 #:7
    	 #12  @18:15.6_200307759 [fix:3 #:7
    	 #13  @18:15.6_400307890 [fix:3 #:7
    	 #14  @18:15.6_600308021 [fix:3 #:7
    	 #15  @18:15.6_800308151 [fix:3 #:7
    -----Loop#:288906 IMU#:49
    	 #16  @18:15.7_308282 [fix:3 #:7
    	 #17  @18:15.7_200308413 [fix:3 #:7
    "would be nice if you can get the 3.4 MHz i2c working" - have new MPU-9250's coming in today, I hope. Will use a new one, just in case.

  12. #112
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,012
    if you put the slave.events in a 100 timer and your hammering f&f’s at ~49uS i can see why youd have a problem

  13. #113
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,556
    Quote Originally Posted by mjs513 View Post
    Re. That's what I thought on the slave.events, I confuse easy

    Part of the problem was the aHRS.events. I put it back but wrapped it in a 100ms timer, and it was causing havoc. Removed it and it started working. Syptoms - too much data.

    Tim, as to your question, here is what I get right after startup:
    Code:
    Loop#:26698 IMU#:0
    	 #1  @18:15.4_306320 [fix:3 #:7
     WARNING: Apparent loss of IMU data !!
    	 #2  @18:15.4_200306451 [fix:3 #:7
    "would be nice if you can get the 3.4 MHz i2c working" - have new MPU-9250's coming in today, I hope. Will use a new one, just in case.
    Yes, the .events is not used so not needed - I left it out. Even calling 10 Hz adds overhead to time test and then complete a transaction - as noted dropped free loop() calls 100,000 on my T_3.6 - perhaps more significant on T_3.5 - though that slowed rate should not KILL GPS with 'radio' noise.

    Your startup SPEW looks as expected. The IMU loss is from that 'absolute' test - when the IMU was not called for some time prior to the GPS data allowing entry. It could he hidden perhaps with:
    an appropriate line like : newIMUDataTimer = (float) micros() / 1000000.0f - rtcOffset;

    At the end of setup() and also the 'else' case for 'if (uBloxData.numSV > 5) {'

  14. #114
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,556
    Quote Originally Posted by tonton81 View Post
    if you put the slave.events in a 100 timer and your hammering f&f’s at ~49uS i can see why youd have a problem
    Before I discovered it - noted above - the .events() was SUCCESFULLY being called 10,000 to 20,000 times per second! The only problem was that that apparently creates radio noise on the independent GPS unit Antenna/Processor causing it to not see the satellites.

    That is why the .events() should have a call limiter built in to make it user friendly on Master with code like posted hours back - same post .

  15. #115
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,012
    a limiter by time or by counter?

  16. #116
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,556
    Quote Originally Posted by tonton81 View Post
    a limiter by time or by counter?
    AS posted 9:24 am today :: https://forum.pjrc.com/threads/48856...l=1#post173548

    Links added above to post #114 during cross posting ....

  17. #117
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,012
    sounds good

  18. #118
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,335
    " 'else' case for 'if (uBloxData.numSV > 5) {" - waiting for Don to get back on KF not updating for no GPS available - it should as was mentioned in a bunch of posts ago. Yep - not so much worried about the imu data. More concerned on GPS data not available. Think I am going to go back and change to test fix >=3. As long as you have a fix proceed).

    BTW. running i2c at 1Mhz, all proceeding normally so far. Already tested at 3.4M using just a simple sketch to access the IMU and was getting a check wiring errors - 3 one time 5 another time. 400k is giving me a problem for some reason.

  19. #119
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,556
    Tony: Verbose compile of SPI_MSTransfer shows a lot of NOISE warnings - 'no value returned' - cleaning those up would make it more friendly.

    While in there you might add that limiter code? :: uint16_t SPI_MSTransfer::events( uint32_t MinTime )

    Also a reasonable 'non-debug' setting for :: Circular_Buffer<uint16_t, 12, 200> mtsca; and Circular_Buffer<uint16_t, 12, 200> stmca;
    >> Is there a way the user could pass in CA's mtsca and stmca?

  20. #120
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,012
    yup, prolly do events as an overloaded method with a default time so events() or events(val) could be called

    for a user to pass in yeah but if the pattern of the protocol is not in the array dataset, it wont be known to the library and a crash would probably occur

    non-debug output?

  21. #121
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,556
    Quote Originally Posted by mjs513 View Post
    " 'else' case for 'if (uBloxData.numSV > 5) {" - waiting for Don to get back on KF not updating for no GPS available - it should as was mentioned in a bunch of posts ago. Yep - not so much worried about the imu data. More concerned on GPS data not available. Think I am going to go back and change to test fix >=3. As long as you have a fix proceed).

    BTW. running i2c at 1Mhz, all proceeding normally so far. Already tested at 3.4M using just a simple sketch to access the IMU and was getting a check wiring errors - 3 one time 5 another time. 400k is giving me a problem for some reason.
    re: BTW - 'check wiring errors' - that sounds like what 'wire.h' gave me at some slower i2c speed on 240 MHz T_3.6 before I did the F_BUS to 120 MHz - but i2c_t3 doesn't need that IIRC. Does your MPU9250 use WIRE or i2c_t3?

    If that were added to that 'else' case - it would be there whenever it was the reason IMU was not updated? And if the GPS_FIX stops gating the IMU print - then it won't matter except to fool that timer?

    I notice the SerialRx isr() code is missing? And this doesn't record the time of IMU data ready on the interrupt?
    Code:
    void runFilter() {
      newIMUData = 1;
    }

  22. #122
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,556
    Quote Originally Posted by tonton81 View Post
    yup, prolly do events as an overloaded method with a default time so events() or events(val) could be called

    for a user to pass in yeah but if the pattern of the protocol is not in the array dataset, it wont be known to the library and a crash would probably occur

    non-debug output?
    "reasonable 'non-debug' setting for :: Circular_Buffer<uint16_t, 12, 200>" - the github version has a set of 32 arrays of 150 words. You posted that 32 was for debug testing and a smaller number would be okay so changing that to a reasonable value - perhaps larger entry space of 200 as shown. As shown I am using 12 sets of 200 and it is working and would accommodate a large message.

  23. #123
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,012
    done, i will add the events and CB mods now, for Mintime, if the user doesnt specify, what default would you prefer?

    events(100) == 100ms rates

    events() == what you want as default?

  24. #124
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,012
    also for:

    Code:
        static uint32_t LastTime = 0;
        if ( millis()-LastTime > MinTime ) return 0;
        LastTime = millis(); // <-- this never runs?
    shouldnt it be:

    Code:
        static uint32_t LastTime = 0;
        if ( millis()-LastTime < MinTime ) return 0;
        LastTime = millis();

  25. #125
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,335
    "Does your MPU9250 use WIRE or i2c_t3?" - i2c_t3. The errors I mention, weren't really Wire errors. If you remember on 9250 startup Brian inits the 9250 an if anything fails it returns an error message. "Check wiring" - comes from the 9250 init routine not wire.

    "Circular_Buffer<uint16_t, 12, 200>" - I agree 200 is better, I already changed that. Put the 32 back from 5 but that was the cause of my problem. Otherwise it probably would have been fine.

    Tony, in regards to events in master is there a way to do something like available instead of events. Why, you might ask - if I wanted to hang a radio off the slave and send control messages I could with having to worry about running events at all? Is it more trouble than its worth?

    Tim. Awhile ago we were talking about data. I keep meaning to ask if we are sending floats with "dtostrf", why are we even dealing with doubles? Remember, TViewer wants floats so they are using the c++ function to convert floats to strings. EDIT2: Guess the question is do we really need doubles to be sent back to the slave? Think you asked this before.

    EDIT: " SerialRx isr() code is missing? " - noticed that. Also you GPS interrupt is missing as well. To be honest wasn't worried about that right now since we were still debugging the new KF and MSTranser with all that data to worry about it. At some point some of the stuff we had in the other version of the KF should be moved over.

Posting Permissions

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