Test Controller, user scripts

TestController support scripting and anybody can make scripts. If I see scripts that may be interesting for other people I may add them to this page.



Contents
    Battery test with DL24/PX100 loads by Pukker
    Battery test by Pukker
    Power supply load sweep by Pukker
Main page



Battery test with DL24/PX100 loads by Pukker

For the owners of the DL24 or PX100 I like to share my own script for Battery discharge test with Atorch DL24 and PX100.

Added some functions for eliminating Drop-out failures. Seems to work OK.
Tested for hours and no problems.

Added option to reset the load before starting discharge. (I always forgot)
Added option to set specified max. time for discharging. After this time discharge stops anyway.
Setting now in Seconds, maybe better in minutes, don't know yet.
For result see the pictures.

Added function which set end voltage of the load 0.05 Volt lower than the end voltage
for Testcontroller, so Testcontroller has control and the load end voltage is for failsafe.

Attached my discharge script.

Note: I have not much programming experience, so code may not look good.

Discharge%20Popup

Configuration popup that will be shown when the script is started.

Discharge%20result

Output to log window.

Code:
#scriptMenu Discharge
#logcmds 0
="Battery discharging with DL24 / PX100"
=var endVoltage=0
=var testCurrent=1
=var endVoltageLoad = endVoltage-0.05
=var stepTime=1
=var Voltage
=var startCurrent
=var stopByLoad=2
=var addCapacity=1;
=var addEnergy=1;
=var reset=1
=var Timelimit=0
=var timelimit=72000
=var Timecheck=0
=var load=getDevice("Load")
="Loaddevice = " + load
=setOn(load,0);
=setCurrent(load,testCurrent)
; --------------------------------------------------------------
#popupInit "Battery discharge DL24 / PX100"
#popupNumber "Minimum voltage" endVoltage 0.5 60 "The fully discharged voltage for the battery"
#popupNumber "Discharge current" testCurrent 0.1 5 "Current used for discharge"
#popupNumber "Max. Discharge time" Timelimit 0 72000 "Max. Discharge time in Seconds"
#popupCheckbox "Add calculated capacity (Ah)" addCapacity "Add Math.Capacity expression"
#popupCheckbox "Add calculated energy (Wh)" addEnergy "Add Math.Energy expression"
#popupCheckbox "Time limited discharge" Timecheck "Activate Time limit"
#popupCheckbox "Reset Load" reset "Reset Load before start"
#popupButtons Start ok Abort
#popupShow
; --------------------------------------------------------------

#if !ok
="Test aborted"
#return
#endif

#math
#if addCapacity
#math Capacity Ah SumTimeHour 0 (nameCurrent(load))
#endif

#if addEnergy
#math Energy Wh SumTimeHour 0 (nameCurrent(load)+"*"+nameVoltage(load))
#endif

#if Timecheck
=timelimit=Timelimit
="Max. Discharge time = " +Timelimit + " Seconds"
#endif

#if reset
(load):reset
#endif
#delay 1
=endVoltageLoad=(endVoltage-0.05)
#delay 0.5
=setCurrent(load,testCurrent)
#delay 0.5

="Discharge with "+testCurrent+"A to "+endVoltage+"V";
=setVoltage(load,endVoltageLoad)
#delay 0.5
=setCurrent(load,testCurrent)
#delay 0.5
#delay 0.5
=setOn(load,1);
#delay 0.5
#log (stepTime)
#ChartCurves  (load+".Voltage")  (load+".Current)  (load+".Temperature) RD6012.Voltage RD6012.Current
#haslogged
#haslogged
="Start Voltage = "+tableCalcMax((load+".Voltage"),tableRows()-2)+" Volt"
="Discharge Current = "+tableCalcMax((load+".Current"),tableRows()-2)+" Ampere"
=startCurrent=tableCalcMax((load+".Current"),tableRows()-2)
#haslogged
#haslogged
#haslogged
#haslogged
#if Timecheck then {
#wait (tableCalcMax((load+".Voltage"),tableRows()-6)>endVoltage) and (tableCalcMax((load+".Current"),tableRows()-6)>(0.5*testCurrent)) and timeendVoltage) and (tableCalcMax((load+".Current"),tableRows()-6)>(0.5*testCurrent))
}
#endif
=setOn(load,0);
#log 0
#if (tableCalcMax((load+".Current"),tableRows()-6)<(0.5*testCurrent)) then {
=stopByLoad=1
}
#endif

