Topic for #qi-hardware is now Copyleft hardware - http://qi-hardware.com | hardware hackers join here to discuss Ben NanoNote, atben / atusb 802.15.4 wireless, and other community driven hw projects | public logging at http://en.qi-hardware.com/irclogs
LunaVorax has quit [Quit: Quitte]
urandom__ has joined #qi-hardware
emeb has quit [Quit: Leaving.]
urandom__ has quit [Quit: Konversation terminated!]
nerd has quit [Quit: WeeChat 0.3.9.2]
wolfspra1l has quit [Quit: Lost terminal]
DocScrutinizer05 has quit [Disconnected by services]
DocScrutinizer05 has joined #qi-hardware
wolfspraul has joined #qi-hardware
panda|x201 has joined #qi-hardware
Hoolxi has joined #qi-hardware
LunaVorax has joined #qi-hardware
pcercuei has quit [Quit: dodo]
LunaVorax has quit [Quit: Quitte]
Hoolxi has quit [Ping timeout: 264 seconds]
urandom__ has joined #qi-hardware
antgreen has joined #qi-hardware
Hoolxi has joined #qi-hardware
LunaVorax has joined #qi-hardware
Hoolxi has quit [Remote host closed the connection]
LunaVorax has quit [Quit: Quitte]
jurting has joined #qi-hardware
jurting has quit [Read error: Connection reset by peer]
jurting has joined #qi-hardware
jurting has quit [Read error: Connection reset by peer]
Jurting_ has joined #qi-hardware
Jurting_ is now known as Jurting
Jurting has quit [Read error: Connection reset by peer]
Jurting_ has joined #qi-hardware
Jurting_ is now known as Jurting
Jurting has quit [Read error: Connection reset by peer]
Jurting_ has joined #qi-hardware
Jurting_ is now known as Jurting
Jurting has quit [Client Quit]
<wpwrak>
hmm. given a tiny little AVR with not a lot of memory (1 kB) and an analog signal that's somewhat periodic with period ~700 samples, but in a fairly chaotic way. (it's the output of an acceleration sensor at the of of a chain) how to detect the period ? of course the chip is far too weak for, say, fft.
<wpwrak>
actually, the data is so messy that i may even be looking at the wrong axis. checking ...
pcercuei has joined #qi-hardware
guanucoluis has joined #qi-hardware
rz2k has joined #qi-hardware
<whitequark>
wpwrak: I'd try this:
<whitequark>
add a table for your estimation of what the signal could be, and then for each sample compare the value at dt corresponding with predicted period with the actual value
<whitequark>
then adjust predicted period with something like PID based on the error
<kyak>
whitequark: how do you suggest to predict period?
<wpwrak>
there's an algorithm that takes two waveform and calculates something like the integral of |f(t)-f(t+x)|, varying x over the expected range of the period. the value of x that yields the smallest difference is the period.
<wpwrak>
unfortunately, the details of the difference may be tricky (for quantization errors, etc.). and it needs to store many samples and needs lots of cycles. all things that little critter doesn't have :(
lekernel__ has joined #qi-hardware
lekernel_ has quit [Ping timeout: 255 seconds]
<kyak>
basically what you are suggesting is an optimization algorithm, which finds local minimum. So you must provide a good estimation (i.e. initial value)
<wpwrak>
i have a range of plausible values. the underlying movement is a rotation, and it can't be too slow (or the thing doesn't work) and there are also (human) limits to how fast you can spin it
<wpwrak>
ah, and when i flip axes, things look much better :)
<wpwrak>
to visualize with gnuplot: plot "<bzcat monitor-0.bz2" with lines
<wpwrak>
sample rate is 2 kHz. it's from an acceleration sensor that faces towards the center of rotation, so as centrifugal force increases, the values get smaller. 512 is 0 g, 0 is 18 g. 1023 would be -18 g.
<wpwrak>
there are basically two regimes: smooth rotation, e.g. from 20-40k or from 80-110k where the signal is a bumpy sine wave (in an ideal world, it would of course be perfectly smooth)
<wpwrak>
when going fast, around 40-60k, the rotation isn't so smooth anymore because the chain "jumps". so the sinusoid is overlaid with sharp kicks
<wpwrak>
the DC component reflects the expected centrifugal force very accurate. (from 2 Hz to 3 Hz, the ratio is about 4:9). good. i have not disproven the basic laws of physics :)