James Logan
ponderingpothos.bsky.social
James Logan
@ponderingpothos.bsky.social
Scientific computing in rust and python, firmware in rust, and the occasional circuit board design & testing. Propulsion engineer in a previous life.
Take a look under the hood of the state of the art in grid interpolation in Rust and Python!

Come for the compile-time loop unrolling, stay for the profile-guided optimization!

jlogan.dev/blog/2025/11...
November 11, 2025 at 3:04 AM
#caturday watching Flow with the cats - and they really do watch it!

Pretty neat to see a cat this interested in a movie with a plot!
March 23, 2025 at 2:55 AM
Some fairly straightforward performance improvements to interpn (https://docs.rs/interpn) yesterday yielded a 2-6x speedup for lower-dimensional methods.

This brings it to parity with even the specialized-dimensionality version of the fortan incumbent!
March 17, 2025 at 12:44 AM
Firmware done, PCB schematic and layout done - one more good scrub and it's off to fabrication with the first production candidate!
January 15, 2025 at 4:01 AM
Allllmost there - just have to stitch together the interface between the base module and the analog frontend, and give one more DRC scrub -
January 15, 2025 at 3:45 AM
Just a few more power nets, and it'll be ready for the board house!
January 15, 2025 at 1:29 AM
So, grafana does this every time it updates plots ( clogs up the network as well even for queries to a local db instance which I've resolved-ish by using a unix socket ).

Anyone know of a dashboard alternative that is aware of the concept of a time series and can cache appropriately?
January 13, 2025 at 12:47 AM
Now without the PWM getting stuck at low frequency due to buffering input value -
January 1, 2025 at 6:17 PM
Because the PWM inputs on timer peripherals work by counting the period of the incoming signal, if the incoming signal is too slow, the counter will reset before seeing the value, and then measure an essentially random number on a later cycle. A 3-point median filter on the counter clamps this to 0:
January 1, 2025 at 5:57 PM
Sure enough, the encoder is able to go negative as well! Testing with a signal generator for now, but will bodge an actual encoder on to it before shipping the next rev (the original design didn't include an encoder, so the pin isn't broken-out)
December 31, 2024 at 7:51 PM
My STM32's counter input is a 16-bit register, and is likely to increment past 65536 regularly. One is an encoder that may go negative in terms of real count. The chip doesn't have 64-bit atomics, so I ended up with two i32 outputs rather than one i64, which will be combined application-side
December 31, 2024 at 7:35 PM
I have replaced the last mutex with atomics and my lööps are officially deadlock-free
December 25, 2024 at 9:26 PM
Here's the most reliable lowish-cost (~$1) way I've found to add short-circuit protection for low-current outputs (in this case, a 4-20mA sensor).

In these plots, the mouse hover point is where I short the 4-20mA channel during calibration. The channel just drops out and recovers
December 20, 2024 at 2:19 AM
Meg likes to help with, uh, environmental robustness testing

December 17, 2024 at 1:08 AM
Thermocouple simulators are also a thing, and show that I have some work to do on my K-type frontend for hot-junction temperatures below 0C and above about 1200C - although it's within <1% at the calibrator's top range of 1370C, a few K can be quite a lot of error in a fluid or chemical system.
December 12, 2024 at 3:47 AM
4-20mA simulators are a thing (apparently), and after a year of just assuming the uncertainty stackup in the amp, resistors, and voltage reference were good enough, today I plugged one in. Sure enough, it is spot-on (<0.1% error) without calibration - but it's nice to know for sure!
December 12, 2024 at 3:34 AM
Getting some mileage out of the #kicad 3D viewer today. I've never had occasion to use it before, but it's coming in handy for making sure the components physically fit together, especially these chungus two-level screw terminals.

Might even populate the rest of the 3D models and use it for renders
December 3, 2024 at 1:20 AM
Sinc and Gaussian functions each have interesting properties as the kernel for FIR taps - sinc gives a theoretically optimally-sharp cutoff, while a Gaussian gives a well-behaved and lobe-free response.

Meanwhile, the popular sliding mean filter can be represented as a set of equal tap values
December 2, 2024 at 7:15 PM
Starting to tool with FIR filters, and comparing against my existing 2nd-order Butterworth IIR method.

There's a lot of jargon and obfuscation around FIR filters, but you just choose N numbers (taps) that add up to 1, and dot them with the incoming signal

#electronics #dsp
December 2, 2024 at 6:57 PM
ope
December 2, 2024 at 6:45 PM
Testing out two units of the latest rev analog frontend board after a few months collecting dust after moving. They're able to get a lock and stay sort of sync'd, but connection quality is definitely struggling - seeing the loss-of-contact counter incrementing even with data rate at 100Hz
November 28, 2024 at 10:58 PM
This is a big step toward feature parity with the expensive corporate options! Having this as a native feature allows for improvements over the excellent Replicate Layout plugin, like ignoring unrelated routing on other layers.

Huge help for designs with many repeated channels like this one!
November 28, 2024 at 2:37 PM