cancel
Showing results for 
Search instead for 
Did you mean: 

How to optimise the power computation

Fede Rico
Associate III
Posted on September 26, 2017 at 11:58

Hi there,

I'm working on STM32F103 MCU and i need to compute the powerof a value.

I use the math.h library but I'm looking for a more optimised library, if it's exists.

Is there a better way to compute the power?

Best Regards,

F.

#math.h

Note: this post was migrated and contained many threaded conversations, some content may be missing.
11 REPLIES 11
Posted on September 26, 2017 at 16:46

I'm not working on a hobby project.

Fine, the initial posts just sounded like that.

Then I would think harder before pulling in floating point functions and libraries at all. You will see the impact on code space usage.

Having a look at the datasheet, I can't immediately identify an x^y  relation (power function).

Rather, it seems partially ambiguous (voltage for 2.0cm distance = voltage for 5.5cm distance).

I would make my own measurement, and perhaps try a table-based approach.

Posted on September 26, 2017 at 16:50

First I started with an existing library for arduino just for have a first solution in a small amount of time.

There are different approach to this sensor: power, division, lookup table.

I'm try to find the approach that balance the accuracy and limited calculation time