Hi,
I found lots of intersting thing with dark frame modes. Currently we have a great working set_raw_nr function. I always use this function for my extra long exposured images. I shot all normal images without dark frame substraction. For short daylight exposure, dark frame not requied, for long exposure one dark frame useful. For extra long exposure mode, lots of dark frame required. Currently no mode for record only dark frames. My method on a590is is simple hardware mod, i use tube ring and fake filter (opaque). On sx110 this method not working. No tube ring for this camera. For example, paper black box not good enough, the internal light too bright (camera LED, for example).
I found this topic on record dark frames, control with mechanical shutter from lua script. I don't know how to adopt for my camera. If i understand properly, this script switch a shooted double image to one normal and one dark frame pictures separate. This is almost what i am looking for but the idea would be shot many normal image, and after shoot many dark frames. This is a common method on astro photography. The night is sort, time is expensive.

The dark frames record at dawn. The CCD sensor temperature is important, different normal and dark frame CCD temperature not good. This is one thing why it's not good to use very old dark frames.
the original idea, and sample lua code:
http://chdk.setepontos.com/index.php?topic=5822.0very interesting topic, a540 camera record a normal and dark frame separate
http://chdk.setepontos.com/index.php?topic=1998.msg18450#msg18450I attached my lua script to automatize the process, of course without dark frame mod. This is an example, lots of things not developed yet. For example, focus set to infinity, CCD temperature logging, etc...
I don't know chdk work in detail, I learn with every new problem. And I've got lots of help from expert developers and users.