Reply by December 13, 20192019-12-13
On Thu, 12 Dec 2019 20:30:19 +0000, Martin Brown
<'''newspam'''@nezumi.demon.co.uk> wrote:

>On 12/12/2019 13:23, Winfield Hill wrote: >> Przemek Klosowski wrote... >>> >>> On Fri, 15 Nov 2019 14:37:14 -0800, Winfield Hill wrote: >>> >>>> It's a painful to do the absolute humidity conversion >>>> formula in an ARM M0 processor, without floating point. >>> >>> Just table-lookup it to death? You should have a lot >>> of flash for detailed data, no? >> >> Alan Stern, the Institute mathematician, who did all >> the programming for the beehive monitor, including >> the 14-sensor TH-stick, which includes the AGP30, >> tells me the floating-point libraries work just fine, >> but it's just slower.
There are a few things that make floating point libraries lower compared to integer implementations. One is the adherence to IEEE "oddities", such as NaNs, infinities, non-normalized small values etc. In a small system, in which the majority of operations are done with integers (or fixed points) and only some library functions such as log(x) is called, you first have to convert the argument to floating point and the result back to integer. These conversions are nasty, which requires normalization and denormalization, which is quite slow, if no hardware support is available. Floating addition and subtraction also suffer from the same problem. Floating multiplication and division are simpler which are no worse than integer mul/div.
>> We do have the time, but maybe >> with all the huge masses of code he's written, he's >> running out of motivation to add more complication. > >How large a dynamic range do you have to do the humidity correction >over? It may well be possible to devise a scaled integer implementation >for the correction provided that you only want say 0.1% accuracy. > >Rational polynomials will get you quite good approximations to arbitrary >functions which in the case of humidity corrections I suspect is fairly >close to exp(x) or log(1+x) depending on how you have cast the problem.
In a floating point implementation, these functions are typically implemented by first normalizing the value between 0.5 to 1.0 and a 3rd or 4th order polynomial is used to approximate the result to 6 or 7 significant digits. Of course a floating point argument has already been normalized in the floating point format. It should be noted that doing the polynomial in a floating point library, multiple slowish floating point adds are also required. Doing for instance log2(x) entirely in integers first requires checking the input range and flagging "impossible" values before going further, thus no need for infinities. The argument is then normalized, requiring 4-5 instructions/bit. The polynomials are then done with integer multiplications and additions, (with possible shifts when fixed point values are used). There are only one normalization compare to several when floating point libraries are used.
Reply by Jasen Betts December 12, 20192019-12-12
On 2019-12-12, DecadentLinuxUserNumeroUno@decadence.org <DecadentLinuxUserNumeroUno@decadence.org> wrote:
> Lasse Langwadt Christensen <langwadt@fonz.dk> wrote in > news:ec8c7434-859e-4b01-87da-192caf0e31bd@googlegroups.com: > >> I can see the differences, higher price, less performance, less >> memory. so .. >> >> > > Less performance and memory than a pi? Wachutalkinbout, dingledorf?
https://www.cyberciti.biz/linux-news/raspberry-pi-4-released-complete-specs-and-pricing/ more clock speed, more ram, faster USB, half the price. -- When I tried casting out nines I made a hash of it.
Reply by Winfield Hill December 12, 20192019-12-12
Klaus Kragelund wrote...
> > On Thursday, December 12, 2019, Winfield Hill wrote: >> DecadentLinuxUserNumeroUno@decadence.org wrote... >>> Lasse Langwadt Christensen wrote >>>> >>>> you want to replace a $1 M0 mcu with a $100 A9 running linux? >>>> in what way does that make any sense? >>> >>> How is a Pi a "$1 MO mcu"? >> >> The Feather we are using has an Atmel ATSAMD21G18, >> ARM Cortex M0+, which is about $2.50 on Octopart. >> But I have seen Atmel's ARM Cortex M0 under $1. > > If you can settle for 32kB Cortex M0+, they can be had > below $0.3, but then you need to take significant quantity
My RIS-788 beehive monitor is a complex instrument: more than 250 parts on its mobo, many more on plug-in boards. It had more than 75 sensors in total. More than $150 in parts costs, $100 of machine-assembly costs, plus $100 of engineer/technician final-assembly costs.** Controller expenditure was in the noise level. The plug-in Feather, with its program, $18, ended up being a huge convenience. The low cost of the ATSAMD21G18 was an important aspect. ** Total quantity made: 30 pieces. Total bees monitored, about 1 million. About $0.01 per bee. But they worked their asses off, that's worth 1 cent. Well, OK, maybe for scientific purposes, too expensive for commercial purposes. For that the cost/bee has to be well under 0.05 cent. -- Thanks, - Win
Reply by Klaus Kragelund December 12, 20192019-12-12
On Thursday, December 12, 2019 at 8:13:27 PM UTC+1, Winfield Hill wrote:
> DecadentLinuxUserNumeroUno@decadence.org wrote... > > Lasse Langwadt Christensen wrote > >> > >> you want to replace a $1 M0 mcu with a $100 A9 running linux? > >> in what way does that make any sense? > > > > How is a Pi a "$1 MO mcu"? > > The Feather we are using has an Atmel ATSAMD21G18, > ARM Cortex M0+, which is about $2.50 on Octopart. > But I have seen Atmel's ARM Cortex M0 under $1. >
If you can settle for 32kB Cortex M0+, they can be had below $0.3, but then you need to take significant quantity Cheers Klaus
Reply by December 12, 20192019-12-12
Winfield Hill <winfieldhill@yahoo.com> wrote in 
news:qsu3g402c3p@drn.newsguy.com:

