azonenberg changed the topic of #scopehal to: libscopehal, libscopeprotocols, and glscopeclient development and testing | https://github.com/azonenberg/scopehal-cmake, https://github.com/azonenberg/scopehal-apps, https://github.com/azonenberg/scopehal | Logs: https://freenode.irclog.whitequark.org/scopehal
Degi has quit [Ping timeout: 246 seconds]
Degi has joined #scopehal
_whitelogger has joined #scopehal
zigggggy has quit [Remote host closed the connection]
bvernoux has joined #scopehal
<azonenberg> well, that was fast. My PMK tip/ground order just arrived from germany and they're forwarding it from texas to me now
<azonenberg> Probe test board is at fab. Had a bit of back and forth with some CAM review issues but now fixed
bvernoux has quit [Ping timeout: 265 seconds]
<electronic_eel> I've been thinking & searching a bit about a variable freq filter for the scope AFE
<electronic_eel> unfortunately it is not as easy as I thought:
<azonenberg> Yes
<azonenberg> fwiw, even lecroy seems to have a fixed AA filter
<electronic_eel> currently the filter is directly on the input, so the voltages can swing negative
<azonenberg> if i set the sample rate below 2 Gsps it has a warning about "signals >1 GHz will be aliased" etc
<electronic_eel> very few analog switches allow negative voltages
<electronic_eel> but even if we move it after the offset stage it does not get much better:
<electronic_eel> the cheap & fast usb3 switches usually got to 3v max
<electronic_eel> you can't use rf switches because they don't allow dc and require a cap at the input and output
<electronic_eel> the rest are switches for lowish speeds and introduce substantial capacitance and insertion loss
<electronic_eel> so basically you end up with relays, and the nice ones like you selected are 7$ a piece
<azonenberg> yep, isnt broadband system design lovely? lol
<monochroma> better than dialup.
<electronic_eel> I really like browsing through datasheets though. my substitute for watching sitcoms or other tv shows
<azonenberg> Lol
<azonenberg> So i'm gonna sit down and work on this actually right now
<azonenberg> i'm officially booked on "research" @ $dayjob but the project i am supposed to be doing depends on hardware that is delayed until friday
<azonenberg> (amazon prioritizing essentials, which i can hardly fault them on)
<azonenberg> this is research... :p
<electronic_eel> oh, and I forgot that you need two of these relays to switch in the other filter :(
<azonenberg> lol
<azonenberg> Yeah i think it makes more sense to pick one bandwidth
<azonenberg> set the filter for that
<azonenberg> then just oversample without any more b/w
<azonenberg> if you have more adc channels available
<electronic_eel> hmm, for the entry model I concur, you should just stick to one bw
<azonenberg> Yeah
<azonenberg> maybe for midrange. I can justify spending a lot more on the AFE for a $350 ADC
<azonenberg> For high end, with a $3k ADC, i can justify a nicer AFE, but i will also not be interleaving one adc across many channels :p
<monochroma> i think for a higher end scope, make it modular, can swap cards/modules for different features
<electronic_eel> won't the next level up be one adc per afe? so the point there would be to switch between bw for 8bit and 12bit
<azonenberg> electronic_eel: My roadmap right now calls for five models
<azonenberg> from lowest to highest:
<azonenberg> * one HMCAD1520 per 4 channels
<azonenberg> * one HMCAD1520 per channel
<azonenberg> * one LM97600 per 4 channels
<azonenberg> * one LM97600 per channel
<azonenberg> * one AD9213BBPZ-10G per channel
<azonenberg> we can then populate as few or as many of the AFE+ADC combo cards in the scope chassis as the FPGA subsytem supports, i/o and ram wise
<electronic_eel> yeah, I was talking about the " one HMCAD1520 per channel" one
<azonenberg> Yes. That one will have 8/12 bit switchable modes
<azonenberg> but always run at the highest sample rate (640 Msps /1 Gsps)
<azonenberg> My thought there was to call it a ~250 MHz scope either way, at which point you're sampling well beyond nyquist no matter what
<azonenberg> no need for switchable filters
<electronic_eel> mmok
<electronic_eel> don't see many other scopes with 1gsps with more than that
<azonenberg> Yeah exactly
<azonenberg> i am not going to advertise a scope as having X bandwidth with -3 dB attenuation at nyquist :p
<azonenberg> BTW, my new input filter is a 6th order bessel-thomson LC filter
<azonenberg> Thoughts?
<azonenberg> The rolloff is a bit slow so you might get a bit of aliasing in 4 channel mode with wideband signals (125 MHz is Nyquist and it's only down about -5.5 dB there)
<azonenberg> but it's down -24 dB at 250 MHz
<electronic_eel> lgtm, but I don't do filter design often, so I tend to have to read up on it each time
<azonenberg> again it's a tradeoff. I don't want to sacrifice 1-channel performance to remove all chance of aliasing on 4-channel mode
<electronic_eel> yes, the tradeoff looks sensible to me
<electronic_eel> and no peaking issues
<azonenberg> also super linear phase
<azonenberg> thats the thing about bessel filters, they have slower rolloff but trade that for much smoother phase
<electronic_eel> phase problems are hard to fix in software
<azonenberg> Yeah
<awygle> i always get a warm glow when people take my advice :p
<azonenberg> awygle: i think that glow is called "cerenkov radiation"
<awygle> i usually recommend odd-order filters
<azonenberg> awygle: oh?
<awygle> it's not a huge deal
<awygle> it just makes them symmetrical
<azonenberg> What's the benefit of that?
<azonenberg> signal processing of that sort is not my strong point
<azonenberg> looking at the group delay plot, the 7th order bessel filter has significantly less nice looking group delay/phase
<azonenberg> the 5th is ok but has slower rolloff
<awygle> there's a DFM element to it having to do with component values
<awygle> and also if you care about whether it's a short or an open at DC
<azonenberg> This is a LPF, and yes it needs to work down to DC
<awygle> if you pick an even-order filter you get a short at one end and an open at the other
<awygle> for some topologies
<awygle> shouldn't be an issue here
<awygle> just a rule-of-thumb marker fired in my brain
<azonenberg> yeah this filter design has 11 nH series and 13 pF shunt
<azonenberg> then 51 nH / 27 pF
<azonenberg> and 91 nH / 75 pF
<Degi> I didn't really read the whole convo and not sure if that was said, but if you use a relais with two poles, you could use 1 relay to switch a filter in and out (unless you do differential)
<Degi> Also is it possible to use DSP to apply the inverse of the filter function to the signal?
<azonenberg> Degi: you don't want to invert the antialiasing filter, but inverting the transfer function of the gain/offset stages is very much possible and something i'm looking into adding in glscopeclient down the road
<azonenberg> i will be doing probe de-embedding at some point too
<Degi> Hm you could fix the phase response of the antialiasing filter
<azonenberg> The phase response of the AA filter is super linear so i dont think it will be necessary?
<Degi> Okay
<Degi> And amplitude ripple is good too?
<azonenberg> group delay is 3.895 to 3.781 ns across the DC - 100 MHz band
<Degi> Hm like if the phase near max frequency is different from phase at lower frequencies, that would still lead to square waves being distorted
<Degi> Oh neat
<Degi> That should be very fine
<azonenberg> (11:58:23) azonenberg: https://www.antikernel.net/temp/filter-sparam.png
<azonenberg> (11:58:50) azonenberg: https://www.antikernel.net/temp/filter-phase.png
<azonenberg> that's the advantage of a bessel-thomson filter. Slower rolloff than other filters but very smooth
<azonenberg> no ripple in amplitude, just a slow gentle rolloff to -3 dB at 100 MHz
<Degi> Huh good group delay
<azonenberg> I'll have an updated schematic for you all to look at shortly. Designing the final gain stage now
<azonenberg> at that point all i'll have left to do is the PSU and MCU
<azonenberg> If you've got some time, start thinking about how we're going to power this. I don't need a full schematic design done, just ideas on what chips to use
<Degi> For the buck and negative rails etc?
<azonenberg> I need to go from +12V input to +/- 5V and +/- 6V
<Degi> I'm not very good at this but I know who to ask...
<azonenberg> as smooth as possible
<azonenberg> so i'm thinking probably smps to +/- 6.5-7V or so then LDO to the final voltages
<Degi> What do we have as input? 12V?
<azonenberg> Yeah
<azonenberg> let me get you some load estimate
<azonenberg> +/- 6V is only the offset stage, call it 30 mA on each leg
<azonenberg> -5V is used by the final output amplifier, call that 30 mA as well
<azonenberg> +5V is used by the output amplifier (30 mA) and the gain stage, which is much more hungry - budget 200 mA for that
<Degi> Hm I've MSGed that person, but I'll search thru mousre some
<Degi> And we need something for the HMCAD too, 1.9 V or so
<azonenberg> no
<azonenberg> this is an AFE charaterization board only, there's no ADC on it
<Degi> Ah right
<azonenberg> i intend to reuse as much of the design as possible on the board with the ADC of course
<azonenberg> oh, then the LM393 needs a mA or so
<Degi> She says to use inverting buck boost for negative rail
<azonenberg> Yes, that much is certain
<azonenberg> the point is more exactly which chip :p
<Degi> Yes
<azonenberg> And we need 3.3V for the MCU as well. Budget 30 mA for that
<Degi> Hm does that need to be good
<electronic_eel> azonenberg: if you want a really low noise post-switcher ldo combo for +- rails: ti tps7a49 and tps7a30
<azonenberg> electronic_eel: will look into it
<azonenberg> oh, my other not-hard but nice requirement
<azonenberg> i prefer qfn/dfn/bga packages to soic/tssop/tqfp
<Degi> Ok, why is that?
<azonenberg> I've had better assembly yield, they're also smaller so you can fit more channels in the same board space
<Degi> Yup LDOs available in DFN
<Degi> What should I do, components? Schematic? Board layout?
<azonenberg> many of my boards are 100% leadless, i only use packages with pins if i can't find the part i need in a DFN/QFN package
<azonenberg> Just find some parts that look decent for the moment
<azonenberg> multiple people on one kicad design tends to be difficult
<Degi> Oh no, TI seems to have problems
<azonenberg> ?
<Degi> Nvm my browser has problems
<Degi> How precise should the rails be?
<azonenberg> +/- 6.6V is absolute max for the LMH6552, +5.4 for the 5205. I would target +/- 100 mV of nominal voltage, ideally a bit tighter than that
<azonenberg> but what matters more for low noise is ripple
<azonenberg> if my 6.0V rail is steady 5.95 or 6.05 that's not a problem, if it's fluctuating between them it is
<Degi> Okay
<azonenberg> I'll do the detailed psu design later, just looking for suggestions on parts to use at the moment. Being in stock at digikey is a strong plus
<electronic_eel> for positive supplies there are some lower noise ldos available than the tps7a49, for example the LT3042
<electronic_eel> but for negative supplies the field gets small
<azonenberg> Yeah i figured
<electronic_eel> and it won't help much if you have a super positive ldo, but the negative one sucks
<Degi> I'd suggest this one for negative rail generation https://www.analog.com/media/en/technical-documentation/data-sheets/3483fc.pdf
<Degi> For the switching
<azonenberg> electronic_eel: also can you take a look at the power supply page and see what you think of the voltage references?
<Degi> You can hook it up to 12 V and it should be able to output 100 mA
<azonenberg> in particular, i am using a +4.096V reference with Vdd=gnd and gnd=-5V
<azonenberg> in order to generate a -0.904V reference
<azonenberg> I *think* this is ok, but i want you to double check
<Degi> The reference has more noise than the LDOs linked earlier, but I guess that can be filtered?
<azonenberg> The reference doesnt need to be super perfect as i'm only using it for the overvoltage shutdown
<azonenberg> so if the trip point is a few mV high or low it's NBD
<Degi> Oh OK
<azonenberg> the references for common mode supplies matter more
<azonenberg> +2.5 and +0.9
<azonenberg> i haven't done those yet
<azonenberg> the +/- 0.5 references are fairly wide tolerance
<electronic_eel> you use these 2 mcp1501 just for the relay trip points? IMO that is a bit of a wast
<electronic_eel> waste
<electronic_eel> for a low-end afe
<azonenberg> I guess i could just use a resistive divider for that?
<azonenberg> would probably be ok
<electronic_eel> yes, resistive divider, buffered with a bigger cap
<azonenberg> Ok yeah i'll do that
<electronic_eel> not too lowish resistors because of the bias currents of the lm393
<azonenberg> what would you suggest? do the math, calculate some standard values
<azonenberg> i'm busy on the common mode shift stage right now
<Degi> And 73 dB PSRR
<electronic_eel> you want to trigger on a bit more than 5v, correct? how about 13k and 1.5k -> 0.517v
<Degi> Yup LT3093 seems to be one of the best for negative
<electronic_eel> now when looking at the overvoltage shutdown I'm missing a latch function:
<electronic_eel> when the voltage just goes above 5.1x v the relay will switch off, if the voltage drops, the relay will switch on again
<azonenberg> electronic_eel: yes, my thought was to have the MCU be monitoring that signal
<electronic_eel> this can lead to lot's of relay chatter and ruin the relais
<azonenberg> if it goes low, start driving low
<azonenberg> i.e. software latch
<electronic_eel> I'd prefer a hard logic latch
<azonenberg> then after say 5 sec release its driver and see if the input shuts down again or not
<electronic_eel> that switches off the relay without software intervention
<electronic_eel> and a reset function from the mcu to reset the latch
<azonenberg> well i'd probably do this in FPGA in the final system
<Degi> Hm yes maybe a hardware RS latch resettable and settable by software and the logic
<azonenberg> This is a characterization board
<electronic_eel> you can use a 74lvc1g14 for the latch
<electronic_eel> very small and cheap
<azonenberg> kk
<electronic_eel> here is a very fancy version of that from a project I'm working on right now: https://imgur.com/a/1DyGyHe
<electronic_eel> it has a configurable rc delay stage in front
<electronic_eel> with the comparator and voltage divider, you are better off to do a delay with caps after the voltage divider before the comparator
<electronic_eel> so you can skip the part left of the 10k series resistor in my schematics
<electronic_eel> oh, I just see that I'm better off using one 74lvc2g14 instead of two 74lvc1g14
<electronic_eel> when you are sure your mcu doesn't do any stupid stuff during reset or bootloader or whatever, you can skip the transistor, directly connect the mcu to the '2g14 and configure the pin as open-drain
<awygle> the physical power switch inside my bluetooth headphones is cracked
<azonenberg> electronic_eel, awygle, degi: ok i think i finished the signal path
<azonenberg> see updated schematic
<awygle> is it ok to hard-short those comparator outputs like that?
<electronic_eel> awygle: the lm393 has an open collector output
<electronic_eel> but I think that part is not done yet
<electronic_eel> azonenberg: how about the output of the last lmh6552 into the smas - don't you need series resistors there?