Author Topic: LCR Meter Plot Software  (Read 13093 times)

0 Members and 2 Guests are viewing this topic.

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #25 on: November 15, 2023, 01:20:53 am »
super inspired by mikes idea about a curve tracer for the LRC instrument TH2830,
we had a great day making a little java version
it run in a random browser and any platform
no sw install needed, no skils needed, it is so far just two txt files in a folder, one is a HTML file
and it also works perfectly fine on a PC
anyone like to hear more about this ?

Yes, definitely :-+

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline oz2cpu

  • Frequent Contributor
  • **
  • Posts: 983
  • Country: dk
    • webx.dk private hobby and diy stuff
Re: LCR Meter Plot Software
« Reply #26 on: November 16, 2023, 08:29:30 am »
here you go mike.. and anyone else with a TH2830 :-)

webx dot dk / th2830 dot zip

unpack the two txt files into folder of you own free choise
open the htm file
com port is connected to your th2830, i use 9600 baud, so that is what it defaults too,
also setup : avarage 1, speed medium.
this is first demo version,
so far you just setup the type of measurement on your th2830 hit lock to get back to local mode
the software take both measurements selected on the th2830 and perform auto scale trace
you can zoom and move and all that, add peaks and save csv file too,

ideas for next version : let the sw handle all the measurement modes,
and scale to pF nF uF and such correctly, that could be cool
so far the sw readout the values as they are delivered from th2830
that means capacitance is in Farads :-) and that is a little bit ignoring,
but there is a comment line,  where you can edit a multiplier, enable that to make it read out in uF
as explained in the txt file
Radioamateur call sign OZ2CPU, Thomas Scherrer, Senior EE at Prevas, EMC RF SMPS SI PCB LAYOUT and all that stuff.
youtube : oz2cpu teardown
 
The following users thanked this post: rogerdaily

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #27 on: August 08, 2024, 07:53:15 pm »
Thomas,

Can you make this active again?

Not sure if we've looked at your version, memory is going fast!!

Thanks :-+

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5768
  • Country: us
  • TEAS is real.
Re: LCR Meter Plot Software
« Reply #28 on: August 23, 2024, 01:17:03 am »
Does this only work on USB/serial, or did you also get it to work over ethernet?

Thanks,
Josh
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #29 on: August 23, 2024, 01:50:05 am »
RS232 to USB.

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 
The following users thanked this post: KungFuJosh

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #30 on: August 27, 2024, 01:45:52 am »
We've updated the IM3536 plotting routines, cleaning up some things and adding the ability to handle Engineering Input notation like k (kHz) and M (MHz).

Here's a few plots of a 32.786KHz Crystal using the Custom Split-Kelvin SMD LCR Fixture with the IM3536. These are with 1Hz steps with Linear Frequency Plots.

Note how the Phase transitions between -90 degrees Capacitive to +90 degrees Inductive and back to -90 degrees Capacitive. This occurs as the Frequency sweeps up to Series Resonance, then to Parallel Resonance, and past Parallel Resonance. Also note how RS (Effective Series Resistance) peaks at Parallel Resonance.

Will include the TH2830 version if anyone is interested (needs some testing tho).

Best,
« Last Edit: August 27, 2024, 02:14:43 am by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 
The following users thanked this post: Kean, RoGeorge, KungFuJosh

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5768
  • Country: us
  • TEAS is real.
Re: LCR Meter Plot Software
« Reply #31 on: August 27, 2024, 02:02:06 am »
That looks great!
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 
The following users thanked this post: mawyatt

Online chilternview

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: gb
Re: LCR Meter Plot Software
« Reply #32 on: March 26, 2025, 08:09:05 pm »
Will include the TH2830 version if anyone is interested (needs some testing tho).

Hi Mike, do you still have the TH2830 plotting script? I have a (newly acquired) TH2827C and am interested in plotting impedance vs frequency, I'm not sure how similar the two lcr meters are but hopefully enough to get something working for mine? Thx.
 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #33 on: March 27, 2025, 02:04:44 am »
Will include the TH2830 version if anyone is interested (needs some testing tho).

Hi Mike, do you still have the TH2830 plotting script? I have a (newly acquired) TH2827C and am interested in plotting impedance vs frequency, I'm not sure how similar the two lcr meters are but hopefully enough to get something working for mine? Thx.

It's been awhile since we've used this, but think this is the Python LCR Plotting Routine for the TH2830. Uses RS232 Interface for Comms with PC, also has USB Interface.

Also a DC Plotting Routine for DC Bias Sweeps (PC_TH2830+SPD_6_DC.py) which uses SDP3303X DC Bias Source (USB) and HP34401A DC Reading (RS232). This works with the LCR DC Bias Interface Adapter and Special SMD LCR Meter Fixture DC Bias Adapter we developed awhile back.

Best
« Last Edit: March 27, 2025, 02:06:51 am by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Online chilternview

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: gb
Re: LCR Meter Plot Software
« Reply #34 on: March 27, 2025, 05:35:33 am »
Thanks Mike, what RS232 cable do you need from PC to the LCR meter? a 'null modem' cable? Or will a USB to RS232 D type connector work?
 

Offline thephil

  • Regular Contributor
  • *
  • Posts: 195
  • Country: de
    • Techbotch
Re: LCR Meter Plot Software
« Reply #35 on: March 27, 2025, 09:01:01 am »
Nice! I love controlling my instruments via Python – lots of flexibility. Unfortunately, I don't have a Tonghui. Only a East-Tester LCR meter (works for me...).

But what I really wanted to say: Have you considered publishing your program on a place like github? That makes it easy to find and adds an easy way for others to contribute. I so that wiht my scrips, even if they address a limited audience.
It's never too late for a happy childhood!
 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #36 on: March 27, 2025, 12:22:39 pm »
Thanks Mike, what RS232 cable do you need from PC to the LCR meter? a 'null modem' cable? Or will a USB to RS232 D type connector work?

We use a cheap USB to RS232 cable with Null Modem Adapter like shown.

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #37 on: March 27, 2025, 12:43:55 pm »
Nice! I love controlling my instruments via Python – lots of flexibility. Unfortunately, I don't have a Tonghui. Only a East-Tester LCR meter (works for me...).

But what I really wanted to say: Have you considered publishing your program on a place like github? That makes it easy to find and adds an easy way for others to contribute. I so that wiht my scrips, even if they address a limited audience.

Obviously (from these routines) Coding/Software is not our thing, so only develop such when necessary like these examples. We've never used or done anything with GitHub and not sure how beneficial these examples would be in present form. Probably better for someone with good coding skills to hone these examples into something more refined and presentable then post on Github.

Anyone is welcome to use and adapt these and post here and/or on Github.

We don't have a East-Tester but changing the interface parameters and the control/measure parameters to fit should work. This is what we did when going from the Hioki IM3536 to the Tonghui TH2830, as the routine was originally developed for the Hioki.

Anyway, hope you can adapt for your East-Tester!!

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Online chilternview

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: gb
Re: LCR Meter Plot Software
« Reply #38 on: April 02, 2025, 06:35:28 pm »
We use a cheap USB to RS232 cable with Null Modem Adapter like shown.

I had a USB type B to USB type A cable so I tried that with the Tonghui and a PC. Using PyVisa it works if I set the BUS MODE to USBTMC, and e.g the following:

import pyvisa as visa
rm = visa.ResourceManager()
lcr_meter=rm.open_resouce(<usb resource name>)
lcr_meter.query('*IDN?')

However, when trying to do a frequency sweep and using triggering e.g

lcr_meter.write('TRIG:IMM')
result=lcr_meter.query('FETC?')

it seems to timeout on the query. I've tried setting long timeouts and inserting a wait between writing the trigger and querying the result but to no avail. The strange thing is that it only seems to timeout when running from within the python for loop; if I try the above commands manually then they work just fine. And it seems only reading data from the lcr meter is a problem, writing (to set voltage, frequency, mode etc) works just fine.
 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #39 on: April 03, 2025, 12:37:15 am »
Try using RS232 to USB like we mentioned, works for us with TH2830!!

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Online chilternview

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: gb
Re: LCR Meter Plot Software
« Reply #40 on: April 03, 2025, 05:27:22 am »
Mike, I will try RS232 today - need a null modem lead for that. One other difference though, I see you are importing a python module called 'myvisa' not 'pyvisa' as I am... what's the difference?

 

Online chilternview

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: gb
Re: LCR Meter Plot Software
« Reply #41 on: April 03, 2025, 09:23:19 am »
I found that the following does not work when trying to use python/pyvisa scripts for the TH2827, as it gives a timeout error on the read cmd:

