Author Topic: A SCPI Programmable (Precision) Resistor  (Read 5514 times)

0 Members and 1 Guest are viewing this topic.

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #25 on: December 15, 2023, 07:44:28 pm »
Very nice! If you don't mind me asking: Are you willing to share the schematics of the resistor networks?

There they are.
The trick is, that each resistor value is just under 2 times greater than the one before. 95% to 97% is the sweet spot.
Once the microcontroller knows the exact value of each resistor is is possible to set very fine, actually ridiculously fine values. Beyond the capabilities of the resistors even.
Some of the relays are low EMF relays that also have a really constant contact resistance.

Have fun!
Where is that smoke coming from?
 
The following users thanked this post: luudee, SebastianH

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #26 on: December 15, 2023, 09:40:39 pm »
Had a look at your design on github.

You did some nice things that I regret not having done as well.
My design only used one PIC microcontroller for the UI and the relay and one smaller one for serial to USB. There is an additional ARM controller inside the Ethernet but I don't count that.
Early on I ran into issues with the PIC18 microcontroller flash size and migrated to a bigger one.
Also the choice of the 4x20 Display turned out to be not sufficient for what I wanted.

I also like the power supply design you have choosen. I temporarily went with a external DC power supply design but also got a very similar AC/DC converter to yours sitting around in a box.
The case you choose looks awesome. The two unit I made use totally different cases but I am not satisfied with either of them
My goal was to make the device the same size as the most common 9 inch wide and 2U high devices on the market, like a 34401 multimeter or something.
However I could not find any suitable housing that would really do the trick.

Where is that smoke coming from?
 

Offline SebastianHTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #27 on: December 15, 2023, 09:44:46 pm »
Looks great. Initially I thought that you repurposed an old HP case.

What is the topology of the resistors/relays network?  Trying to understand how the resistances of the relays factor in, especially in low settings. 

Thanks! I thought about doing something like that, but buying old equipment and ripping it apart instead of repairing it doesn't feel right, generally speaking. It can be cheaper than buying a new case though. If I found a faulty HP unit damaged beyond repair, i think I would go for it. Actually, I just ordered an old non-working Agilent DC Mobile Communication power supply. So if I can't repair it...

In this series-style toplogy the contact resistance plays a significant role, as you can see in the first performance diagram in my first post: At 1 Ohm the deviation was about +5% .. 6% (4-wire measurement), meaning a total of 50-60mOhm for 2 relays in series + PCB traces etc. In these cases the resistor tolerances (0.1% spec) are negligible. The relative error drops very quickly though. For 2 Ohm it's already well below 2%, for 100 Ohm about 0.1% (all for 4W). With values above 10k it's the other way round - the resistor tolerance of (in my case) +-0.1% dominates the error. Then the calibration/adjustment improves the accuracy to a point where my 34401A's accuracy becomes a concern.

I implemented some measures to reduce the effective contact resistance, i. e. using both relay poles in parallel, shorting the upper decades for the three lower decades (i called that "bypass relays"). But at the time I didn't care too much about the accuracy of the really low values anyway. The lower decades are partially there to improve accuracy in the upper ranges...

I want to hear how this thing sounds in action. It must be really sweet.

The signal relays are reasonably quiet. Plus the case doesn't have any cooling vents. I made a short clip (will take a few minutes for the higher resolutions):




There they are.


Thanks, appreciate it! Will take a closer look at it! Did you do any measurements/graphs showing the accuracy? I might wanna know more ;) Which low EMF relays did you use?
 
The following users thanked this post: Roehrenonkel

Offline SebastianHTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #28 on: December 15, 2023, 10:19:04 pm »
Had a look at your design on github.

You did some nice things that I regret not having done as well.
My design only used one PIC microcontroller for the UI and the relay and one smaller one for serial to USB. There is an additional ARM controller inside the Ethernet but I don't count that.
Early on I ran into issues with the PIC18 microcontroller flash size and migrated to a bigger one.
Also the choice of the 4x20 Display turned out to be not sufficient for what I wanted.

I also like the power supply design you have choosen. I temporarily went with a external DC power supply design but also got a very similar AC/DC converter to yours sitting around in a box.
The case you choose looks awesome. The two unit I made use totally different cases but I am not satisfied with either of them
My goal was to make the device the same size as the most common 9 inch wide and 2U high devices on the market, like a 34401 multimeter or something.
However I could not find any suitable housing that would really do the trick.


