I did not write this, it is copied from the old online notepad page the download link for froyo was on:
*TO CALIBRATE BATTERY*
Battery recalibration :
1 If you're experiencing higher than normal battery drain, try the following: Charge the phone to full battery; let it keep charging until the battery says it is fully charged. Do not wait until the light is green, it isn't always fully charged, causing a lot of inaccuracies.
(You can check by going to: Settings -> About Phone -> Status -> Battery Level = Full.)
2 Boot to recovery mode and wipe battery stats in recovery
3 Immediately reboot, and once you have access to the launcher, unplug the phone.
4 Do not charge the phone until after draining the battery completely, resulting in it automatically shutting off.
5 Recharge and use your phone as normal.
(FROM:
CyanogenMod Wiki)