After we at the
last time The entire hardware and put the first sketch into operation, the LabSupply now gets comfort functions. The instruction list of the Command Processor now looks like this:
const MD_cmdProcessor::cmdItem_t PROGMEM cmdTable[] =
{
{ "?", handlerHelp, "", "Help", 0 },
{ "h", handlerHelp, "", "Help", 0 },
{ "st", handlerST, "", "Systemeinstellungen anzeigen", 0 },
{ "u", handlerU, " u", "Usoll: [V]", 1 },
{ "i", handlerI, " i", "Isoll: [mA]", 1 }, //Stromquelle
{ "ix", handlerIX, " x", "Imax: [mA]", 1 },
{ "px", handlerPX, " p", "Pmax: [mW]", 1 },
{ "r", handlerR, "", "Regelung ein/aus", 1 },
{ "um", handlerUM, "", "Spannung messen", 1 },
{ "im", handlerIM, "", "Strom messen", 1 },
{ "ra", handlerRA, " r", "Ramp Parameter
Ustart:Ustop:wie oft?:Steptime[ms]", 2},
{ "rt", handlerRT, "", "Ramp Funktionstest", 2 },
{ "ca", handlerCA, "", "Calibrierlauf", 3 },
{ "cp", handlerCP, "", "Calibrierdaten ausgeben", 3 },
{ "wp", handlerWP, "wp", "Wiper direkt setzen 0-255", 3 },
Electricity limitation with IX
The M401 converter has an integrated electricity and temperature limitation. So we do not need to build up additional electricity limitation to protect it. It is also protected against the reversal of the input terminals and short circuit.
Our adjustable current limitation is used to protect the test setup that is operated with the Lab Supply. Since our device should be integrated into computer-controlled test structures, it provides an error message via serial USB for the current limitation. The controlling computer reads the error message, extracts it and lets his parser run over it. The parser knows the standardized error message and delivers the number of the error message together with the values for the tax program. This program decides what should happen. For example, the output voltage can regulate (foldback). The tax program runs on an external computer.
Instruction IX: Set current limit
To set up the current limit, we indicate the value in MA. Default is 4000 mA.
IX 350, for example, sets the current limitation to 350 mA.
If this limit is exceeded, the red LED "reaches" (LED on D3) lights up. At the same time, the following message comes via the serial USB interface:
The last line contains the error description for the tax calculator. In pointed brackets, the setpoint is the first place, in the second place the measured actual value.
The current limitation also works in manual mode. If you turn the 50 k-poti to the right, the LabSupply immediately recognizes that manual mode has been activated. The LED on D2 (red) lights up. If you, for example, set up a current limit to 250 mA with IX = 250, then connect a suitable load resistance, e.g. turn 10 Ω and the potentiometer to the right, you can follow very nicely how the overcurrent LED on D3 (red for "IMAX") illuminates.
Instruction PX: Set the power limit
For many components, e.g. resistors, transistors and much more, there are performance limit values. It may well be that an electricity limit is observed, but the performance limit is not. That is why there is the PX instruction, which gives a limit in Milliwatt [MW] to the LabSupply.
If a maximum of 2.5 W should be possible at 5 V, there is no current limitation, but for 2500 MW the instruction: PX 2500 This means that we are independent of the voltage and electricity value.
The error message is exactly structured as with the current limit. LED 3 & 4 flashing alternately.
Instructions I: The LabSupply as a power source
A source of tension is certainly familiar to all of us. But what is a power source good for? To explain it very easily: A power source ensures that an external element - e.g. a resistance - always flows the specified current. Let us assume that we want to always flow through a potentiometer the same electricity when we adjust it.
Our potentiometer should have 100 Ω resistance if its handle is at one end. If it is at the other end, the resistance is 0 Ω - a short circuit. That is why I recommend this simple circuit for the test, which always guarantees at least 10 Ω resistance between the A-B connections. With the IX 150 instruction, we set a current of 150 mA. Now we put the potentiometer on the position in which it represents a short circuit. We see that our LABSPUPLY sets a voltage of 1.5 V. Exactly 150 mA flow. We turn the potent on the right and thus increase the resistance. We see that the tension continues to rise, the electricity remains constant.
The theoretical and practical limit is roughly the middle position of the potentiometer when it reaches 50 Ω. Since our LabSuppy can give up a voltage up to approx. 6 V, the current remains constant up to this voltage. After that, the power source cannot deliver more voltage and the current through the two resistances begins to sink.
One more note: The operating mode as a power source is displayed Door the green LED of D5. The electricity and/or power limitation can also be used during electricity source operation.
Practical use of electricity and power limitation
When I presented the concept of the LabSupply friends, questions and objections came as to why the device did not respond to exceeded limit values, but only reports it. In my experience, this is a philosophical question. In the professional laboratory you choose an oversized device for a task - wherever possible. A device that does not damage if limit values are exceeded. The supplied experiment does not get its own protection, which is part of the test control, not part of the power supply.
In our case it is the same. Both the Lab Supply itself and the upstream laptop power supply are oversized for the purpose. If it was different, the LabSupply would have to set the "Wiper = 0", for example, and thus specify the lowest possible voltage. There is also a power mosfet between the output of the voltage and the consumer, which immediately becomes non-leading when overloading and separates the outcome from the consumer.
Instructions RA: Ramp function - The LabSupply gets properties of a functional generator
For many attempts and some handicrafts, you need a voltage source with ramp function, an increasing or falling voltage. The individual "steps" should be passed through within precisely defined time intervals.
To do this, we use this instruction with four parameters:
RA Ustart: Ustop: How often ?: Steptime [MS]
The instruction is RA, followed Door a space. The tension follows where our ramp should start. Ustart can be smaller than USTOP, then the ramp leads from bottom to top. Or vice versa, it runs from the higher voltage to the lower voltage.
The parameter follows how often? Finally, the instruction would like to know how many milliseconds you should wait between the steps: Steptime [MS]. Another option would have been possible: to specify the voltage difference between the stages. I was able to instruction with four parameters.
Please do not forget the double points between the parameters, because our parser needs it to dismantle the instructions.
When the ramp function has started, it reports the parameter settings via Serial USB:
At the end of the run there is a ready-made message.
If you have not yet built such a "mini-parser" yourself, I recommend studying sketch, there the lines from #129. As usual, I have "programmed in detail", that is, it was important to work, clearly (I hope) and to work with bonds with good examples, so that the sketch can be easily understood and adopted in my own projects.
Ramp function in practice
Before we use the ramp function, a few considerations of what we want to do with it and what we can expect.
First of all, it must be clear: the LabSupply is not a functional generator. It is a power supply with control. Because their controllers are designed to keep a tension or a current, they have some "thick" capacitors on the board. The pace of the regulation is therefore limited. In addition, if we measure without stress, e.g. with an oscilloscope, the output voltage can only drop as quickly as the capacitors discharge from a higher voltage. Without a load, this is difficult. So if we want to lower the tension too quickly (Rampdown), it will be difficult without stress. The capacitor also takes time to charge.
Let's take a look at practical results: This oscillogram shows the LabSuply, which is contaminated with 47 Ω.
The instruction for this "ramp" was:
RA 1.5: 5: 10: 50
The lowest line marks 0 V. The dashed line seen from bottom to top marks exactly 1.5 V. The voltage rose from 1.5 V to 5 V, you can see the individual "steps". You can also see that the sloping flank takes some time to arrive again at 1.5 V. This time can be controlled quite well through the stress resistance. The smaller it is, the steeper the flank will be.
Instruction RT: Ramp test
Now we still want to know how quickly our Lab Supply can conjure up a ramp on the screen. To do this, we use ramp test, a minimalist function without all the frills:
The outer main loop is run through 1000x so that you can set the memory functions on the oscilloscope in peace and trigger the signal cleanly. The inner loop sets the Wiper gradually from 0… 200. After 200 runs, the cycle begins from the front.
On the oscillogram you can see that the LabSuply starts with the ramp at 1.3 V (Wiper = 0) and pulls up to almost 6 V. With 5 V it becomes clear that the 10 Ω load resistance pulls the voltage so far down so that the voltage drops somewhat. We didn't have that with the 47 Ω when testing the RA function. But the flank is sharp, about 10 ms.
How long does a cycle take? 200 runs with 1ms Delay result in 200 ms + 2 x approx. 10 ms for the processor processor. The result is certainly within the framework of expectations.
Instructions St: Show status / system settings
After the LabSuply has received so many additional functions, the clarity can suffer. What exactly have I hired now? How was that still? To create the overview, there is the information function: ST - without parameters - that shows our settings:
In this example, no load is connected, but a current limit is set up to 275 mA. The remaining values are certainly self -explanatory.
The sketch
Our sketch has grown to just over 400 lines with the new functions. So that it remains easy to read, I have outsourced the function of the imeasure function for the power measurement for the voltage measurement. Both functions calculate an average of 10 measurements. Please note that our ACS712 Hall measuring module is quite sensitive to external magnetic fields. I refer to my AZ contribution to "TDMM - The Speaking Multimeter", in which the topic is discussed in more detail. So please do not put the Lab Supply right next to a transformer or the LABTOP power supply that supplies it. Possibly. the correction of the imacine function helps. The "zero position" is defined in program line 373. It is the value "520": IX = (520.0 float (II))*25; Maybe please change! If the output terminals of the LabSupply are unencumbered, the current = 0 mA must be.
For the signaling of an exceeded performance limit for the PX instruction, there is a "Flasher" function that alternately flash our LEDs on D3 (red for "IMAX") and D4 (yellow for "Calibrated").
The new variable declarations are a supplement to the sketch. As a maximum load current IMAX = 4000 mA, as a power limit Pmax = 25000 MW. There is a Boolsche Variable Iquelle that tells us whether the power source function is activated.
As soon as a voltage requirement with U XXX is used, the RA or RT function is used, the sketch automatically switches off the power source function.
Conclusion
The two blog posts have shown how you can build a powerful laboratory device for many applications with very little effort and money. I do excellent services in all work with microprocessors and the associated measurement technology. I am also happy to use the LabSupply M401 to test components, e.g. to record a transistor characteristic line or to examine a MOSFET.
For use in the radio system, I built a modified device that has a metal housing, as well as a network filter and output filter. The M401 is quite good as a center and short-wave transmitter :-)- if you do without the shielding. Sensitive recipients are disturbed (QRM). However, the disorders can be limited with the measures described to the limit of the measurement and audible.
I look forward to your ideas, suggestions and feedback.
1 Reactie
Hans W.
guten Abend, ich plane mir ihre 2 Projekte mal nach zu Bauen.
Steuerbares Netzgerät, und sprechendes Multimeter.
Ich habe da einige probleme mit Fritzing….ihr beider aufbau ist mir zu viel Kabel Salat.
könnte man geg. die beider Fritzing datei mal zuim runterladen bekommen?
eine Andere Bitte sind die Beiden Gehäuse….woher haben sie die? täte mir gerne welche Ordern.
einen schönen Feiertag
grüße und Danke für ihre Rückantwort…