Hi all,
I just photographed a wedding yesterday with my new K20D and the AF-540FGZ flash. Afterward, the flash was stuck. I knew that the locking pin was likely the problem, and remembered reading some of these posts while I was looking into this system. So, here's what I did this morning...
FIRST, this is one of those "try this at your own risk" explanations!
Second, I have a set of very small jeweler's screwdrivers (available at the hardware store), and I used the smallest phillips-head screwdriver to remove the base of the flash from the rest of the body. You'll have to turn the flash upside-down to be able to see these four tiny screws, and then you'll have to carefully work around the body of your camera to be able to get decent access. And, be careful about pushing too hard on the flash while not supporting it with your other hand or something, lest you break the flash mount off!
When you have the flash body separated from flash, you can either work with it as is or, if you're comfortable, there's a small wiring harness that connects the base to the body of the flash and you can gently separate the body from the base.
Next, identify the locking pin, which is fairly readily identifiable. If you can't figure out which one is the locking pin, then I'd suggest that you're in over your head! But, it is a silver shaft that sits in a metal stabilizing yoke, and there's also a spring that surrounds the pin. With a pair of small needle-nosed pliers, GENTLY pull up on the pin. You may then be in a position to separate the flash mount from the camera hot shoe.
If you haven't been able to gently remove the flash base, I hope that you've noticed that there's a black "arm" attached to the bottom of the locking pin as you look into the base. You can use your pliers to rotate the pin counterclockwise until the arm has been lifted over the silver metal wiring "frame" to the left of the pin, so that the locking pin assembly is permanently disabled. Either way, one way to proceed is to have this arm lodged above this frame; in this manner, the locking pin is disabled and the flash can then be mounted onto the camera's hot shoe just as most any other flash is mounted, without the locking pin, and relying on the rotating collar to "lock" the flash onto the camera. And, this is what I've done.
I did try to craft a new secondary rise pin, which lifts the arm that's attached to the pin, which lifts the locking pin, when the cam on the locking collar rotates against this rise pin. (clear as mud?) I tried to use a 6mm long piece of straight pin (nope), or a 6mm piece of a nail that has a larger diameter than the straight pin (nope). In both cases, the sharp edges of these metals catch on the cam and on the arm and move and fail to accomplish what I want - a straight, vertical rise into the arm. I did consider using a 6mm piece of toothpick, which wouldn't have the friction of the metal against the plastics, but I also knew that it would eventually wear down/out. I'm presuming that Pentax started with a plastic piece so that these friction issues were minimized. So, as I noted above, I just moved the arm out of the way and am not using this locking pin.
OK, sorry about the long, less-than-clear explanation, but I hope that this helps someone and saves you the time and cost of a costly repair of a poorly designed piece of equipment.
Good luck,
Tim!