LabSupply - Controllable Power Supply Unit With M401 - Part 1

by AZDelivery in Circuits > Arduino

21 Views, 0 Favorites, 0 Comments

LabSupply - Controllable Power Supply Unit With M401 - Part 1

Update  (11).png

Simple do-it-yourself construction, cool features


Objective


A clean power supply is required for experimental setups. You often want to control it from the computer, e.g. to record a characteristic curve. You want voltage and current measurement, as well as current/power limitation and more.

Two blog posts present this laboratory power supply, which offers some features of professional devices and yet is easy to set up. The "pizzazz" is in the sketch that controls it.

Classic laboratory devices are longitudinally regulated. They therefore "burn" a lot of energy - often the larger part. They are also much more massive and complicated than the compact LabSupply.

Supplies

1x Nano V3

1x DSN-V288 Volt/ Ammeter

1x ACS712 - 5 A

1x StepDown converter M401

1x MCP 42010 electronic potentiometer 10 kΩ

1x Notebook power supply unit, 19.5V

Resistors 1 kΩ, 5.7 kΩ and 4x 470 Ω

Electrolytic capacitors: 2,200 µF, 100 µF and 0.1 µF

LEDs: 2x red, 1x green and 1x yellow

Hole grid board(s)

Concept

The LabSupply consists of a 19.5 V notebook power supply and an M401 StepDown converter. We therefore use two switching power supplies. Special care is therefore required to limit converter artifacts (interference from ≥ 180 kHz and above).

We create a device with the following properties:

- Voltage adjustable: 1.3 - 6 V at up to 4 A; accuracy ~ 0.1 V at 19.5 V input

- Voltage range expandable for input voltages > 19.5 V input (max. 40 V)

- Suitable for almost any type of LabTop power supply unit

- The voltage can also be set manually

- Noise approx. 10 mV (@180 kHz) at 1A load

- Optional load-dependent voltage regulation (can be switched off)

- Voltage measurement

- Current measurement

- Independent display instrument for voltage and current

- Calibration function with protocol; important for input voltages other than 19.5 V

- Adjustable current limit**

- Adjustable power limitation**

- Operation as current source**

- RampUp/ RampDown function**

[** Described in Part II of the blog post]


The StepDown Converter M401

The M401 StepDown converter can be operated with an input voltage of up to 36 V. Uncooled, it delivers up to 4 A output current, which corresponds to a maximum of 160 W. This is quite decent data. Cooled / ventilated, it delivers up to 8 A.

The converter comes with a built-in 50 kΩ potentiometer, which has a separate switch for switching the Module on/off.


We replace this analog potentiometer with an electronic potentiometer MCP42010 (10 kΩ) or MCP 41010 (also 10 kΩ). The Module is thus controlled By the Nano V3 can be controlled.


The M401 is converted

The mechanical potentiometer is carefully desoldered so that the electronic potentiometer can be used later. This requires dexterity and a little patience. The circuit board may be slightly damaged. Here we see it with the potentiometer removed and reconnected with two wires. The switch is bridged (detailed picture: bent white wire):

The detail picture shows that the potentiometer wiper and the right terminal are connected. You should now check whether the converter is still working properly. This intermediate step is highly recommended.


Control Range of the LabSupply

Our test setup can be adjusted from 1.3 V to 19.5 V with the mechanical potentiometer. The later LabSupply has a smaller control range: 1.3 V to 6.3 V. This is usually quite sufficient for us. But why is this the case and what can be changed if necessary?


At the heart of the matter is the common massbetween the M401 converter and the Nano V3 and its electronic potentiometer MCP42010. Why we replaced the mechanical 50 kΩ potentiometer with an electronic one 10 kΩ-potentiometer, I will explain later.


This is what the block diagram looks like:


The mains connection is indicated on the left-hand side. By using a laptop power supply for the primary supply, we avoid dealing with the mains voltage. Its 19.5 V output voltage is connected to the M401 (observe polarity!). The earth shown in black connects the input and output sides continuously.

The positive pole of the laptop power supply also leads to the M401. We take the regulated voltage from its output. The mechanical potentiometer is connected to the circuit without ground. This is the only reason why the full control range is available. This is a feature of the circuit that we cannot easily reproduce with the MCP42010. The potentiometer is connected as a rheostat (var. resistor), not as a voltage divider. The wiper is connected to one pole of the potentiometer resistor.


The control range can be fully utilized with an electronic 10 kΩ potentiometer. Tests with an electronic 50 kΩ (the MCP42050) showed that only around 20% of the adjustment range could be used. A 10 kΩ potentiometer is therefore the much better choice.