lcr_meter.write('TRIG:IMM')
lcr_meter.write('FETC?')
result=lcr_meter.read()

But if I do this it does work!

lcr_meter.write('*TRG')
result=lcr_meter.read()

According to the documentation, *TRG triggers the unit and sends the results to the output buffer. Which you would have thought was the same as doing a TRIG:IMM followed by a FETC?, but no. I thought maybe the read or write termination character might be the source of the problem but using either '\r' or '\n' made no difference.






 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #42 on: April 03, 2025, 01:11:08 pm »
This is what we used in Python (see python routines above).

 #Trigger and Read Data
                wait = 0.5
                serial.send_msg('*TRG')
                serial.send_query_msg('FETC?', Timeout_default)
                msgBuf= serial.msg_buf
               


Don't know what the difference between myvisa which we used and pyvisa.

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Online chilternview

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: gb
Re: LCR Meter Plot Software
« Reply #43 on: April 03, 2025, 02:46:40 pm »
Don't know what the difference between myvisa which we used and pyvisa.

Well it's a completely different beast, those routines (send_msg for example) don't exist in pyVisa.

The main problem has been that the documentation is very poor, and it takes some experimenting to figure out the command and response format.

A frequency sweep point using read() gives:
['1.01611E+00', '8.99431E+02', ' 0', ' 0', ' 5\r']

Note the '\r' at the end - not a linefeed as you might expect.

I have managed to get list mode working on the TH2827C, which is great - you set up to 201 frequency points for a sweep and it goes away and runs them all.

 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #44 on: April 03, 2025, 03:43:58 pm »
Did you try the routine we mentioned? Maybe try Myvisa?

Would expect the TH2827C command set would be "similar" to the TH2830, probably worth a check.

We just turned on the TH2830 and connected up our PC (Windows 10), using the USBCDC Mode in TH2830 Setup which shows up on PC as Com Port 4.

###########################################################################################
    #Serial port for PC and TH2830, Null Modem Adapter & Cable, set TH2830 to RS232 Serial 9600
    #For USB use TH2830 USBCDC Mode and direct USB cable
    #Routine works with RS232 or USB Connection from PC to TH2830 under Myvisa
    ###########################################################################################
    TH2830 = "ASRL4::INSTR" #USB PC address, use gui Python script, must be in quotes "address"
    serial.open(TH2830) #Open TH2830
    time.sleep (1)


Here's a plot we just did of an LC Network (470uH || 0.22uF) using the routine shown above.

Best
« Last Edit: April 03, 2025, 03:50:40 pm by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Online chilternview

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: gb
Re: LCR Meter Plot Software
« Reply #45 on: April 03, 2025, 06:56:16 pm »
Here's one with a 0.28mH choke in parallel with a 5600pF capacitor. Used 40 points/decade. The list sweep is limited by the unit to max 201 points which is not a problem. However a LIST:FREQ cmd does seem to have a limit to the length of the remainder of the cmd, or maybe that's a write buffer limit in pyvisa; I had to cut down the number of digits after the decimal point to 2. Again not really a problem.
 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #46 on: April 03, 2025, 07:38:04 pm »
Looks good :-+

Did you use USB or RS232 to talk with the meter?

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Online chilternview

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: gb
Re: LCR Meter Plot Software
« Reply #47 on: April 03, 2025, 07:51:39 pm »
I used USB, seems to work the same as RS232. Just set the bus mode to 'USBTMC' in the system page. It's not entirely clear to me what the difference between USBTMC and USBCDC mode is, but only the former worked with pyvisa.
 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 5195
  • Country: us
Re: LCR Meter Plot Software
« Reply #48 on: April 04, 2025, 01:49:31 pm »
We couldn't get USBTMC to work with our Tonghui, but USBCDC does....go figure :o

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Online chilternview

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: gb
Re: LCR Meter Plot Software
« Reply #49 on: April 04, 2025, 02:23:32 pm »
I googled them, says:

Key Differences Summarized:

Feature               USBCDC                                                     USBTMC
Purpose               Virtual COM port for serial communication    Instrument control, emulating GPIB
Communication    Virtual COM port                                         VISA-based, USBTMC protocol
Drivers                Vendor-specific drivers                                VISA drivers (e.g., NI-VISA)
Use Cases           Serial communication for various devices      Test and measurement instruments

Which would explain why USBTMC works with VISA, whereas USBCDC works with serial comms.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf