At the moment I get low battery warnings when i start chdk. In the code I found this:
Is there a way to find out the right values or is it just try and error?
CHDK low battery warning, Canon firmware?
You can change the CHDK battery setting to show the voltage instead of % (chdk settings->osd settings->battery), then you can let the battery run down and see how low it goes.
The values should be similar for any camera using the same type of battery, or any battery with the same chemistry and number of cells.
Note that the limits are saved in your CHDK configuration, so you will need to reset it if you change those functions (reset to defaults in the menu, or delete *.CFG from CHDK directory.
Some testing suggestions can be found in http://chdk.wikia.com/wiki/Testing