Test Controller, user scripts

xxx

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
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"