#robotics Logs

Jan 03 2021

#robotics Calendar

12:00 AM rue_shop1: polprog, I redid the servo controller in analog, and the pole moved to 1.4Hz
12:07 AM rue_shop1: :/
12:07 AM veverak: damn it
12:07 AM veverak: making the input in radians gives me headache
12:07 AM rue_shop1: who is doing it in radians?
12:07 AM veverak: me
12:07 AM veverak: evidently
12:27 AM rue_mohr: https://twitter.com/RueNahcMohr/status/1345613931092398080
12:30 AM rue_mohr: ok, now I can haphazardly jab in a high pass filter and see what I can make it do
12:31 AM rue_mohr: high pass is....
12:31 AM rue_mohr: still cant remember this...
12:31 AM rue_mohr: veverak, is a high pass filter I or D?
12:31 AM veverak: how should I know?
12:31 AM rue_mohr: its D
12:32 AM rue_mohr: so I'm gonna make this a PD filter
12:32 AM rue_mohr: controller
12:32 AM rue_mohr: whatever
12:32 AM rue_mohr: what you see there is just P
12:34 AM rue_mohr: so, where do I want to put the high pass filter
12:34 AM rue_mohr: I need to choose a freq and gai
12:34 AM rue_mohr: n
12:37 AM rue_mohr: so, another problem is that
12:37 AM rue_mohr: oh wait
12:37 AM rue_mohr: yea
12:37 AM rue_mohr: hu?
12:38 AM rue_mohr: say that again
12:38 AM rue_mohr: the falloff of your filter is multiplied by your gain
12:38 AM rue_mohr: so, if I have a filter that falls of a 6db/decade, and I have a gain of 2, I get 9db/decade
12:38 AM rue_mohr: pretty sure, yea
12:39 AM rue_mohr: ok, so I need 30db/decade
12:39 AM rue_mohr: I think were starting from 6
12:41 AM rue_mohr: wait
12:41 AM rue_mohr: bastards
12:45 AM rue_mohr: /decade vs //octave
12:45 AM rue_mohr: 6db/octave
12:46 AM rue_mohr: 20db/decade
12:46 AM rue_mohr: so, 30db/decade isn't insane
12:55 AM rue_mohr: ok, so I take a 20db/decade filter, and multiply it by something, it'll cancel out the loss up to its corner frequency, then everything will go to hell
12:56 AM rue_mohr: but if that hell mark is up by a few Hz, thats ok
12:56 AM rue_mohr: SO
12:56 AM rue_mohr: what is the limit of my op-amps
12:58 AM rue_mohr: open loop gain is uspposed to be 75000
12:59 AM rue_mohr: I think thats a lot of db
12:59 AM rue_mohr: 97.5
12:59 AM rue_mohr: db
12:59 AM rue_mohr: ok
01:00 AM rue_mohr: so it can do 30db
01:00 AM rue_mohr: thats not what we need to know tho
01:00 AM rue_mohr: we need to know what the min signal is can grab and amplify is
01:00 AM rue_mohr: I have a take on this...
01:00 AM rue_mohr: go ahead
01:00 AM rue_mohr: well, were going to do this digital
01:00 AM rue_mohr: yes
01:01 AM rue_mohr: so, our limit is the resoltion of the ADC
01:01 AM rue_mohr: ok
01:01 AM rue_mohr: which is about 5mV
01:01 AM rue_mohr: ok
01:01 AM rue_mohr: so, the minimum signal we can apply gain to is 5mV
01:01 AM rue_mohr: your thinking ideal case then
01:02 AM rue_mohr: yes, we see if we can put the pole there
01:02 AM rue_mohr: ok, so, lets say we have a full signal
01:02 AM rue_mohr: k
01:02 AM rue_mohr: at what freq would the remaining signal be 5mV
01:02 AM rue_mohr: ok, so 5mv/5V log 20 bla bla
01:03 AM rue_mohr: I get -60db
01:03 AM rue_mohr: ok, so, we fall off at 30db/decade
01:03 AM rue_mohr: from about 1.4Hz
01:03 AM rue_mohr: so, we put the pole at ...
01:04 AM rue_mohr: 144Hz?
01:04 AM rue_mohr: 144?
01:04 AM rue_mohr: seems kinda high doesn't it?
01:04 AM rue_mohr: ok, so at 144Hz, we would need 60db gain
01:05 AM rue_mohr: andthe op-amp can do 90-something
01:05 AM rue_mohr: were going to use a gain of about ...less tho
01:05 AM rue_mohr: no your gain changes
01:06 AM rue_mohr: what gain makes 20db/decade = 30db/decade
01:06 AM rue_mohr: 10db?
01:06 AM rue_mohr: an offset?
01:07 AM rue_mohr: its db dude
01:07 AM rue_mohr: hmm gains ... add
01:09 AM rue_mohr: why do I get that a gain of 3 is 10db
01:09 AM rue_mohr: 2 is 3db
01:10 AM rue_mohr: 4 should be 6db
01:10 AM rue_mohr: 2 is 6db
01:10 AM rue_mohr: omg what now!!!!
01:11 AM rue_mohr: dude -3db is 0.707
01:11 AM rue_mohr: damnit this is starting to hurt
01:11 AM rue_mohr: maybe everything we knew is wrong?
01:11 AM rue_mohr: its stating to look like that isn't it?
01:14 AM rue_mohr: ok, ok, calm
01:14 AM rue_mohr: so, 10db
01:16 AM rue_mohr: ok, so we want a high pass set at 144Hz, with a response asemtope at +30db, which is 10db over where a first order filter would be at that freq anyhow
01:16 AM rue_mohr: I think so?
01:16 AM rue_mohr: it should start adding significant gain at 1.4Hz
01:17 AM rue_mohr: and the gains should cancel out, holding the loop gain at about 1, to the limit of the slew rate on the servo
01:18 AM rue_mohr: so question
01:18 AM rue_mohr: yes?
01:18 AM rue_mohr: the max gain of the high pass is 0db
01:18 AM rue_mohr: oh, that only peaks us out at 10db doesn't it?
01:18 AM rue_mohr: another issue, our slope is still -20db/decade
01:19 AM rue_mohr: how do we do a filter with a different slope
01:20 AM rue_mohr: and just to be clear, your saying the gain only slides the profile up
01:20 AM rue_mohr: I think so?
01:20 AM rue_mohr: hmm
01:20 AM rue_mohr: well the amplitudes would only be higher at each sample across the plot
01:21 AM rue_mohr: that does count as a verticle displacement
01:21 AM rue_mohr: can a filter have a slope other than 6db/decade?
01:25 AM rue_mohr: yes, via damping ratio
01:25 AM rue_mohr: or no
01:25 AM rue_mohr: yes or no?
01:25 AM rue_mohr: oh, no
01:25 AM rue_mohr: drat
01:25 AM rue_mohr: what if we mix back
01:26 AM rue_mohr: over filter it and give it pass-thru?
01:26 AM rue_mohr: that wont work, passthru is not band specific
01:27 AM rue_mohr: https://www.electronicshub.org/wp-content/uploads/2015/01/Active-High-Pass-Filter-Featured-Image.jpg
01:27 AM rue_mohr: here is a filter for you
01:28 AM rue_mohr: well, you can bend the response with another zero or pole?
01:28 AM rue_mohr: I suppose thats how curves are shaped
01:29 AM rue_mohr: https://www.planetanalog.com/wp-content/uploads/media-1305333-Image5.png
01:29 AM rue_mohr: teach me that
01:29 AM rue_mohr: I wanted to do more than just one thing this weekend eh?
01:29 AM rue_mohr: mmmmf
01:35 AM rue_mohr: so...
01:35 AM rue_mohr: dunno
01:35 AM rue_mohr: maybe we try it at 20db and 144Hz, with 30db of gain
01:35 AM rue_mohr: 60db
01:35 AM rue_mohr: yea that
01:35 AM rue_mohr: ok, I just need 60db in real numbers
01:36 AM rue_mohr: 1000?
01:36 AM rue_mohr: so, you want a 144Hz high pass into an amp with a gain of 1000
01:36 AM rue_mohr: yea.?
01:36 AM rue_mohr: 1000
01:37 AM rue_mohr: yes...
01:37 AM rue_mohr: 1k and 1M I suppose
01:37 AM rue_mohr: sure?
01:37 AM rue_mohr: something seems wrong with that plan
01:37 AM rue_mohr: no its a high pass remember?
01:38 AM rue_mohr: 1000
01:38 AM rue_mohr: yea, at 144Hz, it'd convert the 5mv to...
01:38 AM rue_mohr: yea, want to try again?
01:38 AM rue_mohr: no, 5mv -> 5V
01:38 AM rue_mohr: full signal
01:38 AM rue_mohr: then it would start to rolloff
01:39 AM rue_mohr: lets take a middle case
01:39 AM rue_mohr: ok
01:39 AM rue_mohr: 14Hz
01:39 AM rue_mohr: ok
01:39 AM rue_mohr: at 14Hz, the signal is down 30db
01:39 AM rue_mohr: ok, what is that
01:40 AM rue_mohr: 16mv
01:40 AM rue_mohr: ok, whats the gain of the filter at that
01:41 AM rue_mohr: well, its down 30db, from 60db, so its 30db
01:41 AM rue_mohr: they cancel out
01:41 AM rue_mohr: so they do
01:41 AM rue_mohr: it seems wrong
01:41 AM rue_mohr: it does, but the numbers...
01:41 AM rue_mohr: indeed the numbers
01:41 AM rue_mohr: but we dont have 30db, we have 20
01:41 AM rue_mohr: yea, it'll droop off a bit
01:42 AM rue_mohr: how much
01:42 AM rue_mohr: it'll be at 60-20 = 40db
01:42 AM rue_mohr: its too strong
01:42 AM rue_mohr: hmm
01:42 AM rue_mohr: so we use a gain of 40db?
01:42 AM rue_mohr: which would give us 20db, mixed with the system we would net lose 10db
01:43 AM rue_mohr: 300%
01:43 AM rue_mohr: er 1.3
01:43 AM rue_mohr: 1/3
01:43 AM rue_mohr: it would be down to 1.67V, from 2
01:43 AM rue_mohr: at 14Hz
01:43 AM rue_mohr: yea
01:44 AM rue_mohr: thats a lot better than the buppkiss we get now
01:44 AM rue_mohr: ok
01:44 AM rue_mohr: question
01:44 AM rue_mohr: yea
01:44 AM veverak: shit
01:44 AM veverak: so
01:44 AM veverak: motion planning (For new) expects specific state of robot
01:44 AM veverak: unfolding the robot into that state seems trickier than expected
01:45 AM rue_mohr: we normally would have 160mV
01:46 AM rue_mohr: the filter+amp would add 1.6V?
01:46 AM rue_mohr: for a total of 1.76V
01:46 AM rue_mohr: veverak, heh
01:47 AM rue_mohr: well, this math keeps saying I'm close
02:00 AM rue_mohr: ok rue, according to todays random online design tool, R=11k and C = 0.1uF
02:01 AM rue_mohr: and a gain of 100
03:07 AM Jak_o_Shadows: I also use random online design tools
03:08 AM Jak_o_Shadows: Also, what part is your filter thingy doing? WHere is it going?
03:09 AM Jak_o_Shadows: Like, it's a servo - is it replacing the servo driver, or ?
03:20 AM rue_shop1: I think the phase lag of the high pass pushed my pole back farther than I can see it
03:20 AM rue_shop1: I'm building a servo
03:20 AM rue_shop1: playing with using the EQ idea to tune it
03:20 AM rue_shop1: I'd like to make a FIR filter
03:21 AM rue_shop1: no I made a gearbox and put a pot on the output shaft
03:21 AM rue_shop1: http://ruemohr.org/%7Eircjunk/tempimage/p1180389.jpg
03:22 AM rue_shop1: http://ruemohr.org/%7Eircjunk/tempimage/p1180392.jpg <-- there is the bode plot from last night with an atmega8 doing a proportionate loop with a gain of 6
03:22 AM rue_shop1: http://ruemohr.org/%7Eircjunk/tempimage/p1180393.jpg
03:22 AM rue_shop1: there is the phase chart
03:28 AM rue_shop1: ok I get it
03:28 AM rue_shop1: the phase of the high pass is causing the extra signal to lower the overall drive signal
03:46 AM mrdata__: is that something you can tweak with the Q of the filter?
03:57 AM rue_shop1: I dont know how to adjust Q
03:57 AM rue_shop1: but what I'm just realizing, is that
03:57 AM rue_shop1: the phase of the filters used is really important
03:58 AM rue_shop1: you can have an all-pass filter, with an out of whack phase, that completely adjusts the response you need
03:58 AM rue_shop1: my high pass filter is canceling the proportionate gain
03:58 AM rue_shop1: so I flipped it 180 degrees
03:58 AM rue_shop1: and I'm just playing with the results
03:59 AM rue_shop1: but my mind is having to rewrite a lot of how I looked at this all
03:59 AM Jak_o_Shadows: That's not a bad thing
03:59 AM rue_shop1: I'm also having a time because a proportionate feedback of 1 is too much :/
04:00 AM rue_shop1: it looks like I need fractional P
04:00 AM rue_shop1: I have not worked out the rest of the loop, but it should be low
04:00 AM rue_shop1: there is a gear ratio of about 12:1
04:01 AM rue_shop1: and I need to look at this in context of the slew rate
04:01 AM rue_shop1: you can't do better than your slew rate
04:01 AM rue_shop1: nomatter what kinda controller you put in
04:02 AM rue_shop1: I'm a bit new to waveforms this slow
04:02 AM rue_shop1: at 1Mhz, its not easy to create an edge that is way beyond what a circuit can keep up with
04:03 AM rue_shop1: p.s. mrdata__ glad your with us
04:03 AM rue_shop1: I have the right idea tho
04:03 AM rue_shop1: the high-pass is adding a "punch" to the drive signal
04:03 AM mrdata__: the Q of the filter can be reduced by increasing the resistance
04:04 AM rue_shop1: mrdata__, ok, how do I apply that to a servo then?
04:04 AM mrdata__: increasing it usually means redesign
04:04 AM rue_shop1: attenuation somewhere?
04:04 AM rue_shop1: did you see the getup image?
04:04 AM rue_shop1: http://ruemohr.org/%7Eircjunk/tempimage/p1180389.jpg
04:05 AM rue_shop1: right now, I'v changed out that atmega8 for an analog circuit
04:05 AM mrdata__: is there a schematic
04:05 AM mrdata__: pls describe the filter components
04:05 AM rue_shop1: I don't have one for my analog getup, its been quite dynamic over the last 20 mins
04:06 AM mrdata__: what type of filter is it
04:06 AM rue_shop1: I have a diff amp with a gain of 1 between the control signal (signal gen, 2V p-p, 2.5V center, about 1Hz) and the feedback signal (pot on that servo setup)
04:06 AM mrdata__: so an active filter then
04:07 AM mrdata__: i'm less proficient with adjusting those
04:07 AM rue_shop1: I have a adder amp with a gain of 1 that goes to an avr/L9110 driver arrangement
04:07 AM rue_shop1: the avr/L9110 has a gain of 2
04:07 AM rue_shop1: (2.5V in, is 0V out, 0V in is -5V out, 5V in is 5V out)
04:08 AM rue_shop1: thats the proportionate
04:08 AM rue_shop1: to bring up the rise time, I'v added a high pass filter
04:08 AM mrdata__: what is the high pass composed of?
04:09 AM rue_shop1: 72 Hz, high pass, with a buffer/amplifier capable of 1 -> 20
04:09 AM rue_shop1: I could draw it up if you want to take a more cohesive look
04:09 AM rue_shop1: I take the high pass into that summer amp
04:10 AM rue_shop1: so Kp = 1, Kd = ~20 (right now)
04:10 AM mrdata__: do you have impedance matching from module to module
04:10 AM mrdata__: 72 Hz is pretty low, though so that wouldnt matter
04:10 AM rue_shop1: I think my impedance is ok
04:11 AM rue_shop1: the idea is that the corner freq is WAAAY over what the system can do
04:11 AM rue_shop1: but the gain is such that it help cancel the natural rolloff
04:11 AM rue_shop1: but the natural rolloff is -30db/decade
04:12 AM rue_shop1: and I only know how to make a high pass for 10db/dec or 20db/dec
04:12 AM rue_shop1: waaait
04:12 AM rue_shop1: 20 or 40
04:12 AM rue_shop1: sorry, today is a day or "wtf, everything I knew all my life was wrong"
04:13 AM rue_shop1: mrdata__, have enough time and interest to wait for me to draw this up?
04:13 AM mrdata__: i should get to bed soon
04:13 AM rue_shop1: my transient is looking pretty good so far, there is a bit of overshoot
04:13 AM rue_shop1: but thats not the point, I wanted to understand adding a high pass to compensate it
04:14 AM mrdata__: so if you have spooky aberrant hf noise you maybe need to bleed that off
04:14 AM rue_shop1: and, sooner or later, I'm gonna have it stick that a high pass is D
04:14 AM rue_shop1: the slew rate of the system is...
04:15 AM mrdata__: RC low pass with cutoff f just below the spooky aberrant hf noise
04:15 AM mrdata__: is all i can recommend off the top of my head
04:15 AM rue_shop1: .66 V / sec
04:16 AM rue_shop1: er wait, I have the probes at x10 :)
04:16 AM rue_shop1: 6.6V/sec
04:16 AM rue_shop1: 5V is 300 degrees
04:17 AM rue_shop1: there are no poles above 1.4Hz
04:17 AM rue_shop1: I'v searched
04:17 AM rue_shop1: for like half an hour..
04:18 AM rue_shop1: :)
04:21 AM rue_shop1: oh my high pass was inverted, it was countering the proportionate
04:21 AM rue_shop1: ok
04:22 AM rue_shop1: thats a thing too
04:22 AM rue_shop1: I was going to go the other way tho
04:27 AM mrdata__: yeah that would muck with sense of reality
04:34 AM rue_shop1: "Whats phase got to do, got to do with it? who needs a pole when a pole can be broken!"
04:42 AM rue_shop1: the high freq filter seems to work better than its countering too much proportionate gain
04:42 AM rue_shop1: instead of kicking the output when there isn't enough P gain
04:43 AM rue_shop1: maybe what thats just saying is that the P gain is important for getting rid of the error
04:43 AM rue_shop1: and that you cant make up for it by just kicking your load when there are input changes
04:43 AM rue_shop1: and that makes sense
04:59 AM * mrdata__ twitches a bit
04:59 AM mrdata__: i hope you figure it out
04:59 AM mrdata__: i'm off to bed
04:59 AM mrdata__: cheers
05:30 AM rue_shop1: polprog, aha
05:30 AM rue_shop1: the pole is due to the slew rate
05:31 AM rue_shop1: I was seeing hints of this in my old notes
05:31 AM rue_shop1: basically, the system CANNOT get to the target in the time given
05:33 AM rue_shop1: but what doesn't add up then
05:33 AM rue_shop1: is that the input drive signal is a factor in where its supposed to get to
05:33 AM rue_shop1: would the pole have come up somewhere else if I'd been using something other than a 2V p-p input signal?
05:50 AM rue_mohr: https://www.youtube.com/watch?time_continue=65&v=Oy_tKIA0mYs&feature=emb_logo
05:50 AM Jak_o_Shadows: Probably
06:24 AM rue_mohr: so, one of the tricks in PID is to make sure the corner freq for D is WAAAAY over your systems response
06:25 AM rue_mohr: and, interesting enough, the actual corner freq doesn't really matter
06:26 AM rue_mohr: you want the slope of its response
06:27 AM rue_mohr: from there, you add gain to place its response where it best cancels the systems normal pole
06:27 AM rue_mohr: what IS important, is something I dont know how to control yet
06:27 AM rue_mohr: the roll-off of its response
06:27 AM rue_mohr: for example, in my system, the normal rolloff is 30db/decade
06:28 AM rue_mohr: but my choices for a filter are 20db/decade and 40db/decade
06:28 AM rue_mohr: so it cant be properly compensated for
06:29 AM rue_mohr: its also important to watch how much the error components saturate the output by
06:29 AM rue_mohr: you want the proportionate gain to saturate the output during its slew time
06:29 AM rue_mohr: during *most* of it
06:30 AM rue_mohr: then you use the high pass (D) to trim back that gain so it cant overshoot
06:31 AM rue_mohr: you adjust D for your overshoot (in my case critical, 0.7)
06:57 AM flav0r: DUDES !!!!!
06:57 AM flav0r: I HAVE RETURNED !!!
07:30 AM polprog: morning rue
07:31 AM rue_bed: key
07:31 AM rue_bed: hey
07:31 AM rue_bed: did you see the video of that servo?
07:32 AM polprog: hey
07:32 AM polprog: i think i did, i saw one video
07:33 AM polprog: also, i these poles and zeroes - are you measuring the whole thing with motor or only the driver part
07:34 AM polprog: why did i wake up at 9 to then wake up at 2pm again >_>
07:37 AM polprog: id say it works nice, i just saw the video
07:38 AM rue_bed: did you see the one of it hopping on the bench?
07:43 AM polprog: the square wave one?
08:01 AM rue_bed: yea
08:01 AM rue_bed: thats 1Hz
08:01 AM rue_bed: it goes up to 2Hz fine
08:02 AM rue_bed: its 5:30am, I ought get some sleep
08:02 AM rue_bed: at 10Hz the motor driver blew
08:03 AM rue_bed: literally
08:03 AM rue_bed: tho, I'd switched it to run at 12V
08:05 AM rue_bed: so yea, as long as the filter cutoff is WAY over the max system freq, it can work
08:11 AM polprog: haha
10:41 PM briand2 is now known as AI4AI