If you want to use an MCP42050 (50 kΩ) in order to utilize 100% of the control range (1.3 V - 19.5 V), then the SPI control is galvanically isolated, e.g. via an optocoupler, and the 42050 is given its own, completely floating power supply. A nice alternative project ...

Pitfalls of Some LabTop Power Supplies

Technology is becoming more and more "intelligent", which also applies to power supply units. Many of them have three connections. If you measure it, you will find 19.5 V - as expected. At low load

the voltage immediately collapses. What's going on?

The power supply unit actually needs the information that something is connected and what it is. I recommend this blog post on the subject: https://art-of-electronics.blog/labor-tagebuch/#Notebook_Adapter. You can also find a solution to this problem there.

Test Setup

Here is the set-up in Fritzing representation:


The Circuit

The circuit is built around the M401 step-down converter. The operating voltage 19.5 V / 2.5 A (up to 4 A input possible without additional cooling) enters the device on the left-hand side. An electrolytic capacitor of 2200 µF is connected in parallel to the input voltage in order to smooth the input voltage again and to absorb current peaks when the load changes.

The input voltage is fed directly to the M401 without any detours. Observe polarity! My picture is a symbolic representation. The circuit board of the M401 looks a little different.

The Nano V3 is powered via the USB port of the computer. Another step-down converter can also be used to power the Nano V3 via another step-down converter. As the PC is needed for control, this seems to me to be the more obvious option.

On the output side of the device, the negative pole (!) of the regulated voltage first runs through the DSN-VC288 for the purpose of current measurement. The thick, black cable (see instruction PDF) is provided for this purpose. A shunt of 0.03Ω is installed in the measuring device. The voltage that drops across this shunt is measured. The thick, red wire is the ground for the output. The fact that one wire is red is a little unusual.

The current measurement of the LabSupply is carried out via the tried and tested ACS712-5A. It is looped into the positive output path and does not require a shunt.

The current output voltage is converted via a voltage divider R1/R2 (5.7 k/ 1k) to a voltage that is suitable for the Nano V3 and arrives at A0.

A1 receives the output signal of the ACS712-5A. A2 is connected to the mechanical 50 kΩ potentiometer, which has been removed. It is used if you want to set the output voltage manually and use the device without a PC but with a power bank, for example.


In manual mode, the switch of the potentiometer switches to ON and sets connection D12 to + 3.3 V. Note: I have not drawn a 10 kΩ resistor from D12 to ground in the circuit diagram. Apparently some users need such a resistor on the Nano, because otherwise the potential of connection D12 "floats". It is best to retrofit it immediately.

LED 4 (at the bottom of the row) is connected to D2 via a 470 Ω resistor. It lights up when the manual operating mode is selected.

The top red LED 1 indicates that the selected maximum current has been reached (at D3).

The yellow LED 2 indicates when the control is active or the calibration run (on D4).

The green LED 3 indicates that LabSupply is active as a current source (on D5).


MCP42010


The electronic potentiometer MCP42010 (10 kΩ) is a 14-pin chip. It contains two potentiometers, of which we only need one. Alternatively, there is the MCP41010, an 8-pin chip with one potentiometer.

The potentiometer has 256 possible settings, thus a theoretical resolution of 39 Ω per bit. Due to the design of the CMOS chip, it does not offer a "0 Ω" setting. There is always a minimum resistance of around 125 Ω.

The chip tolerates a maximum current of 1 mA, which may flow through the potentiometer tap ("wiper"). We are lucky: The M401 allows a current of 0.7 mA to flow through the potentiometer at the lowest output voltage and 0.4 mA at the highest voltage. This can be quite different with other step-down controllers. If you want to "digitize" another controller, please measure the current through the mechanical potentiometer first.

I built this simple circuit on two small breadboards and gave it a small housing. It has proven itself well in practical laboratory use.

The Sketch

The benefits of the LabSupply come from the sketch. The device can, for example, charge a battery exactly according to plan, run small experiments via external program control or take over control tasks. It is suitable as a "signal generator" up to an output frequency of ~ 50 Hz, or as a "current source with arbitrary generator".

In order to keep this article clear, I will only go into some of the functions here. The blog post part 2 describes current limiting, current source function, RampUp/ RampDown and details of calibration and provides the corresponding sketches.

Download sketch

Clear Thanks to Commandprocessor

As with the TDMM part 6 I am again using the beautiful command processor from this Github page. This keeps the sketch clean and clearly structured. Even if a lot of code is required, everything remains manageable. In this small sketch, I use almost only global variables.

