Skip to content

Commit 2f26ee8

Browse files
V1.13.16 Updates (#264)
Co-authored-by: Julianne Swinoga <julianneswinoga@gmail.com>
1 parent 4337b96 commit 2f26ee8

File tree

5 files changed

+54
-26
lines changed

5 files changed

+54
-26
lines changed

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
**V1.13.16 - Updates**
2+
- Throttled InfoDisplay updates. Turned off on two axis slew, limited to 5Hz on one-axis slew.
3+
- Guide pulses are now ignored for DEC as well when at the limits.
4+
15
**V1.13.15 - Updates**
26
- Check `INFO_DISPLAY_TYPE` builds in CI
37
- Fix `INFO_DISPLAY_TYPE_I2C_SSD1306_128x64` for esp32 builds

ConfigurationValidation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@
449449
#endif
450450
#endif
451451

452-
// For OAT, we must have DEC limits defined, otherwise free slew does nto work.
452+
// For OAT, we must have DEC limits defined, otherwise free slew does not work.
453453
#ifndef OAM
454454
#ifndef DEC_LIMIT_UP
455455
#error "You must set DEC_LIMIT_UP to the number of degrees that your OAT can move upwards from the home position."

Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
// Also, numbers are interpreted as simple numbers. _ __ _
44
// So 1.8 is actually 1.08, meaning that 1.12 is a later version than 1.8. \_(..)_/
55

6-
#define VERSION "V1.13.15"
6+
#define VERSION "V1.13.16"

src/Mount.cpp

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Mount::Mount(LcdMenu *lcdMenu)
7979
{
8080
_commandReceived = 0;
8181
#if (INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE)
82-
_loops = 0;
82+
_lastInfoUpdate = millis();
8383
#endif
8484
_lcdMenu = lcdMenu;
8585
initializeVariables();
@@ -1649,23 +1649,46 @@ void Mount::guidePulse(byte direction, int duration)
16491649
switch (direction)
16501650
{
16511651
case NORTH:
1652-
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed);
1653-
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
1654-
"[GUIDE]: guidePulse: DEC guide speed : %f",
1655-
DEC_PULSE_MULTIPLIER * decGuidingSpeed);
1656-
_stepperGUIDE->setSpeed(DEC_PULSE_MULTIPLIER * decGuidingSpeed);
1657-
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC;
1658-
_guideDecEndTime = millis() + duration;
1652+
// If a upper limit is set, check we're not there. If we are, refuse the guide pulse.
1653+
if (_decUpperLimit != 0 && _stepperDEC->currentPosition() >= _decUpperLimit)
1654+
{
1655+
// TODO: Make sure Southern hemisphere does not need a sign/direction inversion.
1656+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
1657+
"[GUIDE]: guidePulse: DEC is at (%l) which is at or above upper limit (%l), ignoring guide pulse",
1658+
_stepperDEC->currentPosition(),
1659+
_decUpperLimit);
1660+
}
1661+
else
1662+
{
1663+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed);
1664+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
1665+
"[GUIDE]: guidePulse: DEC guide speed : %f",
1666+
DEC_PULSE_MULTIPLIER * decGuidingSpeed);
1667+
_stepperGUIDE->setSpeed(DEC_PULSE_MULTIPLIER * decGuidingSpeed);
1668+
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC;
1669+
_guideDecEndTime = millis() + duration;
1670+
}
16591671
break;
16601672

16611673
case SOUTH:
1662-
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed);
1663-
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
1664-
"[GUIDE]: guidePulse: DEC guide speed : %f",
1665-
-DEC_PULSE_MULTIPLIER * decGuidingSpeed);
1666-
_stepperGUIDE->setSpeed(-DEC_PULSE_MULTIPLIER * decGuidingSpeed);
1667-
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC;
1668-
_guideDecEndTime = millis() + duration;
1674+
if (_decLowerLimit != 0 && _stepperDEC->currentPosition() <= _decLowerLimit)
1675+
{
1676+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
1677+
"[GUIDE]: guidePulse: DEC is at (%l) which is at or below lower limit (%l), ignoring guide pulse",
1678+
_stepperDEC->currentPosition(),
1679+
_decLowerLimit);
1680+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC is at lower limit, ignoring guide pulse");
1681+
}
1682+
else
1683+
{
1684+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed);
1685+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
1686+
"[GUIDE]: guidePulse: DEC guide speed : %f",
1687+
-DEC_PULSE_MULTIPLIER * decGuidingSpeed);
1688+
_stepperGUIDE->setSpeed(-DEC_PULSE_MULTIPLIER * decGuidingSpeed);
1689+
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC;
1690+
_guideDecEndTime = millis() + duration;
1691+
}
16691692
break;
16701693

16711694
case WEST:
@@ -3226,20 +3249,20 @@ void Mount::updateInfoDisplay()
32263249
{
32273250
#if (INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE)
32283251
// If we update this display too often while slewing, the serial port is unable to process commands fast enough. Which makes the driver
3229-
// timeout, causing ASCOM errors.
3252+
// timeout, causing ASCOM errors.
32303253
// We will update at 30Hz when idle, 5Hz when slewing one axis and skip updates when slewing both.
3231-
int refreshRateHz = 30;
3232-
long now = millis();
3233-
if ((slewStatus() & (SLEWING_DEC | SLEWING_RA)) == (SLEWING_DEC | SLEWING_RA))
3254+
int refreshRateHz = 30;
3255+
const bool isSlewingRAandDEC = (slewStatus() & (SLEWING_DEC | SLEWING_RA)) == (SLEWING_DEC | SLEWING_RA);
3256+
if (isSlewingRAandDEC)
32343257
{
3235-
return;
3258+
return; // Do not update the display
32363259
}
3237-
3238-
if (isSlewingRAorDEC())
3260+
else if (isSlewingRAorDEC())
32393261
{
3240-
refreshRateHz = 5;
3262+
refreshRateHz = 5; // Update the display slower
32413263
}
32423264

3265+
const long now = millis();
32433266
if (now - _lastInfoUpdate > (1000 / refreshRateHz))
32443267
{
32453268
LOG(DEBUG_DISPLAY, "[DISPLAY]: Render state to OLED ...");
@@ -3281,6 +3304,7 @@ bool Mount::isBootComplete()
32813304
//
32823305
// setDecLimitPosition
32833306
//
3307+
// If limitAngle is 0, no offset is given, so the current position is used.
32843308
/////////////////////////////////
32853309
void Mount::setDecLimitPosition(bool upper, float limitAngle)
32863310
{

src/Mount.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class Mount
403403
void setupInfoDisplay();
404404
void updateInfoDisplay();
405405
InfoDisplayRender *getInfoDisplay();
406-
long _loops;
406+
long _lastInfoUpdate;
407407
#endif
408408

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

0 commit comments

Comments
 (0)