#avr Logs

Oct 24 2018

#avr Calendar

12:44 AM rue_shop3: wtf, every one of my timer calcs are out by a factor of 2
12:47 AM rue_shop3: 4.8Mhz
12:47 AM rue_shop3: timer using /64
12:47 AM rue_shop3: 150 counts
12:47 AM rue_shop3: 0.85ms
12:55 AM rue_mohr: I can accpe that the .85 is an 'off' 1ms
12:55 AM rue_mohr: but thats still a factor of 2
12:55 AM rue_mohr: what the heck is going on
12:56 AM rue_mohr: according to the timer, I'm running at 4.5Mhz
12:56 AM rue_mohr: arg, tahts the wrong way
01:02 AM rue_mohr: and so in lies the problem
01:02 AM rue_mohr: I need a 2ms range
01:03 AM rue_mohr: I can divide the system clock by 1, 8, 64, 256, or 1024
01:03 AM rue_mohr: with /64, I'm supposed to get 2ms, and I get 1ms
01:03 AM rue_mohr: which means I need twice the value
01:03 AM rue_mohr: I need 2*150 = 300
01:03 AM rue_mohr: however I have an 8 bit counter
01:04 AM rue_mohr: so, I need to half the clock rate
01:04 AM rue_mohr: which I cant, cause my choice is /256
01:04 AM rue_mohr: so, lets play that out
01:05 AM rue_mohr: to make this come out to 0.85ms
01:06 AM rue_mohr: the source clock would have to be 11.3Mhz
01:11 AM rue_mohr: well, by the time its done, I get a resolution of 9
01:12 AM rue_mohr: I think people will be ok with that
01:12 AM rue_mohr: people like horrid resolutions on their servo controllers
01:16 AM rue_mohr: I dont want to count overflows
01:30 AM rue_mohr: I should start talking to myself
01:30 AM rue_mohr: I wouldn't mind
01:36 AM rue_mohr: at this rate I'd be better off using the adc interrupt to time the servo pulse
01:36 AM rue_mohr: no, the rate you need would be too high
01:37 AM rue_mohr: not if I have FAST code
01:37 AM rue_mohr: no, its not gonna be fast enough for that
01:38 AM rue_mohr: ok, throw me a bone
01:39 AM rue_mohr: my only other suggested would be the main loop
01:39 AM rue_mohr: but timing stability
01:39 AM rue_mohr: the main loop is fast
01:40 AM rue_mohr: your saying missing a few counts wront matter?
01:40 AM rue_mohr: it wont be much error
01:40 AM rue_mohr: servos dont like _any_ jitter
01:41 AM rue_mohr: your still trying to make code that performs waay over the capabilites anyone is used to
01:41 AM rue_mohr: besides, the serial interrupt will throw things out
01:41 AM rue_mohr: hmm
01:41 AM rue_mohr: how do we do good timing
01:41 AM rue_mohr: all the speeds are wrong
01:42 AM rue_mohr: if it wan't a challange it wouldn't be fun eh?
01:42 AM rue_mohr: what if I game loop this whole thing
01:46 AM rue_mohr: how the hell you gonna do that
01:46 AM rue_mohr: linear state machine?
01:46 AM rue_mohr: there isn't enough code space for it
01:46 AM rue_mohr: what if I can roll up a simotanious state machine
01:47 AM rue_mohr: well define it
01:47 AM rue_mohr: uh
01:47 AM rue_mohr: cmon, inputs outputs, feedback.
01:47 AM rue_mohr: ok, well
01:47 AM rue_mohr: inputs are serial data bit and uh, loop count
01:50 AM Thrashbarg: there is a lot to be said for talking to ones self
02:42 AM polprog: i would at least use two separate computers :D
02:42 AM MarcinWieczorek_ is now known as MarcinWieczorek
03:04 AM The_Mad_Pirate is now known as TMP|Away
09:24 AM rue_mohr: yea, but I'm unlike anyone
09:54 AM vmt: polprog: i think rue does have multiple computers all running irc clients
09:54 AM vmt: judging by /names
09:54 AM polprog: separate clients, yeah
09:54 AM vmt: yes. it's more fun that way
09:54 AM rue_mohr: mmmm redundancy
09:55 AM vmt: sweet sweet redundancy. yummeh
09:55 AM polprog: rue_shop5 is this one new? i think it used to be only 3
09:55 AM vmt: :D
09:55 AM polprog: :D
09:55 AM rue_mohr: there have been so many shop computers over the years I'v lost count
09:55 AM vmt: how do i do proper hysteresis with weighed values or is this a no-go to begin with
09:56 AM rue_mohr: so I make the backup aliases a bit higher than the highest number I can remember
09:56 AM rue_mohr: hysteresis for what?
09:56 AM polprog: provided by the department of redundancy department
09:56 AM vmt: well, input in general
09:56 AM rue_mohr: digital input?
09:56 AM vmt: in general, the application is irrelevant
09:57 AM rue_mohr: inputs already have hyteresis
09:57 AM vmt: dude
09:57 AM vmt: i just said --
09:57 AM polprog: you could take an array of x past values and apply weights, based in on the age of the sample, making a fir
09:57 AM vmt: polprog: that's what i'm trying to do but... i need a very particular formula
09:57 AM polprog: i should experiment with those - without excess math
09:58 AM rue_mohr: do you want hyteresis or debounce?
09:58 AM vmt: e.g. i'm thinking for last n values i'll have a weight factor which scales linearly from .x to 1 oldest->latest
09:58 AM polprog: you could try a log function
09:58 AM vmt: but i think i need something else than lerp
09:59 AM polprog: or 1/x
09:59 AM vmt: mmm, something like that possibly
09:59 AM polprog: damn i wanna write something like this now. i could make it even in perl
10:00 AM polprog: my gut tells me it should be a falling function or whatever you call that
10:00 AM vmt: and nah, this isn't for mcus. x86 shizzle.
10:00 AM polprog: like f(x) = -x + constant
10:00 AM polprog: or even can be a polynomial
10:00 AM vmt: that's linear
10:01 AM polprog: yeah that one is
10:01 AM vmt: x^n might be interesting
10:01 AM polprog: but its an increasing
10:01 AM polprog: you could translate it and transform to (-x + constant)^n
10:02 AM polprog: so its decreasing as x increases
10:02 AM rue_mohr: thats not hyteresis
10:02 AM vmt: it would weighing for the hysteresis
10:02 AM polprog: its a filter nevertheless
10:02 AM polprog: yeah
10:02 AM vmt: polprog: yes, obviously
10:02 AM polprog: so you want sort of a hysteresis with a lowpass ?
10:03 AM vmt: yeah, i've been looking for different kinds of lpf implementations
10:03 AM vmt: but i need a very specific kind of
10:03 AM vmt: there was a paper i bookmarked yesterday... but unfortunately i don't have it on me right now
10:04 AM rue_mohr: IIF?
10:04 AM vmt: it had a frequency dependent lpf implementation
10:04 AM rue_mohr: IFF?
10:04 AM vmt: don't know, i only skimmed it through
10:04 AM rue_mohr: I know of a freq dep filter, but its analog
10:05 AM vmt: it's all on the level of mathematics, here.
10:05 AM vmt: the actual implementation is irrelevant, only the algorithm is of any importance
10:06 AM polprog: isnt a filter frequency dependent by definition?
10:07 AM vmt: well, if you think about the cutoff, then yes
10:07 AM vmt: but the implementation varies the cutoff
10:07 AM polprog: obviously
10:08 AM rue_mohr: there is a type of filter that changes its centre freq based on whats dominant, its used to enhance speech
10:08 AM vmt: the algorithm in the paper was similar to that
10:09 AM vmt: and apparently i didn't bookmark it. oh well, i gotta dig it up later.
10:09 AM rue_mohr: I cant remember where I came across it
10:10 AM rue_mohr: is was one of the tangents of the FFT code I did on the m328
10:16 AM rue_mohr: https://www.youtube.com/watch?v=td7jzhWz-B0
10:16 AM rue_mohr: you would not beleive how tight the math is for fft using only 8 bits
10:16 AM rue_mohr: I only had the 3 bits left for the bar graph
10:26 AM polprog: i should sit to c/perl/methlab and play with filters
10:26 AM rue_mohr: hah
10:26 AM polprog: i just got an idea how to implement a fir and an iir
10:27 AM rue_mohr: they are easy
10:27 AM polprog: yeah
10:27 AM nohit: i should get methlab when i still can get it for student price
10:27 AM rue_mohr: ok, I have to be at the job at 9
10:27 AM rue_mohr: its a 10 min drive
10:27 AM rue_mohr: pesimistically
10:27 AM polprog: i thought the give it out for free to students
10:27 AM rue_mohr: its 8:27 now
10:28 AM polprog: rue_mohr: got a job recently?
10:28 AM nohit: its like 69e for students
10:28 AM polprog: ouchie
10:28 AM rue_mohr: I been an electrician for 11 years now
10:28 AM nohit: and it includes 10 additional "modules"
10:28 AM rue_mohr: use gcc
10:28 AM nohit: you can create vst plugins with it these days
10:28 AM polprog: well, i have version R12.. it came with the kind of installer that displays a full screen blue gradient while doing its stuff :p
10:29 AM polprog: nostalgia kicked in
10:29 AM rue_mohr: BSOD?
10:29 AM rue_mohr: back from your windows days?
10:29 AM polprog: the other kind of blue
10:29 AM polprog: :p
10:29 AM rue_mohr: obadee abadii
10:30 AM rue_mohr: cat needs to be fed like 8 more times this morning
10:30 AM rue_mohr: arg, I'll need time to put my shoes on...
10:30 AM nohit: polprog seems like they have "campus-wide license" option
10:30 AM rue_mohr: 9:00 <-- 8:50
10:31 AM nohit: so some get it free
10:31 AM rue_mohr: if I start out at 8;40 I should be fine
10:31 AM polprog: is it free software then :p
10:32 AM nohit: this is pretty cool https://se.mathworks.com/products/audio-system.html
10:32 AM rue_mohr: IIR filter?
10:32 AM rue_mohr: ah yes, and fir
10:32 AM rue_mohr: that was it
10:32 AM rue_mohr: convolution of the fft
10:33 AM polprog: nohit: real nerds listen to their music in matlab?
10:33 AM polprog: the toolboxes are awesome
10:33 AM polprog: even in my ancient version simulink is great
10:34 AM rue_mohr: --
10:35 AM nohit: --
10:35 AM polprog: ++
10:35 AM polprog: ++
10:35 AM skz81: ++
10:35 AM polprog: the channel charge must be neutral
10:35 AM nohit: --
10:35 AM skz81: ok
10:35 AM polprog: :)
10:35 AM rue_mohr: heh, in like 5 minutes, the channel will go dead for the next 8 hours
10:36 AM skz81: <polprog> the channel charge must be neutral >> but does it have a spin ?
10:37 AM vmt: it has a meatspin.
10:37 AM vmt: rue_mohr: revel in your time
10:37 AM polprog: http://qdb.us/306442
10:38 AM vmt: qdb is bash?
10:38 AM vmt: looks similar enough
10:39 AM skz81: vmt, yup bash.org points to QDB
10:40 AM vmt: figured
10:40 AM vmt: because a .us domain and qdb is much more hip nowadays, figures
11:47 AM vmt: mgtow. rofl.
01:50 PM -!- #avr mode set to +ns by verne.freenode.net
01:56 PM -!- #avr mode set to -o by verne.freenode.net
01:56 PM -!- #avr mode set to +ct-s by verne.freenode.net
01:56 PM -!- #avr mode set to +bbbb by verne.freenode.net
01:56 PM -!- #avr mode set to +bbbb by verne.freenode.net
01:56 PM -!- #avr mode set to +bbbb by verne.freenode.net
01:56 PM -!- #avr mode set to +bb by verne.freenode.net
01:56 PM -!- #avr mode set to +bbbb by verne.freenode.net
01:56 PM -!- #avr mode set to +bbbb by verne.freenode.net
01:56 PM -!- #avr mode set to +bbbb by verne.freenode.net
01:56 PM -!- #avr mode set to +qq by verne.freenode.net
01:56 PM verne.freenode.net changed topic of #avr to: Emil hates Rue and will be promoting his own channel, #avrs | http://www.engbedded.com/fusecalc/
01:56 PM c-log is now known as Guest42374
10:09 PM [1]MrMobius is now known as MrMobius
10:42 PM phasevel: Is a SPI signal with a clock of 100kHz too high for programming a new Atmega8A?
11:14 PM day__ is now known as day