I use the STM32G4 series with 128kB RAM and 32kB Flash as you have probably seen. I didn't really optimize anything (not an embedded dev) and didn't write the firmware with memory efficiency in mind (like at all), except for switching on the "optimize for size" compiler option - and with that in mind and the SCPI library, FreeRTOS included the 128kB of Flash are barely ok. In future project I'll probably use a micro with more Flash. For DIY builds a few bucks aren't worth the trouble imho.

Let me tell you, if 4x20 isn't good enough then imagine how difficult it has been to utilize the 1x18 display properly ;) I'd like to use a 800x480 LCD touchscreen in the next project, but I'm not yet sure how this will work for me. This certainly requires a much more powerful micro, something like the STM32H series.

And yes, finding a good looking case that meets the requirements is really hard. I was lucky here, I guess. Unfortunately, my variant is only ~25cm in depth and has no air vents, so for anything related to power it's a challenge. It's available in other form factors and generally fairly customizable, but you really have to pay for it, so this is not an option for me.

Using an off-the-shelve AC/DC converter with built-in filter was very convenient indeed.

 

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #29 on: December 15, 2023, 10:46:30 pm »

I use the STM32G4 series with 128kB RAM and 32kB Flash as you have probably seen. I didn't really optimize anything (not an embedded dev) and didn't write the firmware with memory efficiency in mind (like at all), except for switching on the "optimize for size" compiler option - and with that in mind and the SCPI library, FreeRTOS included the 128kB of Flash are barely ok. In future project I'll probably use a micro with more Flash. For DIY builds a few bucks aren't worth the trouble imho.

Let me tell you, if 4x20 isn't good enough then imagine how difficult it has been to utilize the 1x18 display properly ;) I'd like to use a 800x480 LCD touchscreen in the next project, but I'm not yet sure how this will work for me. This certainly requires a much more powerful micro, something like the STM32H series.

And yes, finding a good looking case that meets the requirements is really hard. I was lucky here, I guess. Unfortunately, my variant is only ~25cm in depth and has no air vents, so for anything related to power it's a challenge. It's available in other form factors and generally fairly customizable, but you really have to pay for it, so this is not an option for me.

Using an off-the-shelve AC/DC converter with built-in filter was very convenient indeed.

I was also thinking of using a 4" or so touch display.
An STM32H or F7 MCU using ToughGFX could handle that.
Alternativly there are those Bridgetek HMI processors. But I think they are rather slow.

I totally believe you that only 18 characters of display must have been a challengenging.
The bad desicion I made on the microcontroller made me write all the low level code myself sind almost nothing from the PIC libs worked.
The PIC compiler can't even handle pointers correctly. So that's something that created an extra headache.

Where is that smoke coming from?
 

Offline SebastianHTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #30 on: December 15, 2023, 11:11:18 pm »
That sounds bad. I never used PICs...

Yeah, a few days ago I ordered a STM32H board and will order a 4.3" display w/ capacitive touch soon. The problem with many screens: Either low res/quality, resistive touch or huge footprint relative to the visual area and hence incompatible with the fairly restrictive case I use. LVGL would be an option too. Not sure, whether I should start with TouchGFX or LVGL...

Would be really nice to build a second generation of the programmable resistor with a large touch screen. Then again, a variant of the DIY SMU, a DC Load and a 200V power supply are already waiting for attention.
 

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #31 on: December 16, 2023, 10:32:24 am »
The relays I used are Meder BT05-2A66 for the low resistance values. For the very low ones it was necessary to use two in paralllel.
For the higher values I used Pickering 100-1-A-5-2D. Those can be driven directly by many logic ICs without using an extra transistor.
 
Where is that smoke coming from?
 
The following users thanked this post: SebastianH

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #32 on: December 16, 2023, 10:44:15 am »
TouchGFX: I got some STM32F and STM32H EVM boards here. STM32H750b-DK. There is now also an Arduino Board with STM32H MCU and a display shield. But for now it seems that the software support for a GUI is rather sparse. i.e. not existent yet. No wonder, since that is a new product IIRC.
I also thought about a solution using some Raspberry Pi Module, but that looks pretty oversized to me.
Same goes for a System using some sort of Windows. However, I could then write the code in RAD Studio, which I am familiar with.

So there are a lot of ways to go, which are equally complex and nothing that could be done just over a few weekends.
Where is that smoke coming from?
 