#log 0

#if startCurrent<0.1 then
="Discharge not started, Input Voltage to low"
#else
#endif

#if stopByLoad<2 then {
="Discharge stopped by Load"
}
#endif

#if stopByLoad>1 then {
="Discharge stopped by TestController"
}
#endif
="End Voltage = "+tableCalcMax((load+".Voltage"),tableRows()-3)+" Volt";
="Discharged with Current = "+testCurrent+" Ampere"
="Capacity = "+(tableCalcMax((load+".Capacity"),tableRows()-2))+"Ah"
="Energy = "+(tableCalcMax((load+".Energy"),tableRows()-2))+"Wh"

To add script to log popup menu it must be stored in ..\Documents\TestController\ScriptLibrary and named something ending in "Script.txt"


Battery test by Pukker

Graph

Menu

I made some modifications to my Battery Test Script.
Removed dropout checks and calculation since my load (DL24P)
has no more dropouts since HKJ improved this in Testcontroller (Thanks HKJ)

Added some options which I liked to have.
So you can check if there is no overload for the load.
See menu.jpg for info.

I also made an version with checking the internal resistance of the battery.
Best is to use an 4-wire connection when your load supports this.
Tested also with an 0.44 ohm resistor in series and it works great.
In Result.jpg you can see how it look.
(BTW used an powersupply and 0.44 ohm resistor in series to test)

Results are dependent on accuracy of the load of coarse,
but Internal Resistance has to do with relative measurement values,
so they should be fairly accurate.

Graph.jpg is an picture made with settings 12V minimum, capacity 2200mAh
and discharge current 1A. Battery simulated by Powersupply with 0.44 ohm
in series. Starting 10 seconds with 0.2C current, 1 second at 1C current.
At this point Internal Resistance is determined.
then further discharge with 1A current.
After shutdown voltage rises a little, is the result of the series resistor.

Internal resistance testing is done by the following rules by IED61960.

According to IEC61960, the DC resistance can be measured as follows:
A DC current step is applied to measure the change in the cellís voltage.
Battery resistance is defined as the change in voltage over the change
in current when a discharge current of 0.2C is applied for 10s
followed by a discharge current of 1C for 1s.
The DCIR is calculated byformula DCR = (V1-V2)/(I2-I1)

where V1 and I1 are the voltage and current values after the 10s 0.2C discharge just before the current step;
V2 and I2 are the voltage and current values after the 1s 1C discharge.

Rules I have found on https://www.landtinst.com/what-is-internal-resistance-ir-and-how-to-test-ir/

Result log:
Result

Download of the two scripts: https://lygte-info.dk/pic/Projects/TestController/UserScripts1/BattTest/BattTest.zip


Power supply load sweep by Pukker

PowerSupply%20Test

Powersupply%20Test%20Int%20Res

PowerTestBurnIn

Menu Setup%20with%20res PowerSupplyTestBurnIn

Made an new script for testing Power Supplies with an Electronic Load.
Start with giving up the parameters off the supply and starting from Zero current
to maximum current in number of steps you want.
Stops when the supply is overloaded.

Updated my Powersupply test.
Can be used for checking internal and serial resistance.
External cable and connector resistance can so be checked.
Four wire connecting with the load is preferred.
In the graph you can see internal resistance check (left) is done.
Internal Resistance check is done with 10% and 80% of the maximum current.

Added burn-in test:
PowerSupply Test script with making BurnIn test after testing Voltage and Current depedence.
Test can be started with an Internal Resistance check.
See the graph.
First Internal resistance check.
Then Voltage - Current test.
Then BurnIn test.
In Result in Command Window.txt the results in Testcontroller Command Window.

Result log:
Command

Download of the scripts: https://lygte-info.dk/pic/Projects/TestController/UserScripts1/PSTest/Power%20Supply%20Test.zip