I put brand new Glentek drive in my 1998 FADAL VMC15XT. Spindle runs fine no issues. I do an M19 and the spindle will go towards the notch in the pulley but then starts hunting going CW CCW looking for the signal from the magnet for the orientation sensor. I checked the sensor and the magnet is strong and the sensor is at the correct distance from the magnet. I found the battery on the CPU board was dead replaced it, zeroed the memory and reinput the parameters. Shut machine off restarted it and did an M19 and it worked like it should. I turned machine off restarted it did M19 and the Spindle started to hunt for the sensor again. Why is the M19 working sometimes but not all the time? I checked all wiring and have continuity for the sensor and spindle. Seems when I CS the machine at start up and then go to SETP look at the screen then hit jog key, jog XYZ axis then HO and then M19 will work right. I am very confused of why this is happening.

Any ideas on why this is happening?

Thanks,
Jeff