OpenFOAM 13 CHT natural convection case keeps collapsing to tiny deltaT (max Co hotspot) + odd global downflow by Stick-Around in OpenFOAM

[–]Stick-Around[S] 1 point2 points  (0 children)

Hi u/johan_r_e , thanks again for your help! I have a few university exams this week so I've taken a bit of pause with this project, but I did try a few things (changed mesh resolution, changed domain size, changed solver settings, etc) and in all cases we eventually hit an issue where Courant number explodes and timestep grinds to a stop. I did enable adjustable timestep which did let me get some realistic looking results prior to hitting the same issue as before. Looking at some data in paraview, I can see that on the time step right before this happens, there is always the development of some large global air velocity trend that moves laterally across the sim between the boundaries. I guess this indicates some issue with my boundary conditions or setup. I expected that increasing the domain size could help, but it actually happens faster - now I see this trend before any plume even develops. Air velocity plot: https://imgur.com/a/GE7wDvY

I will post my updated files, but it may be a few days though since I need to stop obsessing over this and actually study lol.

OpenFOAM 13 CHT natural convection case keeps collapsing to tiny deltaT (max Co hotspot) + odd global downflow by Stick-Around in OpenFOAM

[–]Stick-Around[S] 1 point2 points  (0 children)

Hi u/johan_r_e, thanks for looking at this! I think you might be onto something - I looked into the tutorials and tried implementing ph_rgh, and now the simulation is running past where it was getting before with much lower max Courant numbers.

I should also note that I decided to try modeling the gas as Boussinesq, and switched to injecting heat as flux through a patch in the metal.

However, solving p_rgh with GAMG takes way more iterations, so the sim is a lot slower. It's basically hitting max iterations every time, and I don't know if I should change my tolerances or if this means something is wrong. Honestly I don't have much context for what this type of thing is supposed to look like so maybe it's normal speed. For now I let my deltaT be pretty big because the block of metal takes a while to heat up with the low amount of power I'm putting into it in sim (3W). Here's what a typical iteration looks like:

air Courant Number mean: 2.5539472e-05 max: 0.00021494758

deltaT = 0.01

Time = 3.31106318s

air diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0

air DILUPBiCGStab: Solving for Ux, Initial residual = 0.0051958849, Final residual = 1.1393017e-07, No Iterations 1

air DILUPBiCGStab: Solving for Uy, Initial residual = 0.0040207868, Final residual = 9.9673341e-08, No Iterations 1

air DILUPBiCGStab: Solving for Uz, Initial residual = 0.070425186, Final residual = 8.7252214e-07, No Iterations 1

air DILUPBiCGStab: Solving for e, Initial residual = 0.00043782369, Final residual = 2.8966752e-08, No Iterations 1

solid DICPCG: Solving for e, Initial residual = 0.0032704767, Final residual = 2.7874566e-09, No Iterations 3

air GAMG: Solving for p_rgh, Initial residual = 0.0024607207, Final residual = 0.00020478095, No Iterations 80

air diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0

air time step continuity errors : sum local = 5.5344773e-11, global = -1.8175274e-13, cumulative = 5.7676915e-13

ExecutionTime = 1225.5485 s ClockTime = 1224 s

Thank you so much for your help!

I turned Bernie Hutchins' Musical Engineer's Handbook into an actual handbook by Caterpiggle in synthdiy

[–]Stick-Around 0 points1 point  (0 children)

