• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
ModalAI Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
    • Register
    • Login

    Imu temp calibration

    VOXL 2 Mini
    2
    6
    365
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mkriesel
      last edited by 27 Mar 2024, 00:50

      Hello, I have a voxl2 mini that I'm doing development on and I'm running in to issues with the temperature calibration on the imu, mostly that I can't get it to work. When I try to run the calibration it doesn't complete and says "not enough samples, need at least 3" It feels like I'm missing something obvious but I've tried it a few times to the same result. Any help or guidance is appreciated.

      Screenshot from 2024-03-26 17-45-59.png

      A 1 Reply Last reply 27 Mar 2024, 03:24 Reply Quote 0
      • A
        Alex Kushleyev ModalAI Team @mkriesel
        last edited by 27 Mar 2024, 03:24

        @mkriesel ,

        the source code is here

        You can run in debug mode to get more info, but it seems the temperature of the IMU has not really changed from the start (34C vs 31C). The cpu stressing may not be enough. You should check output of top while the stressing of CPU is running (the application just burns cpu cycles in order to heat up the cpu, which will heat up the IMU to help with temperature calibration). How long did the procedure run before it stopped?

        M 1 Reply Last reply 27 Mar 2024, 18:22 Reply Quote 0
        • M
          mkriesel @Alex Kushleyev
          last edited by 27 Mar 2024, 18:22

          @Alex-Kushleyev
          it runs for about a minute and it seems to be stressing the cpu but not enough to raise the temp significantly, in my setup the voxl is sitting in a metal housing so does it just not get hot enough for it to run the calibration properly?
          Screenshot from 2024-03-27 11-19-43.png

          A 1 Reply Last reply 27 Mar 2024, 19:52 Reply Quote 0
          • A
            Alex Kushleyev ModalAI Team @mkriesel
            last edited by Alex Kushleyev 27 Mar 2024, 19:52 27 Mar 2024, 19:52

            @mkriesel , yes, i believe your conclusion is correct. Something must be cooling down the board (enclosure).

            It tested this myself and have a small tip for you: setting cpu mode to performance helps to burn more power in the cpu (run this right before starting the temp calibration):

            voxl-set-cpu-mode perf
            

            Also you should start the calibration when the board is a bit colder, maybe room temp 20-25C

            Try it!

            A 1 Reply Last reply 27 Mar 2024, 20:02 Reply Quote 0
            • A
              Alex Kushleyev ModalAI Team @Alex Kushleyev
              last edited by 27 Mar 2024, 20:02

              we can also the stress function for the cpu, to make it consume more power. i will follow up about it a bit later.

              A 1 Reply Last reply 27 Mar 2024, 21:15 Reply Quote 0
              • A
                Alex Kushleyev ModalAI Team @Alex Kushleyev
                last edited by 27 Mar 2024, 21:15

                If you need the cpu stress function to generate more heat, here is something that works. you can replace the current function with this one. It adds a memcpy() operation which uses a lot of power. You can tune do_memcpy_every_nth to control more or less heat (decreasing the number will use heat up cpu more).

                Original function is here

                #define STRESS_ARRAY_SIZE (128*1024)
                static void* _stress_function(__attribute__((unused)) void* arg)
                {
                    uint8_t * _stress_array  = malloc(sizeof(uint8_t)*STRESS_ARRAY_SIZE);
                    
                    uint32_t cntr = 0;
                	while(stress_running){
                	    cntr++;
                		volatile double s = sqrt(rand()); //this helps slow down the while loop
                		
                		const int do_memcpy_every_nth = 50; //do not perform memcpy every loop because cpu can get hot very quickly
                		if ((cntr % do_memcpy_every_nth) == 0){            
                		    memcpy(_stress_array,_stress_array+STRESS_ARRAY_SIZE/2,sizeof(uint8_t)*STRESS_ARRAY_SIZE/2);
                		}
                	}
                	//printf("stress thread exiting\n");
                	
                	free(_stress_array);
                	return NULL;
                }
                
                1 Reply Last reply Reply Quote 0
                1 out of 6
                • First post
                  1/6
                  Last post
                Powered by NodeBB | Contributors