#avr Logs

Jan 09 2021

#avr Calendar

02:27 PM vgtw_ is now known as vgtw
05:36 PM vmt: --
07:04 PM rue_mohr: has anyone here ever had a stereo with a treble/bass adjust, or an EQ ?
07:06 PM rue_mohr: amazing
07:06 PM rue_mohr: I dont think anyone is a real person
07:15 PM Thrashbarg: rue_mohr: show me a stereo without one
07:16 PM rue_mohr: yay! a real person!
07:16 PM rue_mohr: ok, are you familiar with PID a bit?
07:21 PM Thrashbarg: there are many things called PID
07:25 PM vmt: oh i think i have an idea where this is going
11:14 PM rue_mohr: ok I figured out the issue
11:14 PM rue_mohr: it was my test system
11:15 PM rue_mohr: Thrashbarg, ok, sorry LONG phonecall, you still here?
11:15 PM Thrashbarg: yup
11:15 PM rue_mohr: ok, so, PID is a 3 band eq
11:15 PM rue_mohr: a cheap one,
11:15 PM rue_mohr: volume, treble, bass
11:15 PM rue_mohr: volume is the P, treble is the D and bass is the I
11:16 PM Thrashbarg: ok
11:16 PM rue_mohr: now, on a stereo, treble and bass have a leveling-off frequency
11:16 PM rue_mohr: on one side of which the gain just levels off
11:17 PM rue_mohr: in a stereo they choose those freqs, just like the freqs on a graphic EQ are fixed
11:18 PM rue_mohr: https://dt7v1i9vyp3mf.cloudfront.net/styles/news_large/s3/imagelibrary/q/qa_0420_01-X48btHIBNEFlhPwYvITKn6E0RLOSDaKl.jpg
11:18 PM Thrashbarg: yup
11:29 PM rue_mohr: but PID doesn't use a "high pass" or "low pass"
11:29 PM rue_mohr: it uses integrators and differentiators
11:29 PM rue_mohr: so they cant really control the curve a lot
11:30 PM rue_mohr: becasue integrators and differentiators have no frequency cut-off
11:30 PM rue_mohr: but its easy to calculate, someone must have done it as an optimization at some point
11:30 PM rue_mohr: now we have the horsepower to do some better filters
11:31 PM rue_mohr: but I'm curiuos to see what PID compensation looks like
11:31 PM rue_mohr: I'v managed to get an integrator and differentiator working properly in some test code that does a freq sweep
11:33 PM rue_mohr: what i dont get is that the two things should cancel each other out
11:33 PM rue_mohr: but there is a practical limit
11:33 PM rue_mohr: 8 bits for example, is only good to -48db
11:33 PM rue_mohr: so, any signal weaker than that cant be amplified
11:33 PM rue_mohr: which makes a sort of bottom cutout
11:37 PM rue_mohr: so
11:37 PM rue_mohr: naturally
11:37 PM rue_mohr: http://ruemohr.org/~ircjunk/tempimage/foo10.png
11:38 PM rue_mohr: a differentiator has a gain that is well below 0db
11:38 PM rue_mohr: http://ruemohr.org/~ircjunk/tempimage/foo100.png
11:38 PM rue_mohr: and an integrator has a gain well above 0db
11:39 PM rue_mohr: Thrashbarg, this all seem fine so far?
11:40 PM rue_mohr: in those graphs the sample rate is 20khz
11:40 PM Thrashbarg: so you're trying to apply the methods of a PID controller to audio?
11:41 PM rue_mohr: no, I'm just talking about it in regards to audio
11:41 PM Thrashbarg: ok
11:41 PM rue_mohr: because the bass/treble adjust of a stereo, is almost exactly the same
11:41 PM Thrashbarg: https://en.wikipedia.org/wiki/PID_controller
11:41 PM rue_mohr: does it mention the D is high-pass?
11:41 PM rue_mohr: most wikipedia articles are garbage
11:42 PM Thrashbarg: D is differential, which can be approximated as a high pass
11:42 PM Thrashbarg: i.e. only the differences in signal get in
11:42 PM rue_mohr: yes, it a high pass with no corner freq
11:42 PM Thrashbarg: sorry, derivative
11:42 PM Thrashbarg: integral is low pass, derivative is high pass
11:43 PM rue_mohr: yup
11:43 PM rue_mohr: but they cant control the roll-off rate, and there is no corner freq so you can adjust where it takes effect
11:44 PM rue_mohr: which I think was asacrifice for optimization
11:44 PM rue_mohr: but I dont even see any bode plots in there
11:45 PM rue_mohr: just step response, so that article is garbage
11:45 PM Thrashbarg: lol it was probably written by a PID programmer, you know, industrial control
11:45 PM rue_mohr: furthermore, the limit of performance is the slew rate of the system
11:45 PM rue_mohr: and they typically dont mention this
11:46 PM Thrashbarg: I would've thought PID's weren't very applicable to audio lol
11:46 PM rue_mohr: the optimal performace is a slope that IS the slew rate the system can deliver with an underdamped de-accel(system max) to your level
11:47 PM rue_mohr: yea, I'v had a number of realizations that have opened up a world of understanding
11:47 PM rue_mohr: so, I have a servo
11:47 PM rue_mohr: not a hobby one
11:48 PM rue_mohr: https://twitter.com/RueNahcMohr/status/1345698657958432768
11:49 PM rue_mohr: that is with an analog high pass filter
11:49 PM rue_mohr: I was really surprised that the mechanical system, given a freq sweep, seemed to just be a low pass, no really funkey curves
11:50 PM rue_mohr: so
11:50 PM rue_mohr: the idea is to move that analog filter into the code
11:52 PM rue_mohr: the analog version tells me the gain and corner freq the filter needs
11:52 PM rue_mohr: heh, but
11:52 PM rue_mohr: I tuned it when the motor driver had heated up, and its gain was lower
11:52 PM rue_mohr: when I turn it on cold, it has some overshoot