Page 2 of 4

Re: data write speeds and broken SD cards

Posted: Mon Sep 15, 2014 1:54 pm
by blmorris
Yes, you have the most straightforward use case here - read bytes from sensors, write bytes to file, optimize to collect as much data as you can and take all the time you need to analyze offline.
Cool project, looking forward to hearing more!
-Bryan

Re: data write speeds and broken SD cards

Posted: Tue Sep 16, 2014 7:33 pm
by Turbinenreiter
A little preview ...
figs.png
figs.png (171.02 KiB) Viewed 9410 times

Re: data write speeds and broken SD cards

Posted: Tue Sep 16, 2014 9:04 pm
by dhylands
Cool - What software are you using to produce the plots?

Re: data write speeds and broken SD cards

Posted: Wed Sep 17, 2014 1:25 am
by blmorris
Looks like you could use an accelerometer with a little more dynamic range - your acceleration plot appears to show a_x saturated for several readings at -16g (is that the maximum reading the pyboard accelerometer is capable of?)
Thanks for sharing!
-Bryan

Re: data write speeds and broken SD cards

Posted: Wed Sep 17, 2014 8:37 am
by Turbinenreiter
@dhylands: matplotlib
@blmorris: The onboard accelerometer (shown in 'uaccelerations') of the pyboard has a range of +-1.5g, the MPU9150 ('accelerations') has +-16g.
The ADXL377 does +-200g and I guess I will try that. The actual accelerations of the launch are probably going up to 25, maybe 30g. In addition to that you have shocks, with insane g-loads.

Re: data write speeds and broken SD cards

Posted: Tue Sep 23, 2014 5:26 pm
by Turbinenreiter
Have any of you experienced 'hangs'?

In my loop, I call gc.collect() on every iteration. Most of the time it runs at constant 200Hz, but sometimes it would hang for about 5s. If I only call gc.collect() on every n-th iteration, it happens more often. At the moment, I collect on every second iteration (using i%2==0), it runs at 400Hz and the hangs are very seldom.
It seems connected to the garbage collector, but it is strange. Usually, collecting regularly avoids those long collections.

Re: data write speeds and broken SD cards

Posted: Mon Sep 29, 2014 8:19 am
by Turbinenreiter
I nailed that down to the file.write(). It usually takes 5ms, but then suddenly 5000ms for one time. closing and reopening doesn't help. flushing also doesn't help.

/edit: nopes. it's not the file.write(). happens even if i comment that out.

//edit: adding a 1ms delay seems to fix that. still no idea what's happening. sample rate now at 900 Hz.

Re: data write speeds and broken SD cards

Posted: Mon Oct 27, 2014 12:27 pm
by Turbinenreiter
The board survived rocket crashes, but not me dropping it from half a meter heigth.

Any ideas? I have some µSD card breakout boards - maybe I will figure out how to use them with the pyboard.

https://drive.google.com/file/d/0B2UZjB ... sp=sharing

Re: data write speeds and broken SD cards

Posted: Mon Oct 27, 2014 3:48 pm
by blmorris
Turbinenreiter wrote:The board survived rocket crashes, but not me dropping it from half a meter heigth.

Any ideas? I have some µSD card breakout boards - maybe I will figure out how to use them with the pyboard.
Can't see the picture that you posted - even tried to cut and paste the link and got a message about not having permission to access it.
-Bryan

Edited to add:
I see that the solder pads came off with the micro-SD connector. That's a drag, certainly complicates things when you can't access the pins for the removable storage (RSI) interface.
Have you considered trying to write to an SD card in 1-bit SPI compatible mode? You would probably need to write your own driver to make it work in micropython though.

Re: data write speeds and broken SD cards

Posted: Thu Oct 30, 2014 8:09 am
by pythoncoder
@Turbinenreiter
Have you considered running your code from the internal flash and storing your data on an external FRAM module like this
http://proto-pic.co.uk/adafruit-i2c-non ... t-32kbyte/? Of course it may be too small or too slow.

It's a credit to the Micropython board that it can survive these G loadings. More years ago than I care to remember I worked on the development of telemetry for guided missiles. We went to extraordinary lengths to ensure the kit survived the launches. It used radio to transmit its readings so it didn't have to survive the landings ;)

Regards, Pete