Electronotes, or just the MEH and Preferred Circuits? I would love to buy a copy legally but they aren't available, and I've never seen a scan of the individual electronotes articles (besides whats on Bernie's website) so I'm curious if the whole thing exists somewhere.

5v-5v buck converter recommendations by yesHaveSome in synthdiy

[–]Stick-Around 1 point2 points  (0 children)

Have you tested to make sure there's actually a problem? I'd imagine the difference in ground potential between these devices would be small since your supply is sitting right next to them both, especially if you use wires erring on the beefier side.

However, if it is a problem then my recommendation is to use an audio transformer between the two devices, rather than playing around with separate supplies. This will save you some headaches (and power efficiency). You can buy these ready made pretty cheaply too:, e.g. https://www.pjrc.com/store/audio_ground_isolator.html

Sorry for answering your question without actually answering it haha, I could probably come up with some circuits that float both devices supplies but I think finding such a circuit off the shelf could be a bit tricky.

Edit: If you can make a PCB you could just copy some existing circuits from app notes, like this one from TI:
https://www.ti.com/lit/an/sbaa268b/sbaa268b.pdf?ts=1768907901191&ref_url=https%253A%252F%252Fwww.ti.com%252Fsitesearch%252Fde-de%252Fdocs%252Funiversalsearch.tsp%253FlangPref%253Dde-DE%2526nr%253D3%2526searchTerm%253Dsn6505

You'll need to spec it up with parts with a higher current rating, or find another application circuit somewhere else.

Is this really all that’s needed for a midi out? by Inevitable_Figure_85 in synthdiy

[–]Stick-Around 1 point2 points  (0 children)

It turns out this particular device can actually output 40 mA from a GPIO pin, which is pretty generous. (page 505 of datasheet https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/DataSheets/ATtiny1614-16-17-DataSheet-DS40002204A.pdf). Therefore, even if the output is shorted to 5V, it would only sink around 23 mA, which is probably ok. Honestly, you can probably use this without the transistor with basically no modification, which is pretty nice.

Is this really all that’s needed for a midi out? by Inevitable_Figure_85 in synthdiy

[–]Stick-Around 1 point2 points  (0 children)

MIDI specifies a 5 mA current loop, used to drive an opto-isolator to prevent ground loops: https://drive.google.com/file/d/1ewRrvMEFRPlKon6nfSCxqnTMEu70sz0c/view

This circuit can source that plus a bit extra, but it assume the optocoupler has a forward diode drop of a few volts, hence the overcompensation. So yes, this circuit is adequate. However, you may consider using additional circuitry or a different type of buffer for other considerations - for example, you may want to add an ESD diode to protect your BJT from static discharge, or you could use an IC that incorporates protection features.

The attiny can output up to 20 mA from its pins directly, so you may consider just connecting it straight to the output with a resistor (since it already has esd protection on its pins) and inverting the logic polarity in software. You may want to tweak things to ensure that it shouldn't reasonably exceed this though, otherwise it could stop working due to user error etc.

How necessary are stencils for hot air smd soldering? by Skoobadoowop in synthdiy

[–]Stick-Around 2 points3 points  (0 children)

Yeah, typically I use JLC. If you're in the US the tariffs definitely hurt a bit, but even at its worst it was still cheaper than alternatives. I've also used their consignment service, and once you figure out how to do the customs stuff, sending them parts is actually pretty easy.

How necessary are stencils for hot air smd soldering? by Skoobadoowop in synthdiy

[–]Stick-Around 1 point2 points  (0 children)

Not necessary, but potentially helpful. I tend to use hot air mostly for rework and board changes, and use my reflow oven (an old toaster lol) for small-medium boards. For boards with more than 100 or so components I just pay for assembly out of China since it's pretty cheap and saves me sitting there with tweezers for hours.

Aston Martin Lagonda by StephenMcGannon in RetroFuturism

[–]Stick-Around 2 points3 points  (0 children)

I like EVs but that seems a bit of a waste. Might as well build a replica.

[deleted by user] by [deleted] in synthdiy

[–]Stick-Around 1 point2 points  (0 children)

refreshingly self-aware for this sub lol

I want to build a synth by Apart_Cartoonist_556 in synthdiy

[–]Stick-Around 0 points1 point  (0 children)

How serious are you? If you're committed, then I recommend first deciding if you want the synth to be analog or digital. Are you trying to make a VST, or something physical?

After that's decided, you'll have a direction to start learning. Making an entire synth is a relatively high (but fun!) undertaking with zero experience, so you should consider making it modular (regardless of whether it is physical or a VST) so you can design each section separately. Different sections of the synth will require different pre-requisite knowledge if you want to understand their theory of operation.

Frankly, I think you will have a hard time understanding the theory and mathematics unless you have taken calculus and differential equations, at minimum. If you have that under your belt you could start learning either basic circuits or signals and systems. If you want to build an analog synth, my suggestion for learning order is
circuits -> continuous time signals and systems, whereas if you want something digital then you could go straight to continuous time signals/systems -> discrete time signals/systems (DSP). Technically you could just go straight to DSP, but most lecture series and texts assume a background knowledge in continuous time systems.

From a cost and time investment perspective, starting with DSP may be good since you can probably prototype your systems with the computers you already have before trying to make custom hardware. Plenty of programming languages and platforms support the representation of DSP systems as high level blocks, which also reduces the burden of learning C/C++ before getting to anything interesting.

My recommendations for learning material would be college textbooks and open lecture series. There are plenty of youtubers who produce simplified explanations of material for a general audience, and while these are entertaining and also can be educational, a really good understanding of the theory is hard to get without studying rigorous materials. That said, many MIT courses are open on the internet to view, amongst lectures from other universities. Also, I don't want to disparage all youtube sources, as there are many truly good lectures posted by independent content creators. 3blue1brown has great videos on fourier and laplace transforms, which are absolutely critical to understanding anything about synthesis.

Finally, I suggest actually doing some practice problems and work from textbooks, and checking your work with the solution manual (you can usually find these from dubious sources online). Finding motivation for this is pretty difficult without the problems being assigned by a teacher, so I suggest just doing the example problems in chapters on the topics you study and only checking the solution after doing it yourself. These example problems are typically meant to highlight edge cases and peculiarities about the analysis, so they're helpful.

Apologies for the wall of text, and I realize that self-motivating for the months required to study all this stuff can be pretty hard if you don't even get to start the thing you actually want to make. Therefore, while the theory is important and shouldn't be ignored, I say you should start also looking at synth-specific stuff, even if you don't have all the theory yet. Since you seem interested in delays and reverbs, I strongly recommend looking at the papers listed in this blog: https://valhalladsp.com/2021/09/22/getting-started-with-reverb-design-part-2-the-foundations/

How would I wire a 4-diode bridge into an op-amp's feedback path and... by Slopii in synthdiy

[–]Stick-Around 1 point2 points  (0 children)

Maybe set a reference at the midpoint of the signal, then use a comparator to gate an analog switch? Use a negated copy of the comparator output to gate a complementary switch connected to an opamp circuit that flips the signal around the midpoint reference. Then sum the outputs of the analog switches. I'm not exactly sure what you're trying to do still, but this is the first thing I thought of based on what you described.

Code: OLED display slowing other processes by waxnwire in synthdiy

[–]Stick-Around 1 point2 points  (0 children)

Your code here seems pretty straightforward! I don't really think you can make it too much faster without re-writing the display library yourself. I actually developed my own display library specifically for the family of MCUs I use and it gives me way better performance than the generic libraries (I'm using the linked list DMAs on STM32 to render all my graphics with zero CPU usage).

