phyphox Forums
Changing gyro range for Puck-js sensor - Printable Version

+- phyphox Forums (https://phyphox.org/forums)
+-- Forum: Discussion (https://phyphox.org/forums/forumdisplay.php?fid=1)
+--- Forum: Experiments and Ideas (https://phyphox.org/forums/forumdisplay.php?fid=4)
+--- Thread: Changing gyro range for Puck-js sensor (/showthread.php?tid=1752)

Pages: 1 2


Changing gyro range for Puck-js sensor - scspaeth - 06-03-2023

I have measured angular velocities of a Puck-js sensor spinning on a wheel.
   

I encountered a similar challenge that I did for measurements with a TI SensorTag: the default range for the device is too low. Dominik clarified that the SensorTag's firmware makes it difficult to change the gyro ranges. https://phyphox.org/forums/showthread.php?tid=1746&pid=3508#pid3508


But the Puck-js uses a LSM6DS3TR-C. The spec sheet for that device says explicitly that it has an adjustable angular rate change:

Quote:The LSM6DS3TR-C has a full-scale acceleration range of ±2/±4/±8/±16 g and
an angular rate range of ±125/±250/±500/±1000/±2000 dps.
https://www.espruino.com/files/LSM6DS3TR-C.pdf

On page 22 of the spec sheet, it mentions a self-test mode:
Quote:Angular rate self-test output change(14)(15)

And on page 62 of the spec sheet it describes the registers for control of the angular rate change:
Quote:9.14 CTRL2_G (11h)
Angular rate sensor control register 2 (r/w).
Table 53. CTRL2_G register
Table 54. CTRL2_G register description ODR_G3 ODR_G2 ODR_G1 ODR_G0 FS_G1 FS_G0 FS_125 0(1) 1. This bit must be set to ‘0’ for the correct operation of the device. ODR_G [3:0] Gyroscope output data rate selection. Default value: 0000 (Refer to Table 55) FS_G [1:0] Gyroscope full-scale selection. Default value: 00 (00: 245 dps; 01: 500 dps; 10: 1000 dps; 11: 2000 dps)

On the Phyphox page describing Puck-js sensing (https://phyphox.org/wiki/index.php/Puck.js) you invite requests for assistance. Could someone help to identify the i2c device and register numbers for writing to and reading from the Puck-js sensor so that I have the full 2000 dps range for the gyroscope?

Thank you!


RE: Changing gyro range for Puck-js sensor - scspaeth - 06-03-2023

Here are results for a related experiment using a PocketLab Voyager sensor that has a more appropriate range for angular velocities in my experiments. Note that the peak angular velocities reach +/- 17 radians/sec in this example and may increase somewhat as we gain experience.

   


RE: Changing gyro range for Puck-js sensor - Jens Noriʇzsɔɥ - 06-04-2023

Thanks for reporting. We will look into this. On first sight, I have not seen information if the different ranges have an impact on the power consumption

Puck.accelWr looks like a pretty straightforward command to configure the register that you have mentioned – and it should be short enough to be readily included into the experiment source. Smile


RE: Changing gyro range for Puck-js sensor - scspaeth - 06-04-2023

(06-04-2023, 09:30 PM)Jens Noritzsch Wrote: Thanks for reporting. We will look into this. On first sight, I have not seen information if the different ranges have an impact on the power consumption

Puck.accelWr looks like a pretty straightforward command to configure the register that you have mentioned – and it should be short enough to be readily included into the experiment source. Smile

Thank you for considering this modification. The default range is so low that even simple experiments like rolling down a short and shallow inclined plane can exceed the threshold.


RE: Changing gyro range for Puck-js sensor - scspaeth - 06-07-2023

(06-04-2023, 09:30 PM)Jens Noritzsch Wrote: Thanks for reporting. We will look into this. On first sight, I have not seen information if the different ranges have an impact on the power consumption

Puck.accelWr looks like a pretty straightforward command to configure the register that you have mentioned – and it should be short enough to be readily included into the experiment source. Smile

Is this an example of what you mean when you say use Puck.accelWr "to configure the register"?
http://www.espruino.com/modules/puckjsv2-accel-movement.js


RE: Changing gyro range for Puck-js sensor - Jens Noriʇzsɔɥ - 06-07-2023

(06-04-2023, 09:30 PM)Jens Noritzsch Wrote: Puck.accelWr looks like a pretty straightforward command to configure the register that you have mentioned – and it should be short enough to be readily included into the experiment source. Smile

There should have been this link: https://www.espruino.com/Reference#l_Puck_accelWr  Angel

The function arguments (“reg” and “data”) are documented in http://www.espruino.com/files/LIS3MDL.pdf

So, the file you linked is an example for this, yes.


RE: Changing gyro range for Puck-js sensor - scspaeth - 06-07-2023

Thank you for the clarification!


RE: Changing gyro range for Puck-js sensor - scspaeth - 06-13-2023

(06-07-2023, 04:00 PM)Jens Noritzsch Wrote:
(06-04-2023, 09:30 PM)Jens Noritzsch Wrote: Puck.accelWr looks like a pretty straightforward command to configure the register that you have mentioned – and it should be short enough to be readily included into the experiment source. Smile

There should have been this link: https://www.espruino.com/Reference#l_Puck_accelWr  Angel

The function arguments (“reg” and “data”) are documented in http://www.espruino.com/files/LIS3MDL.pdf

So, the file you linked is an example for this, yes.
Jens:
With the links you shared, I was able to find a code snippet (from Gordon@Espruino) that illustrated in more detail how to code the "reg" and "data" arguments to change the Full Scale range for the gyroscope:
https://forum.espruino.com/comments/15617612/
   
So, I was able to change the gyro range.
Thanks for your support.


RE: Changing gyro range for Puck-js sensor - Jens Noriʇzsɔɥ - 06-13-2023

Thanks for following up on this and congrats. Smile

Could you share the phyphox file format snippet that you have added (or the full file)?


RE: Changing gyro range for Puck-js sensor - scspaeth - 06-13-2023

I'm happy to share the full experiment file with the caveats that
  1. I am not a programmer and
  2. I have solved a specific need. I assume that Phyphox programmers probably could make a more general solution.

Do you just want the file or some of the backstory, too?