mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Gustavo Silva" <gustavograzs@gmail.com>,
	"Alex Lanzano" <lanzano.alex@gmail.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Lothar Rubusch" <l.rubusch@gmail.com>
Subject: Re: [PATCH v4 3/3] iio: imu: bmi270: add support for motion events
Date: Sat, 2 Aug 2025 12:58:21 +0100	[thread overview]
Message-ID: <20250802125821.2ae1b17b@jic23-huawei> (raw)
In-Reply-To: <20250727164909.1833c4bc@jic23-huawei>

On Sun, 27 Jul 2025 16:49:09 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> On Fri, 25 Jul 2025 00:26:35 +0300
> Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> 
> > On Thu, Jul 24, 2025 at 04:22:27PM +0100, Jonathan Cameron wrote:  
> > > On Wed, 16 Jul 2025 12:53:55 +0300
> > > Andy Shevchenko <andriy.shevchenko@intel.com> wrote:    
> > > > On Tue, Jul 15, 2025 at 08:55:35PM -0300, Gustavo Silva wrote:    
> > > > > On Tue, Jul 15, 2025 at 10:49:25AM +0300, Andy Shevchenko wrote:      
> > > > > > On Tue, Jul 15, 2025 at 10:37:22AM +0300, Andy Shevchenko wrote:      
> > > > > > > On Fri, Jul 11, 2025 at 08:36:03PM -0300, Gustavo Silva wrote:      
> > 
> > ...
> >   
> > > > > > > > +/* 9.81 * 1000000 m/s^2 */
> > > > > > > > +#define BMI270_G_MEGA_M_S_2				9810000      
> > > > > > > 
> > > > > > > I thought this is MICRO...      
> > > > > > 
> > > > > > Btw, what if we use the device on poles and on equator (or even on orbital
> > > > > > station)? I'm wondering if this constant should be defined in units.h or
> > > > > > even in uAPI that user space may add a correction if needed.
> > > > > >       
> > > > > I certainly hadn't thought about these scenarios.
> > > > > FWIW, the accelerometer scale values also assume g = 9.81 m/s^2.
> > > > > For example, 0.000598 = 2 * 9.81 / 32768      
> > > > 
> > > > Right, but this should be supplied to user space somehow. OTOH the measure error
> > > > may be high enough (what is the precision of the measurements by the way?) that
> > > > it will neglect the differences in the 'g' constant.
> > > > 
> > > > All the details are given in [1].
> > > > 
> > > > [1]: https://en.wikipedia.org/wiki/Gravity_of_Earth#:~:text=The%20precise%20strength%20of%20Earth's,/s2)%20by%20definition.    
> > > 
> > > These sensors don't measure relative to g.    
> > 
> > What do they measure? Any links for me to study?  
> m/s^2 (well actually not, but they derive that from change in properties of a capacitor like structure as it bends under
> the force generated by the acceleration.  Which in the vertical direction is g if the device isn't moving.
> 
> https://www.analog.com/en/resources/technical-articles/accelerometer-and-gyroscopes-sensors-operation-sensing-and-applications.html
> looks good as an intro from a very quick glance.
> 
> >   
> > > That's annoying marketing which is why I held firm for m/s^2 for IIO :)
> > > So what they measure for a given acceleration does not change depending
> > > on where we are on earth. You should use a 'fixed' standard value for
> > > conversion from marketing values in g to m/s^2..    
> > 
> > Hmm... But shouldn't that marketing value be exposed to user space?  
> 
> yes, but its 9.81 where ever you are. Or whatever the datasheet says they use.
> These things are rarely that well calibrated, so the exact value gets lost in the
> errors!
> 
> Jonathan
> 
I got lost in this thread, so perhaps am assuming there is a v5 to come.

Maybe just send one anyway even if no changes as it'll jump up my list to look at.

Jonathan

> 
> 
> > 
> >   
> 
> 


  reply	other threads:[~2025-08-02 11:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250711-bmi270-events-v4-0-53ec7da35046@gmail.com>
2025-07-11 23:36 ` Gustavo Silva
2025-07-15  7:37   ` Andy Shevchenko
2025-07-15  7:49     ` Andy Shevchenko
2025-07-15 23:55       ` Gustavo Silva
2025-07-16  9:53         ` Andy Shevchenko
2025-07-24 15:22           ` Jonathan Cameron
2025-07-24 21:26             ` Andy Shevchenko
2025-07-27 15:49               ` Jonathan Cameron
2025-08-02 11:58                 ` Jonathan Cameron [this message]
2025-08-04 22:26                   ` Gustavo Silva
2025-08-10 18:25                     ` Jonathan Cameron
2025-07-15 23:52     ` Gustavo Silva
2025-07-16  9:49       ` Andy Shevchenko
2025-07-24 15:28         ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250802125821.2ae1b17b@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=gustavograzs@gmail.com \
    --cc=l.rubusch@gmail.com \
    --cc=lanzano.alex@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®