Further work on Z probing.  One problem was working with a white-painted bed.  Replacing that with ordinary Kapton-covered glass seems to work better.  And that has allowed the debugging of the code.  But the probe still does not always see the bed.