> DecadentLinuxUserNumeroUno@decadence.org wrote... >> Lasse Langwadt Christensen wrote >>> >>> you want to replace a $1 M0 mcu with a $100 A9 running linux? >>> in what way does that make any sense? >> >> How is a Pi a "$1 MO mcu"? > > The Feather we are using has an Atmel ATSAMD21G18, > ARM Cortex M0+, which is about $2.50 on Octopart. > But I have seen Atmel's ARM Cortex M0 under $1. > >
But that is not the only component.
Reply by December 12, 20192019-12-12
Lasse Langwadt Christensen <langwadt@fonz.dk> wrote in
news:ec8c7434-859e-4b01-87da-192caf0e31bd@googlegroups.com: 

> I can see the differences, higher price, less performance, less > memory. so .. > >
Less performance and memory than a pi? Wachutalkinbout, dingledorf? You on drugs? Oh and lets not even notice the interfaces on it. I'd bet the MTBF is a couple orders of magnitude better too.
Reply by Martin Brown December 12, 20192019-12-12
On 12/12/2019 13:23, Winfield Hill wrote:
> Przemek Klosowski wrote... >> >> On Fri, 15 Nov 2019 14:37:14 -0800, Winfield Hill wrote: >> >>> It's a painful to do the absolute humidity conversion >>> formula in an ARM M0 processor, without floating point. >> >> Just table-lookup it to death? You should have a lot >> of flash for detailed data, no? > > Alan Stern, the Institute mathematician, who did all > the programming for the beehive monitor, including > the 14-sensor TH-stick, which includes the AGP30, > tells me the floating-point libraries work just fine, > but it's just slower. We do have the time, but maybe > with all the huge masses of code he's written, he's > running out of motivation to add more complication.
How large a dynamic range do you have to do the humidity correction over? It may well be possible to devise a scaled integer implementation for the correction provided that you only want say 0.1% accuracy. Rational polynomials will get you quite good approximations to arbitrary functions which in the case of humidity corrections I suspect is fairly close to exp(x) or log(1+x) depending on how you have cast the problem. -- Regards, Martin Brown
Reply by Winfield Hill December 12, 20192019-12-12
Tauno Voipio wrote...
> > Can the programming specifications of the > sensor be found somewhere?
Yes, it's on the datasheet, plus more info at Sensirion, https://www.sensirion.com Sorry, the correct p/n is SGP30. -- Thanks, - Win
Reply by Tauno Voipio December 12, 20192019-12-12
On 12.12.19 21:13, Winfield Hill wrote:
> DecadentLinuxUserNumeroUno@decadence.org wrote... >> Lasse Langwadt Christensen wrote >>> >>> you want to replace a $1 M0 mcu with a $100 A9 running linux? >>> in what way does that make any sense? >> >> How is a Pi a "$1 MO mcu"? > > The Feather we are using has an Atmel ATSAMD21G18, > ARM Cortex M0+, which is about $2.50 on Octopart. > But I have seen Atmel's ARM Cortex M0 under $1. > >
Win, Can the programming specifications of the sensor be found somewhere? -- -Tauno
Reply by Winfield Hill December 12, 20192019-12-12
DecadentLinuxUserNumeroUno@decadence.org wrote...
> Lasse Langwadt Christensen wrote >> >> you want to replace a $1 M0 mcu with a $100 A9 running linux? >> in what way does that make any sense? > > How is a Pi a "$1 MO mcu"?
The Feather we are using has an Atmel ATSAMD21G18, ARM Cortex M0+, which is about $2.50 on Octopart. But I have seen Atmel's ARM Cortex M0 under $1. -- Thanks, - Win