Control DC motor on/off with Hall Effect Sensor counts

Hi, have you tried slowing the motor down and seeing if the accuracy improves?
Slow down I mean by a factor of 5 or 10 so you can see what is happening.
It looks like you are tracking the sun with an algorithm, rather than track the sun using light sensors.
I understand you may need that speed and gear reduction to get torque, but for problem solving reduce the speed and see what your counts are.
If you are not quadrature encoding why two sensors on the shaft, only one on the motor shaft speed should be enough.
Also a circuit diagram would be nice and a picture of your project, the diagram can even be a hand drawn photographed effort.
Hope it helps.. Tom..... :slight_smile: