Short-bus / pilomar

RaspberryPi based miniature observatory
https://shortbus.blog/
GNU General Public License v3.0
63 stars 14 forks source link

microcontroller does not say it's off target during large moves. #19

Closed Short-bus closed 9 months ago

Short-bus commented 1 year ago

Noticed that the camera keeps taking photographs even while the telescope is resetting from 360azimuth to 0azimuth if the target passes North. Checked code.py and noticed that it only performs CheckOnTarget() when the move is complete. The MoveMotor() method sends status messages during large moves, but does not call CheckOnTarget() until the move is over. MoveMotor() should probably call CheckOnTarget() during large moves before sending the motor status message.

Short-bus commented 1 year ago

Most critical issue here is that the drift tracking could get messed up if it triggers during an azimuth reset, otherwise it's just risking taking a few images that will be rejected by the stacker which is relatively minor.

Short-bus commented 11 months ago

EDITED: Corrected after investigation. Issue 20 had a related case. Currently if the communication with the motorcontroller fails then the motorcontroller continues with the latest trajectory until it expires. If the RPi crashes for example but leaves the microcontroller power on, the trajectory does not get updated or cancelld. The motor will continue to follow the trajectory until expiry, but the RPi may not be listening to the position updates. When the RPi restarts, it may have an out of date position for the camera. When fixing the OnTarget issue, also consider to limit how long the last known good trajectory will be used for. After a few minutes it's safer to consider the target lost. Also when restarting the RPi software, the program should warn that the previous observation did not complete properly.

Short-bus commented 11 months ago

Will test a feature where the trajectory is cleared by the microcontroller if it has not received any messages from the RPi for a set time period. This will limit the 'unrecorded' movement of the telescope in the even that the RPi or comms fail.

Short-bus commented 9 months ago

New version of code.py on microcontroller addresses two issues. 1) After 2 minutes silence from the RPi, the microcontroller will clear the trajectory for safety. This means that the telescope can only continue moving for 2 minutes after comms is lost, that should keep it within range so that it can self-recover via the drift tracking mechanism when resumed. 2) At the start of any MOVE instruction, the OnTarget flag is set to False if the move is large (100+ steps). This will get reported back to the RPi and will pause image capture. When the move is complete the microcontroller refreshes the OnTarget flag which will then resume image capture.

Short-bus commented 9 months ago

Summer2023 update includes this feature.