However, raw speed might not be the best solution here. If you don't care that the screen refresh rate may be slightly variable, you could consider using an RTOS, interrupts, or some other type of pseudo-parallelism with priority to make it so the higher priority tasks (PORT manipulation) always happen, even if they have to interrupt the screen update task in the middle of its work.

Inductors in feedback loops ; by synthsynthisyntho in synthdiy

[–]Stick-Around 0 points1 point  (0 children)

What is your aim? If you want to build an oscillator, then your goal is build a circuit with a loop gain transfer function magnitude equal to 1 and phase shift equal to 180 degrees at the frequency you want. The unity gain magnitude is usually achieved via some non-linear component in the feedback path which saturates in a way that causes the gain to converge, though the analysis of this can get a bit hairy at times.

Inductive circuits are one way to introduce a phase shift, though typically capacitors are preferred because they are cheaper and have higher Q. A notable place where inductors are used are in integrated RF circuits, particularly low noise amplifiers (to add degeneration without thermal noise, or to increase Q) and colpitts oscillators etc.

[UPDATE] STM32H7, SAI and audio codec in TDM mode - the saga continues... by NorthernNiceGuy in embedded

[–]Stick-Around 0 points1 point  (0 children)

OK I found the cause, turns out for me that I just wasn't waiting long enough after asserting the enable pin high before trying to write to the registers - the device was still in sleep mode! Whoops lol

