STM32 Development

It’s actually completely different. Inverting as opposed to non-inverting too.

I could commit to the inverting topology. If that was the case, then I’d set bias at half 3v3 through a gain of 0.5 instead of the 10k/10k divider, assuming no knock on effects are made which can’t be dealt with further on.

Working my way through some pieces of the puzzle…

So far I’ve realised firstly I need to know the source impedance of the opamp.
Then I can get the dominant pole at this approx 25nF capacitance I measured (checking again on my bench meter it’s 27nF).

1. Impedance measured following this one.


2. Dominant pole


Using 5.5Ω it’s actually 1.07 MHz.

3. Stable?
image
Image source.
Acl = 1 because we have a follower in the previous design.
10GBP = 82,000,000
fp = 1.07MHz
82/1.07 = 76.6 … This result suggests we had an unstable circuit before!


4. Feedback capacitor
Finding the value of C1 from the circuit in my previous post… some notional figures are:
source 1
1.5nF ballpark value if it’s follower instead of a g=0.5 system.
source 2 the article at EDN.
2.7nF ballpark, R3C2 = C1R2 suggested, and the author then goes into detail on why it’s not that simple.


I think at this point I’ll be able to go ahead and make up the ‘in-the-loop’ compensator in the board design so we can get this next iteration out. I might need some help to work out the values mathematically before they arrive, or if I need I’ll be able to do it experimentally I’m sure.

That does look like a neat trick, perhaps I’ll get the footprints on for jiggery pokery. I’ll come back to this one as just getting my head round all these phase margins first.

I hope I’ve not led you astray here. The sole purpose of my post was to show how you could use a transistor on the output of the op-amp to better drive a capacitive load. I’m not sure what problem you’re trying to solve with all your other changes.

Not at all. I was looking at a compensator before. I’m feeling on top of it now. I’ll be able to report back with some figures when testing the next revision. I have footprints on for testing a few options, including transistor. Can you recommend a sot-23 tranny? I have these at the lab https://uk.rs-online.com/web/p/bjt-bipolar-transistors/8064642/

The problem was noise and bias instability. Much of this will be sorted out by separating grounds and 3v3 lines anyhow.

A few proto-boards are out for manufacture. Changes since v0.9a:

v0.9b changes

  • single phase input filter, R26 set to 0R.
  • opamp with footprints to try out-of-loop compensation (single resistor, or snubber) and in-the-loop compensation, also with sot-23 transistor footprint.
  • 2.54mm header jumpers included for switching in or out the burdens ( voltage output CT compatibility ).
  • ac-ac input has footprint for 1210 burden smt. might give an option at loading the ac-ac adaptor to get a slightly more accurate representation of the mains signal.
  • reference voltage set at 2.048V.

stm32 v0.9b.zip (1.2 MB)

Initial testing should be done by September. We’ll discuss in-house what we find and likely share much of the test information this time, cross fingers it should be looking alright.

I found a way to share the enclosure design.

. https://a360.co/3kcYF79

There’s an option there to download the step file also.

1 Like

We have a few PCBs assembled for this v1.0 stm32 prototype if anybody’s interested.

The assembled PCBs are £54.60 each, this includes a small markup to cover assembly time.

They are compatible with existing emonTx/Pi sensors. With small modifications they can also support voltage output CTs and voltage sensing transformers.

The code for the 3-phase voltage input has not yet been done, but if someone has a way to test it this is something we could discuss.

I can also get enclosures 3D printed for £35 each, or I can share .stl/.stp files if you’d like to use another service.

Many thanks.

Edit: RaspberryPi header not shown in the image there, but all units will have the header to be able to mount a rPi also.

Edit Edit: Now included in shop for easy purchase. https://shop.openenergymonitor.com/stm32-energy-monitor-dev-board/

2 posts were split to a new topic: STM32 on Nucleo64