Once the libraries have been integrated and the variables defined, the definitions of the functions that can be called By the command processor follow directly. The only exception is void handlerHelpwhich is located below the instruction table.

After all void handlerXY are defined, the instruction table follows. The first column contains the command that the Nano V3 receives via the USB interface. Very important: The processor recognizes from the CR ("New line") that the instruction has been completed. This default setting is required for the serial interface.

An instruction is entered like this, for example: u 2.5

This sets the output voltage to 2.5 volts. It is important to use the " . " instead of the usual

" , " for the decimal place. We are already familiar with this from programming.

There can be instructions with several parameters. I will go into this in part 2.

The instruction table contains the name of the function that is to be called. This is followed By a string in the table that shows the parameter. The full text describes the function. It is output if you list the statement table in the help function with "h" or "?".


The following integer number determines in which part of the help block the function is to be displayed. There is an empty line between the blocks for a better overview.

Our void setup()is quite compact. The necessary services are started, the LEDs light up one after the other and that's it.


The void loop() also manages with just a few instructions. The very first instruction CP.run(); calls the command processor. This is followed By a self-explanatory function that queries the potentiometer switch (manual setting?), measures the voltage at the mechanical potentiometer if necessary and converts it into a setting for the electronic potentiometer.

The following loop is only run through if the parameter uregler parameter has the value TRUE value. This means that automatic load control has been activated. The M401 has its own controller, which works excellently. However, the support provided By the software control loop has proven its worth with higher loads. It is a very simple control that adjusts the potentiometer tap of the electronic potentiometer so that the desired output voltage is available again. Experts in control engineering are probably not satisfied with this.


Voltage measurement


With the function void umeasure() function is used to measure the voltage at A0. Ten measurements are carried out and the average value is calculated. In the Fritzing representation, a 100 nF capacitor can be seen at input A0 after the voltage divider. It suppresses transducer artifacts that can interfere with a measurement, depending on the output current.

A table with empirical correction factors follows the average determination. The voltage measurement is not 100% linear. One cause of error is the capacitor mentioned above.

Functions of the LabSupply M401

The range of functions is self-explanatory. This is how the function table appears on the screen:


Please set the end of the line to **New line**.

? Help

h Help

u u Usoll: [V]

r Control on/off

on Measure voltage

in the Measure current

ca Calibration run

cp Output calibration data

wp wp Set wiper 0-255

rt Ramp function test

The most important function is the voltage setting. It always requires the setpoint as a parameter. The same applies to "wp" with which you can set the "wiper" of the potentiometer directly.


All other functions do not require any parameters and are probably self-explanatory.

Calibration

The device can be operated with a wide range of input voltages. Tests show that it works just as well with 12 V as with almost 40 V input voltage from two notebook power supplies connected together.

These changes alter the factor between the potentiometer setting and the output voltage.

The function void handlerU() accepts the desired output voltage as the set value Uset . With the help of the variables ustep is used to find the "wiper" setting. In our sketch, this variable - under the conditions described - has the value 0.02686. This value is calculated from the calibration data. This is the whole point of this function.

The procedure is as follows calibration function ca without connected load is running. It provides such a list as output:



You can see in the list for each setting of the "wiper" on the MCP42010 which voltage belongs to it. You can see that this relationship is perfectly linear up to the wiper setting 200. The manufacturer specifies 1% accuracy.

Above 200, the relationship becomes non-linear. We take the following into account when calculating ustep we only consider the settings of wiper 0 ... 200 and thus arrive at the exact value 0.02686.

Proceed accordingly if you want to use other input voltages.

The "cp" instruction can be used to output the calibration data again; it is stored in RAM.

The yellow LED lights up constantly during the run. No load may now be connected. As soon as the highest voltage is reached, the LED starts to flash and the output voltage gradually returns to the minimum voltage of 1.3 V.


Ramp function test "rp"


This is a test that allows you to see on an oscilloscope how quickly the LabSupply reacts to the Usoll setting. Many factors influence the reaction speed. After all, we have a 100 µF capacitor on the output side of the device, we have several delay functions, all of which have their purpose. You can "play" with their values without breaking anything. This allows the device to react even faster. It all depends on the goal. In Part 2, we will take a closer look at "RampUp / RampDown" and get to know applications for it.


Conclusion


You are looking at a laboratory power supply unit that "lives" from its control software, but otherwise has a very simple structure ... and is of course subject to some limitations.


It is definitely worth replicating. I now use it constantly in daily practice.