Tuesday, 3 May 2016

Adafruit DC and Stepper Motor HAT is not much good at steppers really

Well I have setup my Adafruit DC and Stepper Motor HAT, and it does drive the stepper motors, but has....   certain limitations!

This is all down to the HAT doing everything over I2C, and because the HAT requires a prod for each step (including each individual sub step in micro step mode), this limits the step rate to how fast the commands can be poked down the (not very fast) I2C bus.

The max rate is around 75 - 80 commands per second - so with 2 motors to move I can only do around 40 per second. Any attempt to go faster just blocks in the Adafruit library calls to prod the motor. The CPU utilisation though remains low, so that part at least is sensible.

However tracking stars and autoguiding should be fine with this rate (sidereal tracking needs just under 10 per second), so I shall carry on with some software and also prepare to go for Pololu A4988, set up to drive the stepping direct from GPIO pins.

In the meantime I intend to use lin_guider to track a star and report deviation over UDP, I shall write a program to pick up the deviation and directly drive the steppers through a full PID implementation. I have a PID controller I wrote earlier which I can use for this, the only hiccup at the moment is that the Adafruit software only appears to be available or Python 2 *sigh*.