Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**V1.13.16 - Updates**
- Throttled InfoDisplay updates. Turned off on two axis slew, limited to 5Hz on one-axis slew.
- Guide pulses are now ignored for DEC as well when at the limits.

**V1.13.15 - Updates**
- Check `INFO_DISPLAY_TYPE` builds in CI
- Fix `INFO_DISPLAY_TYPE_I2C_SSD1306_128x64` for esp32 builds
Expand Down
2 changes: 1 addition & 1 deletion ConfigurationValidation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@
#endif
#endif

// For OAT, we must have DEC limits defined, otherwise free slew does nto work.
// For OAT, we must have DEC limits defined, otherwise free slew does not work.
#ifndef OAM
#ifndef DEC_LIMIT_UP
#error "You must set DEC_LIMIT_UP to the number of degrees that your OAT can move upwards from the home position."
Expand Down
2 changes: 1 addition & 1 deletion Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// Also, numbers are interpreted as simple numbers. _ __ _
// So 1.8 is actually 1.08, meaning that 1.12 is a later version than 1.8. \_(..)_/

#define VERSION "V1.13.15"
#define VERSION "V1.13.16"
70 changes: 47 additions & 23 deletions src/Mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Mount::Mount(LcdMenu *lcdMenu)
{
_commandReceived = 0;
#if (INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE)
_loops = 0;
_lastInfoUpdate = millis();
#endif
_lcdMenu = lcdMenu;
initializeVariables();
Expand Down Expand Up @@ -1649,23 +1649,46 @@ void Mount::guidePulse(byte direction, int duration)
switch (direction)
{
case NORTH:
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed);
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
"[GUIDE]: guidePulse: DEC guide speed : %f",
DEC_PULSE_MULTIPLIER * decGuidingSpeed);
_stepperGUIDE->setSpeed(DEC_PULSE_MULTIPLIER * decGuidingSpeed);
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC;
_guideDecEndTime = millis() + duration;
// If a upper limit is set, check we're not there. If we are, refuse the guide pulse.
if (_decUpperLimit != 0 && _stepperDEC->currentPosition() >= _decUpperLimit)
{
// TODO: Make sure Southern hemisphere does not need a sign/direction inversion.
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
"[GUIDE]: guidePulse: DEC is at (%l) which is at or above upper limit (%l), ignoring guide pulse",
_stepperDEC->currentPosition(),
_decUpperLimit);
}
else
{
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed);
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
"[GUIDE]: guidePulse: DEC guide speed : %f",
DEC_PULSE_MULTIPLIER * decGuidingSpeed);
_stepperGUIDE->setSpeed(DEC_PULSE_MULTIPLIER * decGuidingSpeed);
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC;
_guideDecEndTime = millis() + duration;
}
break;

case SOUTH:
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed);
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
"[GUIDE]: guidePulse: DEC guide speed : %f",
-DEC_PULSE_MULTIPLIER * decGuidingSpeed);
_stepperGUIDE->setSpeed(-DEC_PULSE_MULTIPLIER * decGuidingSpeed);
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC;
_guideDecEndTime = millis() + duration;
if (_decLowerLimit != 0 && _stepperDEC->currentPosition() <= _decLowerLimit)
{
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
"[GUIDE]: guidePulse: DEC is at (%l) which is at or below lower limit (%l), ignoring guide pulse",
_stepperDEC->currentPosition(),
_decLowerLimit);
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC is at lower limit, ignoring guide pulse");
}
else
{
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed);
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
"[GUIDE]: guidePulse: DEC guide speed : %f",
-DEC_PULSE_MULTIPLIER * decGuidingSpeed);
_stepperGUIDE->setSpeed(-DEC_PULSE_MULTIPLIER * decGuidingSpeed);
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC;
_guideDecEndTime = millis() + duration;
}
break;

case WEST:
Expand Down Expand Up @@ -3226,20 +3249,20 @@ void Mount::updateInfoDisplay()
{
#if (INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE)
// If we update this display too often while slewing, the serial port is unable to process commands fast enough. Which makes the driver
// timeout, causing ASCOM errors.
// timeout, causing ASCOM errors.
// We will update at 30Hz when idle, 5Hz when slewing one axis and skip updates when slewing both.
int refreshRateHz = 30;
long now = millis();
if ((slewStatus() & (SLEWING_DEC | SLEWING_RA)) == (SLEWING_DEC | SLEWING_RA))
int refreshRateHz = 30;
const bool isSlewingRAandDEC = (slewStatus() & (SLEWING_DEC | SLEWING_RA)) == (SLEWING_DEC | SLEWING_RA);
if (isSlewingRAandDEC)
{
return;
return; // Do not update the display
}

if (isSlewingRAorDEC())
else if (isSlewingRAorDEC())
{
refreshRateHz = 5;
refreshRateHz = 5; // Update the display slower
}

const long now = millis();
if (now - _lastInfoUpdate > (1000 / refreshRateHz))
{
LOG(DEBUG_DISPLAY, "[DISPLAY]: Render state to OLED ...");
Expand Down Expand Up @@ -3281,6 +3304,7 @@ bool Mount::isBootComplete()
//
// setDecLimitPosition
//
// If limitAngle is 0, no offset is given, so the current position is used.
/////////////////////////////////
void Mount::setDecLimitPosition(bool upper, float limitAngle)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Mount.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ class Mount
void setupInfoDisplay();
void updateInfoDisplay();
InfoDisplayRender *getInfoDisplay();
long _loops;
long _lastInfoUpdate;
#endif

// Called by Meade processor every time a command is received.
Expand Down