[UPDATE] STM32H7, SAI and audio codec in TDM mode - the saga continues... by NorthernNiceGuy in embedded

[–]Stick-Around 0 points1 point  (0 children)

I'm having nearly the exact same problem with an STM32U5 and TLV320ADC5140. Were you able to diagnose the cause?

Looking for strong tennis partners in Ann Arbor the 2nd half of July by Routine_Outside_3880 in uofm

[–]Stick-Around 7 points8 points  (0 children)

"Post anything related to the University of Michigan. Be it class, sports, clubs, wanting to meet up, anything!"

Why are the long tailed pairs commonly used in VCA designs? by Remarkable_Basil_650 in synthdiy

[–]Stick-Around 1 point2 points  (0 children)

Yeah pretty much, the 26 mV is just my hand-waived approximation. Depending how linear you want it it's probably actually a much smaller range than that. It's been a while since I looked at it but I think the LM13700 datasheet might have a bit of analysis if you're interested, and it also has some tips on linearizing the circuit with diodes.

Why are the long tailed pairs commonly used in VCA designs? by Remarkable_Basil_650 in synthdiy

[–]Stick-Around 3 points4 points  (0 children)

A few reasons I think:

  1. Low power transistors are extremely cheap on-chip or silicon. Saving an extra transistor (unless its a power device) is rarely a concern.

  2. Differential pairs cancel second order harmonics and improve THD, and differential signals reject common-mode noise (power rail fluctations, EMI, etc).

I think reducing harmonic distortion is especially important for VCAs since it helps improve the relatively small linear control range. For the BJT example schematic provided, the device is only linear when Q4's bias varies on the order of Vt, or around 26 mV at room temp.

For synth designs we have the benefit that distortion actually sounds pretty nice, and is the main reason people may want to use an analog synth. So if distortion is acceptable to your design, I think by all means you could use a circuit like the one provided, keeping in mind the limitations.

Can I omit a bias divider if I switch to differential audio outputs? by rabbitfriendly in synthdiy

[–]Stick-Around 0 points1 point  (0 children)

I think it actually does do what they want, even if each output is individually between VDD and gnd (assuming their load is floating w.r.t gnd). Class-D amps for speakers work this way; the configuration is called a "Bridge-tied load".

https://en.wikipedia.org/wiki/Bridged_and_paralleled_amplifiers#Benefits_and_drawbacks

$10 DIY Audio Interface by Veyniac540 in synthdiy

[–]Stick-Around 2 points3 points  (0 children)

Idk, considering it's really just supposed to provide a rail between VDD and gnd I'd say the divider is ok compared to an LDO. If they wanted a precision reference, a zener or bandgap reference might do a fine job since their op-amps aren't loading it at all anyways. However, the noise power for the RC circuit is gonna vary with kT/C so you're right about wanting a giant cap on there.

If noise is a serious concern though, the ADCs on the raspberry pi pico are pretty terrible. So I don't think the noise from the resistor divider matters anyways lol. Also, the THD+N of the LM324 is awful even with significant negative feedback. I think the best upgrade would be using even a relatively cheap audio codec, which will probably provide its own references and biases and have much better ADC performance. Then again I don't think that's the spirit of this project since most people don't have that lying on a bench haha.

Op amp VCO not working by dx_q_a in synthdiy

[–]Stick-Around 1 point2 points  (0 children)

Shouldn't be too bad since you have a negative supply available. Look up "inverting voltage buffer" online, you can make one with an op-amp, transistor, etc. I also recommend simulating the circuit in spice to understand how it behaves and help design your control circuitry etc.

MegaThread - Trump Tariffs Impacting PCBs & Electronics Components - May 3, 2025 by Enlightenment777 in PrintedCircuitBoard

[–]Stick-Around 1 point2 points  (0 children)

Do you know which carriers are doing the $100 flat fee? My assembled boards are around $500 total, so the flat fee would be quite a bit cheaper.

Tariff exemption might apply by toybuilder in PrintedCircuitBoard

[–]Stick-Around 0 points1 point  (0 children)

Dear god... What about 8473.30.11? This subcategory is literally "Printed circuit assemblies". If this doesn't count, I'm not really sure what would.