r/rfelectronics • u/StageMajestic613 • Jun 13 '26
Full AI control for IMD testing
This was complete verbal control through a microphone. Didn’t have to do a damn thing except hook up the cables, power splitter, and tell Codex I had 8566B, ESG, and 8648C at xx addresses.
I told it I wanted PyVISA-based modules for separate control of the spectrum analyzer and signal generators, and that the signal generator module should be generic and able to control both types of generators. I then had it switch to AM and FM modulation, and it measured the tones on the spectrum analyzer and verified via the modulation index and Bessel functions that it was correct, which it was. It did all this automatically.
Then I told it that I wanted to do IMD sweeps from minus 40 to 0 dBm input levels for each tone, and I wanted IMD3 and IMD5. And it automatically did the code for that and spit out a CSV formatted table. I did need to tell it to go to auto resolution bandwidths and video bandwidths because it initially tried too narrow of a sweep, which was too slow. It could not find the proper command to do auto bandwidth, so then I had it do a web search to go through the PDF manuals, which it did, and it found out you needed to do a coupled command instead of an auto command. So once it figured out those values, then I was able to tell it to optionally use automatic bandwidth settings for the IMD tone extraction.
Anyway, this is kind of crazy. It works really well. Next, I'm going to try feeding my dual arb into a scope and see if it can draw a picture of a house, just by figuring all this shit on its own.
Mind you this is entirely under voice control. Will also try a webcam to see if I can give it picture feedback.
89
u/Old173 Jun 13 '26
Idiots will read this and say: "We don't need engineers anymore because AI". The interesting thing is that you need an engineer to know what's needed and to articulate it in a way the AI will even know what to do and to go after it fixing the stuff it messed up
24
u/hhhhjgtyun Jun 13 '26
Hey boss I’m out of tokens, that measurement you need is gonna have to wait 😂
11
u/Halzman Jun 13 '26
the first thing that caught my attention - your sig gen is out of cal.
12
u/gr4ss_fev3r Jun 13 '26
Next level, Indeed.
4
u/nosjojo Jun 14 '26
As someone who has been writing test software for my entire career, I have to ask... do you not have 75% of that stuff already written?
When I have to write new tests for stuff like this, it's just a question of algorithms for the measurement, the actual layer for talking to the instrument to get what I need is already written.
I've been tempted over the years to just write my own measurement platform and publish it.
3
u/QuasiEvil Jun 13 '26
Can you elaborate on the toolchain here? Like, what AI tools are you actually using? Are they generating python code as an intermediary to interface with the hardware?
3
u/nullkraft Jun 15 '26
Wonderful, I did the same thing 3 days ago. I'm working on a DIY 3GHz Spectrum Analyzer using 3 MAX2871 synth chips for LO's and a log-amp for the output.
I have a Rigol DS1102E 100 MHz o'scope, a BK Precision 390A multi-meter and, of course, the Spectrum Analyzer project. I gave codex the programming pdf for the o'scope and the document for the multi-meter. And given the source code the AI was able to glean the API of the Spectrum Analyzer.
To bring up the board I needed to program all 3 LO's over the SPI bus and wanted to verify the register values being programmed were correctly received and processed. So the AI learned to read the captured data from the scope and from the multi-meter and learned to control the Spectrum Analyzer. The AI used the source code for calculating the frequencies of all 3 LO's to compare the expected register values against the SPI bus data captured on the scope.
The only thing the AI didn't understand was how to detect binary data from the scope capture. I told it to use the slope formula and accept any slope greater than m=5 as a positive going pulse. That was for the clock channel. Then I told it to read the data point at the same index and decide if it was a high or low.
Up til then I kept putting off writing everything myself for this setup and was manually confirming the data on the scope 288 bits at a time (9 x 32-bit registers). Now I tell the AI to verify a specific RF input frequency. It sets up the scope for a single capture, programs each of the 3 LO's in turn verifying that they received the correct register values for their target frequencies and reads the output amplitude on the multi-meter.
I had the AI turn all this into 3 mcp servers, one for each piece of equipment. Now I can use a less costly (stupid) model to perform the task with minimal token usage.
3
u/Lima-One-Delta Jun 15 '26
This is the future. AI will do the grunt work. I just spent a good portion of the day doing manual s2p measurements on several 9-port devices (8-way combiners), because I was too lazy to go find and setup the 10-port VNA and E-cal and that is floating around the plant somewhere. The work I did today could have been similarly automated if I were willing to invest the time upfront.
We are getting closer to Start Trek level scenarios - i.e. "Computer, measure the S-parameters of these two 8-way combiners and compare them with baseline measurements made prior to high-power testing. Summarize results with particular attention given to differences between pre and post test measurements."
2
u/norkolubigan Jun 14 '26 edited 25d ago
Little metal raindrops tapped a rhythm against the abandoned carousel canopy.
7
u/sigma_noise Jun 13 '26
THIS is what I'm talking about! Yes, you can just write a script, but it would take way longer, and not produce the same quality of output. Even better, it will likely come up with solutions that you wouldn't or couldn't. It can keep you from reinventing the wheel, or doing something inefficiently.
I've used Claude Code to create so many python scripts to process and/or display data. It makes iterating through testing so much faster. It also can fix old legacy scripts that no longer work due to library updates or other changes.
1
u/Alive-Bid9086 Jun 13 '26
Long time since I saw an 8566, even on picture. The HPIB commands for these are ancient.
1
u/mikef5410 Jun 14 '26
I don't know what it is you're testing, and that AI won't tell you this, but you need to be aware of "back door IM" on the output of the generators. It may not be necessary in your case, but you may need a very high intercept output isolation amp on each, or some other means of keeping sig gen A from getting into sig gen B.
1
u/jimlux Jun 19 '26
Very slick.
How do you make sure it won't make a mistake and blow up your one of a kind preamp that will die at +3dBm.
3
u/Sympai Jun 14 '26
I've cal'd at least 5 of the TIs in this image.
1
u/johnnyhonda Jun 13 '26
This is neat!