ursa. dude. Another vet.

This post is kinda deja vu. More like
deja deja vu. lol.
As you may or may not remember, I am a huge lightning photography geek, and have been a bolt hunter for ~4
0 years.
(sheesh who is that old person?)I love MD, and fudgey's script is very useful, but not for what you want to use it for. If you go through the archives, you will find me saying it is useful back in the day, but nowadays I know better. It was hubris; I really really wanted CHDK MD to be the driving force of my lightning shots. I mean, how cool is that?!
But reality is not poetic nor passionate. It's just fact. And the fact is, you will very rarely catch lightning bolts with MD on CHDK. Just do it like we've always done, back when we had to pay for developing dozens of rolls of film with no lightning on them.
Here's the deal. Lightning "fires" in pulses. There is a pre-flash, then the main bolt, then depending on the potential of that cloud, the resistance of air, the pollution, rain, humidity, pressure, blah blah blah.... additional pulses. The timing from the pre-flash to the main bolt is ~30ms. And CHDK capable cameras simply cannot detect and react in that time. Consider yourself lucky if your camera can reliably do 130ms.
So what are we catching when using MDFB? Either catching those bolts that have huge potential and pulse 5+ times, that it's still discharging and ionizing the air when the shutter trips, or more likely, it's luck - a different bolt (that is done and gone) triggered the detection and another bolt just happens to be discharging when the shutter fires.
So Instead?
Set camera for base ISO all NR disabled (that you can anyway), maybe shoot a new badpixel, set aperture to sharpest and focus to manual @ hyperfocal point, and try for an exposure that's 2 - 10 secs depending on frequency of strikes. Then turn the intervalometer loose. Shoot til the battery dies or the storm ends. If it's pitch black you can shoot much longer, but you will get multiple strikes/flashes and it can cause the foreground to look surreal with multisource lighting... it can be a cool effect, but make sure you want it.
ProTip: Don't delete those shots that don't have lightning in them, you can imagestack these to make a near-noiseless scene, looking like it was shot with a much bigger/better sensor.
If you like daytime lightning shots, I highly recommend a variable ND filter. You can use regular ND8s and such, but because during a storm the lighting conditions can change so fast, +/- many stops, having to unscrew or add another filter vs. just adjusting rotation with a fingertip...
DIY is fun. I would tell you to grab a pair of Real3D glasses next movie you go see ("Finding Dory" is a Real3D release here)... you can re-purpose the lenses into a DIY holder for the 510. Real3D lenses are circularly polarized and of not-too-shabby sharpness. There will be degredation, but it's not severe. Google is your friend here, many DIY sites will cover this including ideas of what to make the holders out of (I like pill bottle tops, they are knurled and incredibly uniform... another option is to mount a proper filter-sized tube to your 510, so that you can thread actual photography filters on; again, Google, lots of options.
I really wish I could tell you MD is the way to go for lightning, but it's not. I have done some really cool artistic things, and once I showed a presentation to an NYPD surveillance team how to monitor people entering/exiting a store (but not just passing by) 1500m away, wearing only pink shirts, with a ~$300 20x superzoom Canon w/CHDK & fudgey's MDFB.
(they were spending $$$$ on some schyster's proprietary stuff, but ultimately I think they went with a different facial recognition spy setup - made by? Canon!Good luck at the doctor!