nexdome / Firmware

NexDome Dome and Shutter Motor Kit Firmware
https://www.nexdome.com
Other
3 stars 6 forks source link

Rotator loses pointing accuracy after many small nudges #35

Closed NameOfTheDragon closed 3 years ago

NameOfTheDragon commented 3 years ago

Some users have reported a drift in azimuth over an observing session. User Christopher Duffey spent time troubleshooting this with me and showed me that the effect was real. We were able to provoke a drift of about 3 degrees in 10 minutes, using excessively high dome refresh period (~3 seonds) in TheSky X. Christopher seemed to intuitively know what was needed and made the process much easier, for which we owe him a debt of gratitude.

We tried various workarounds:

The working hypothesis is that many small nudges somehow introduce lost steps. The exact mechanism isn't clear but it might be linked to the fact that the motors are de-energized after each slew, and somehow a lost step creeps in when there is no holding torque.

Increasing the "dead zone" in the firmware to 75 steps [@DWR,75] results in tiny movements being ignored by the firmware and seems to eliminate the problem.

Therefore, we should look at the possibility of:

  1. Not de-energizing the motors after each slew, or making this a user-settable option. This may or may not solve the problem and will probably make the motor run hot, so the impact needs to be assessed.
  2. Choose a better default value for dead-zone (it appears to be 1 step, currently, although the documentation has it much higher).
  3. Consider enforcing a minimum value for dead-zone.
  4. Raise user awareness of the importance of the dead-zone.
NameOfTheDragon commented 3 years ago

Transferring issue to the firmware repository

NameOfTheDragon commented 3 years ago

Suggestion from Christopher Duffey - turn off holding torque when there is no serial connection. Seems like a good idea. As luck would have it, the Leonardo variant is about the only type of Arduino where this might just work. Worth putting in to test. In theory, this should work on Arduino Leonardo, but in practice it doesn't seem to. I suspect there was a change to the Leonardo core recently that broke some serial features, leading to the creation of the SafeSerial library used in the NexDome firmware. Regrettably, this doesn't seem to be an option.

What we've done instead is to start a countdown timer every time there is serial activity. If this timer expires, then the holding torque is released. We chose an initial value of 10 minutes, so the motor would be released 10 minutes after the driver disconnects. It is assumed that the application and driver will generate enough traffic to keep the timer alive. This should be the case because most slaving implementations send position updates at least every 1 to 2 minutes.