Offline SebastianHTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #33 on: December 16, 2023, 10:48:21 am »
Thanks! Yes, in the mean time I looked at the schematics and found the relays you used. It looks like your relays alone cost waaaay more than my whole project. If I look those up on digikey, mouser, farnell then your relays alone cost about 1000 EUR, which means almost three times the total cost of my project. Does this sound right or do you have a cheaper source? Compare this with about 60 EUR for my cheap signal relays ;) Which performance would you expect when using cheap signal relays like my EC2-xNU?

The only time I bought a low thermal EMF reed relay was for my 34401A repair...
 

Offline SebastianHTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #34 on: December 16, 2023, 10:53:31 am »
I also thought about a solution using some Raspberry Pi Module, but that looks pretty oversized to me.

I actually tried that. Linux distros on 800x480 are a pain in my opinion. Out-of-the-box support for on-screen keyboards really poor. I programmed a mock with python/tkinter plus a 4.3" touch screen. Works great, kind of. My main problem with this approach are the packaging and power/thermal considerations. Don't like to have a 5-10W furnace and the power supply to support it right next to precision resistors in a closed box.
« Last Edit: December 16, 2023, 11:00:46 am by SebastianH »
 

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #35 on: December 16, 2023, 11:13:52 am »
Here is a graph that shows the resolution depending on set resistance value.
By connecting resistors in parallel it is clear that, the higher the desired value is the lower the resolution becomes.
I found the sweet spot to be at around 3400 Ohms. After that, the serial decade kicks in to add resitance in 3400 Ohm steps into the parallel decade.

Back then I tested out a lot of relays, cheap and expensive ones.
the problem with most cheap ones it, that their contact resistance varies a lot with temperature and each switching occurence.
I also evalulated COTO relays that were equally expensive, but they were not as good, by far.
Futhermore I aged them with a function generator and measured how the contact resistance changes over time.
The Meder ones were the best of them. And I think the second expensive ones. The COTO relays were even dearer.

A surprise for me was the cheap TQ2-5V DPDT relay: Their contact resistance was fairly stable as well. No good EMF performance though.
However, they don't age well. They change contact resistance over time, so regular re-adjustments are necessary.

For a other solutions I went with them and they have not let me down yet.
Where is that smoke coming from?
 
The following users thanked this post: luudee

Offline SebastianHTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #36 on: December 16, 2023, 12:08:44 pm »
That is really fascinating. For me it was just a quick project (hardware-wise), I see you put a lot of effort and money into the design. And thank you for sharing your findings, might come in handy some time. I don't think I have enough applications for it to justify the cost right now. I mean... If I run out of project ideas I circle back to your approach :D

Do you have any pictures of your PCBs? Ah, and what resistors did you use?
« Last Edit: December 16, 2023, 12:10:58 pm by SebastianH »
 

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #37 on: December 16, 2023, 12:36:00 pm »
Yes I have some dodgy pictures of the PCBs, but they don't show everything

That nice case you used. Who makes these and what type is it?

This project came to be for a few reasons:
1) I needed something that could emulate PT100 sensors at work
2) I also needed something that could emulate the conductivity of NaCl solution
3) Having done some programming in Assembler it was time to learn some embedded C, so creating a project that would be bonkers to code in assembler was something to practice C.
4) I was just interested if that concept even worked.

Now the old version of this is at my workplace and became a key test equipment used in service and repair. It also gives me information about the endurance.
So far, one of the pickering relays had to be replaced, it did not turn on anymore.

Where is that smoke coming from?
 
The following users thanked this post: luudee

Offline SebastianHTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #38 on: December 16, 2023, 01:31:30 pm »
Very cool, thanks! Looks like metal film resistors. ppms? Is this an ethernet -> serial adapter of some sort?

The case is made by ELMA, I think it's the so called "Stylebox 15 Standard".
 

Online Roehrenonkel

  • Regular Contributor
  • *
  • Posts: 178
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #39 on: December 16, 2023, 01:42:45 pm »
Hi Chipguy,
 
nice work too.
Did you implement the GPIB-Interface?
....or is it just there to confuse your coworkers??

Best regards
 

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #40 on: December 16, 2023, 02:00:35 pm »
Very cool, thanks! Looks like metal film resistors. ppms? Is this an ethernet -> serial adapter of some sort?

