Above is the main board with most of the components in place. Missing is the 2.4″ TFT display – as that would obscure most of the view. As I now will do the very first testing of the analog design I will try and keep the testing as simple as possible and test as small pieces as I possibly can! I will use another lab power supply as the power supply for this Arduino Digital PSU so that I can vary the voltage and limit the current under test! That way hopefully I will be able to keep any damages to a minimum … Let me say that this careful testing of every step is absolutely necessary for ME as I have not tested the whole design yet – this is the first time! It does not mean that the tests are complicated or that very advanced functions are tested – just that the different functionalities needs testing! I will naturally correct any bugs as soon as I discover them! If you decide to build this DPSU you should also (as always) do proper testing as there could be some sort of building error! Or maybe you are not that type that makes mistakes? 😉
The voltage setting, current setting and the zero offset can all be trimmed but during these tests there is no idea to trim these properly – but we can at least have a try to see that trimming works!
Voltage Setting Test
We will use an even simpler piece of software then that we used to test the DACs with. It will just set the DAC to output the corresponding voltage to the “1000” level. It should be around 1.25V – if you power the DACs with 5V. That voltage will then be amplified by the CA3140. During this test we will only use the output from the CA3140 (Max 40 mA!) and not the power Darlington transistor yet so we can make sure that the voltage part is working properly before going on with the next step – current limit setting! This first test is really only testing to see that we get the proper amplification of the voltage from the voltage setting DAC! Therefore we will also not connect the current limiting part of the circuit – that means we will leave pin 8 (inhibit) open on the CA3140.
For this test we will need two voltages to power the DPSU – a stable 5V for the digital electronics and any voltage higher than 13V for the analog part. The 5V will (eventually) come from the 5V voltage regulator we soldered together in posting #5. So if that is easily available then use it! An even easier way to test this is to let the digital electronics be powered by the USB connection. That will probably not be as close to 5V as the proper voltage regulator – but it is ok for these tests!
Download Voltage Test Code!
As usual, click the button on the left to bring up a new window with a text only PDF.
Copy all of the code and then switch to your Arduino IDE and paste it in a new empty window.
Compile and upload to the Arduino! Ready!
(This roundabout way via a PDF is because WordPress will not allow text- or ino-files!)
Run the test code! If measured directly at the DAC output it should now be around 1.25V – or around 25% of the voltage that powers the DAC. Now adjust the trimmer for an output from CA3140 pin 6 of exactly 10.00V – that will set each step on the DAC to be 10mV. After this (simple) adjustment we should (at least theoretically) be able to output any reasonable value from 0 to 1000 and get a corresponding voltage 0-10V in 10 mV steps! Well, you should be able to go up to around 2V below your analog input voltage!
Test a few other voltages by changing the value for variable “v” in the code! Compile and upload! Measure! Expect a few mV differences to theoretically expected values. Remember that the smallest step possible is 10mV! If everything checks out then you are ready for the next test! 🙂 Otherwise I am sorry you will have to check all connections and correct the fault – and redo the test! 😦
I am happy to say that this first test went OK! 🙂 The voltage output from the DAC was correct at slightly over 1.25V and I managed easily to adjust the output voltage from the CA3140 pin 6 to 10.0V. Not a very complicated test but necessary non the less! The whole analog part of the PSU depends on this!
Now on to the next test!
Current Indicating Voltage Test
After testing the voltage output from the CA3140 we want to test that voltage from the LT6105 corresponds to the current! To do that we need to add the 0.1 ohm current sense resistor to the circuit and naturally the LT6105. Also we will need some sort of load over the output like a low ohm resistor, lamp or a few LEDs – or we could just connect our multimeter over the output “terminals”. I did that and managed immediately to blow my fuse! 😦 Better to connect a 10 ohm resistor as load!
We will not connect these parts together with the CA3140 yet! Instead we will let the current be supplied from our lab power supply! Doing it like this we can test and see that it gives the correct “current indicating” voltage output while minimizing the risk of damaging anything!. The output of the LT6105 should output a voltage that is around 12 times the voltage across the 0.1 ohm current sense resistor and it should be related to GND. If we let our extra lab PSU supply 100mA – we should have around 12mV.
This test was also OK! 🙂 Setting my old lab PSU for 100mA I got a voltage across the 10 ohm load resistor that is around 1V. Across the current sense resistor (0.1 ohm) I got around 10 mV. Just according to the calculations! Again an extremely simple test! 🙂 Measuring on the output (pin 5) of the LT6140 I get 125mV after adjustments. Remember that I have designed this for a maximum of 4A output and that 4A equals 400mV sense voltage, 5V from the LT6105 balanced against 5V from the DAC.
This is also what we expect! 🙂
Now on to the next test!
Current Limiting Mechanism Test
Then we can test the workings of the LM358 combined with the DAC that sets the current limit and the voltage from the LT6105 and see that it acts correctly as the current exceeds the set value. But note here that we have not yet started to use the pin 8 – meaning that we are just testing the mechanism for current limiting but we are not actually – yet – limiting the current! The LM358 should go high when we exceed the set current and kept low otherwise! NOTE: As we use the current from the old lab PSU we can set it to any value – as long as the load resistor will not get too hot! I settled for a target of 100mA. Hold on! Set it for a low value to start with! Like 1-5 mA!
Here we use the same software as with the Voltage Setting Test above – but we change the DAC_ADDR to 0x61 (for the current setting) and “v” to 100 – in this case meaning 100mA. Compile and upload and measure the voltage output from the DAC. It should be around 125mV. Then connect the voltmeter at the output of LM358. It should show a low voltage slightly (10-40mV) above the GND. Now increase the current on the lab PSU. At around 100mA the LM358 output should swing over to a high voltage instead – a few volts. Try setting the current at 100mA and use the trimmer to make it swing from low to high and vice versa! Adjust it for a midpoint. There is no idea to trim this output properly – but we can at least have a try to see that everything works!
Again the test worked as it should! 🙂 But the fact that there is a conversion factor of around 12 made me jump to the wrong conclusion first! It was possible to adjust it for the correct result! The trimmers has sufficient reach. This swinging between low and high of the LM358 is planned to be used together with the inhibit pin (8) on the CA3140 for current limiting. Now we know we have the potential to get it to work! How well is yet not known! But soon… 😉
Adding POWER to the test
Now there is no way to avoid testing the full PSU – including the power transistor! But I will start with low currents and work my way up! I will not be using the current limit through pin 8 (strobe/inhibit) of the CA3140 yet! For me doing these tests – testing also the design not just the build – I will use my other lab power supply with current limiting set low – to start with! 😉
Yes! 🙂 This test also went OK! The added Darlington Power Transistor gave exactly the same voltage as the voltage directly from the CA3140! So far all the tests have worked well! Now is the time for testing if the current limiting through pin 8 of the CA3140 will work! Scary…!
Current Limiting Test
The ability to limit the current to a pre-set value is crucial to our lab PSU! We have above seen that the mechanism with the LT6105 – the current sense amplifier – worked well with the LM358. It made it react when the current was exceeding the set limit! But now it is time to connect the LM358 output to the strobe/inhibit pin (8) of the CA3140!
I am sorry to say that it did not work as intended! 😦 This has been a uncertain point in the design as I could find very little information in the data sheets! Searching for this on the internet also did not give much info on how this pin really works! The Intersil data sheet stipulates that: “Terminal 8 is also used to strobe the output stage into quiescence. When terminal 8 is tied to the negative supply rail (Terminal 4) by mechanical or electrical means, the output Terminal 6 swings low, i.e., approximately to Terminal 4 potential.” This led me (incorrectly) to assume that is was controlled by the potential (voltage) at pin 8. Proof for this was also seen (I thought) at an application example where a zener diode connected to the strobe pin could limit the voltage at the CA3140 output to the zener voltage minus two base-to-emitter voltage drops!
Well, how do I think that the CA3140 strobe pin actually works? I think that it works as a sink! If it has a potential that is lower than the output voltage it will limit the output voltage to that level as said about the zener above! The problem with my design was that when the LM358 swung high it swung to near the full input voltage – and affected the output voltage of the CA3140! This was NOT what I wanted! I did NOT suspect that the strobe pin would affect the output voltage if it was fed with a higher voltage – just that a lower voltage would eventually – if it was low enough pull the output low (ground)! If I had looked more closely at the inner design of the CA3140 I could possibly have seen this! But I am much better as using op-amps than I am at understanding exactly how they work! I need a description of the features so I can use them…!
UPDATE 2: Some of you might wonder why there has been no new posts in this series?
The reason is that I have had unforeseen problems of oscillation when I connected the current limiting circuits. I have now at last found the culprit and will continue with the postings! 🙂
Well, the blame for this is on me anyhow and I have redesigned that part of the circuit and will now try that new design! Not much changed but I swapped the inputs and added a MOSFET transistor to pull the strobe down toward ground.
YES! I have now retested the current limiting with the second new design and it has finally passed! 🙂 But this was a hard obstacle to overcome. My first redesign was using the strobe/inhibit pin 8 pulling it to ground with a MOSFET but this did not give a good enough response. It was not linear enough and also I had problems with oscillations. In my second redesign I just moved the MOSFET to the non-inverting input of the CA3140. Shorting out the voltage from the DAC – and limiting the output voltage in this way. This worked better and showed a good response when current limiting was activated! I am still confused and slightly irritated that I could not get the elegant pin 8 solution to work! It was like made for an application like this!
If any of you reading this has an explanation to why I could not get pin 8 of CA3140 to work properly – pleeeaase let me know!
As I write this as I go along building the Arduino Digital PSU lucky all of you that can read about my failure! Later when I have found the correct/best design I will probably rewrite some of these posts – as then this detour will not be of much use I guess!? I will also go back and add the final Eagle Schematic – making it much easier to follow along and understand what I am talking about! 😉
Finally time to go on with the next post…
See you soon! 🙂