On some tests I did a while back I found that the bias line for the current transformers had to be a really low impedance otherwise large signal inputs could modulate the bias line and then affect all the other channels that are sharing the bias line. One option if this is a problem is to add a separate RC filter on the bias line to each CT and that way signals on one CT will be less able to couple through the bias line to the other CTs. Hopefully this will not be a problem for you on this design.

Also, is op-amp offset voltage drift with temperature an issue that needs to be worried about? It may not be too much of a problem if the bias voltage drifts a little. It would certainly add a lot more cost to have a separate zero drift opamp if this was a problem.

Of course. That’s why a reasonably high power op.amp should be used. It should not then be necessary to separately filter the bias to each channel, doing so largely negates the purpose of the op.amp, which is to remove n-1 sets of resistor and large capacitor.

Not if it’s accounted for in software, which historically has always been the case.

I think I remember your tests and a comment a while back. I know a little bit more about how this circuit is behaving now, and it is definitely the case that track width and opamp spec’s will influence how much a signal on one channel effects the other.

I tried to gauge this impact on the most recent revision of the board, by @dBC’s suggestion of putting a high signal on all channels except for the middle one (channel 5).
There was a very small influence on the bias line, which came through as a reading on channel 5, about 1400 times smaller than the original signal across the 8 other channels.
So I won’t necessarily need an RC filter to isolate given such a small influence, and I think isolating the bias from the CT is a bad idea, intuitively, but it is interesting to note.

There is also an idea we’re testing out here… as a side-effect it further isolates the CT channels and provides an extra feature which we’ll be happy to promote once it’s tested.

Dan hi,

What’s the status of the development? When do you expect the hardware to be finalised, i.e. released as opposed to ‘in development’.

We’re building a new house next year and I thought I’d put one of these in rather than the emonbase we’ve had in the existing house.

If I bought one of the current boards what’s the likelihood that I’d need to upgrade when the release version is finalised? And would you guys cover that?

Also why is the price in the shop with the enclosure over £100 when you say in this post that the enclosure will cost £35?

Simon

Hi Simon,
CE testing is happening in the new year. We have a revision arriving this week which has a new feature on the CT inputs which, once tested, I’ll post the details of.

Sorry the shop price + enclosure has been set at +£40 to account for handling, then the assembled PCB and tax takes it over £100. I pay the printer £35 and originally thought to skip any extra costs.

I could arrange for a replacement of an upgrade sure. I’d wait until this board has arrived this week (I’ve had a notification of a delivery today…).

I’ll then update the shop page and post here.

Thanks Dan, I’m assuming you’ll post here when it’s arrived and has been tested?

In the meantime I’ll start looking at the firmware.

Simon

I’ll update this thread yes.

‘Sombrero Working7’ is the latest within the firmware folder.

Cheers

Sorry Dan, maybe I’m being thick but the latest version on Github under STM32 is V5.

Am I looking in the wrong place? I followed the link from the Shop page

Documentation

ah, that needs updating, use this for now GitHub - danbates2/STM32: STM32 Energy Monitoring

Cheers Dan

Simon

Hi everyone!

I’ve been asked to make another revision on the stm32 board.

We’ve taken the unit for a pre-CE check at the CE lab we use.

A conversation with the director of the lab introduced me to seriously considering instrumentation amplifiers on the inputs instead of single opamps. Mainly, this is reduce cable to board noise by increasing CMRR.

Anyone have any recommendations when using instrumentation amps? Any suggested reading?

Any decent textbook on operational amplifiers will cover the topic. Of course, any improvement is a good thing, that’s indisputable. What I would question is, will there be, in most installations, a significant improvement in performance? Is the cost worth it? How many users will see a genuine benefit?

The argument runs like this: you cannot have a balanced input with a single op.amp, it is inevitable that the impedances at the + and - inputs are different, hence although you can have balanced voltages presented at the inputs, that doesn’t help and it is balanced impedances that are crucial to rejecting common-mode interference.

The book I have is “Operational Amplifiers”, edited by Tobey, Graeme & Huelsman, Published by Burr-Brown, ISBN 07-064917-0