The case is made by ELMA, I think it's the so called "Stylebox 15 Standard".
The resistors are standard 10-15ppm TC 0.1% tolerance resistors. They turned out to be sufficient for the job. However it is totally possible to use S102 0.2ppm Vishay PG resistors, but then you need about five times more relays in parallel for the low values in order to make their influence small enough to justify the expensive 8 EUR resistor.
The ehternet adapter is a USRIOT USR-K3 https://shop.usriot.com/ethernet-to-uart-modules-usr-k3.html
It contains a TI Tiva Ehternet to UART MCU, so no work needed there for me.
I can emulate com ports via ethernet then. No LXI though.

The GPIB is not functional (yet). I left a few headers there to plug in a little module with GPIB to UART. Never got around to design one.
As you can see it was planned as an option anyway.

I had the idea to maybe sell them and get self employed with this on the side. But german buerocracy prevented me from that. It is a headache even thinking about it.

Gonna have a look at the housing manufacturer you have choosen, it looks really good.
Where is that smoke coming from?
 
The following users thanked this post: Roehrenonkel

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #41 on: December 16, 2023, 04:53:22 pm »
Hi Chipguy,
 
nice work too.
Did you implement the GPIB-Interface?
....or is it just there to confuse your coworkers??

Best regards
My current coworkers have no clue of what GPIB even is. Maybe one. But we are not really working with any GPIB Interface at work.
I made this in preparation, but never got round to design the module to handle GPIB. So it's a DUD just for show  8)
Where is that smoke coming from?
 

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #42 on: December 16, 2023, 04:55:53 pm »
Very cool, thanks! Looks like metal film resistors. ppms? Is this an ethernet -> serial adapter of some sort?

The case is made by ELMA, I think it's the so called "Stylebox 15 Standard".
Just downloaded some nice STEP files from their site.
Seems that housing got a successor called "Stylebox 15 e-motion". The handles look less chunky which is also nice.
How much did you pay for that?
Where is that smoke coming from?
 

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #43 on: December 16, 2023, 05:01:39 pm »
The first one I made looked a bit different.
While the 2nd one used a case called "XDream" from a company called "Apra Norm", the first version used a housing from Bopla.

I have attached a few pictures of the first tests and housing. Only partially assembled. And the first PCB, before the 2nd serial decade PCB came in.
Where is that smoke coming from?
 

Offline SebastianHTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #44 on: December 16, 2023, 06:01:08 pm »
The Meder relays look really fancy on your board :-+ Got them pretty cheap on ebay (or something, surplus), my guess would be something like 50 EUR, can't quite remember.

Yep. For my 3d models I simply used the step-file of a Stylebox 15 e-motion - close enough...
« Last Edit: December 16, 2023, 06:06:11 pm by SebastianH »
 

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #45 on: December 16, 2023, 06:33:21 pm »
The Meder relays look really fancy on your board :-+ Got them pretty cheap on ebay (or something, surplus), my guess would be something like 50 EUR, can't quite remember.

Yep. For my 3d models I simply used the step-file of a Stylebox 15 e-motion - close enough...
I bought them from Mouser and back in 2017 I paid 26,02 EUR per piece. As you can see in the photos they are silver and not blue like in the picture on the Mouser website.
Today that would be 460 EUR worth of Meder Relays on that board. Back in 2017 it was 290 EUR. Even more expensive today.
Where is that smoke coming from?
 

Offline SebastianHTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #46 on: December 16, 2023, 07:13:50 pm »
(Just to clarify: 50 EUR was for the case not the relays.)

Yep, that's is why I'm hesitant (to say the least) to build something like that. Otherwise I'd probably have to try.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 3694
  • Country: gb
  • Doing electronics since the 1960s...
Re: A SCPI Programmable (Precision) Resistor
« Reply #47 on: December 16, 2023, 08:10:43 pm »
That is seriously impressive. Beautifully constructed. I've been doing this for 50 years and this is outstanding!

A lot of test gear uses reed relays, BTW. They have a longer life, supposedly, although my 3314A contains loads of them and they need replacing periodically.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Chipguy

  • Supporter
  • ****
  • Posts: 320
  • Country: de
Re: A SCPI Programmable (Precision) Resistor
« Reply #48 on: December 16, 2023, 08:55:14 pm »
(Just to clarify: 50 EUR was for the case not the relays.)

Yep, that's is why I'm hesitant (to say the least) to build something like that. Otherwise I'd probably have to try.
Yeah after reading it a second time I figured that much  ;D
Using different relays would be an option as well.
How are the relays doing, that you use?
I put my first unit into the fridge and the oven a few times to see how everything would behave after being stressed.
Funny thing: After a few initial changes it bedded itself in.

Where is that smoke coming from?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf