Skip to content

Commit 400a3cc

Browse files
V1.13.9 Updates (#252)
1 parent 05d2176 commit 400a3cc

File tree

7 files changed

+73
-24
lines changed

7 files changed

+73
-24
lines changed

Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
**V1.13.9 - Updates**
2+
- Added guide logging support.
3+
- Fixed some Meade documentation errors.
4+
- Adjusted DEC limits for OAM to 135 degrees.
5+
- Reverted OLED library for InfoDisplay back to forked version so it compiles correctly.
6+
17
**V1.13.8 - Updates**
28
- Fixed DEC runaway issue by updating avr-interrupt-stepper library to version 0.0.3
39

Configuration_adv.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,14 @@
233233

234234
#ifndef DEC_LIMIT_UP
235235
#ifdef OAM
236-
#define DEC_LIMIT_UP 100.0f
236+
#define DEC_LIMIT_UP 135.0f
237237
#else
238238
#define DEC_LIMIT_UP 0.0f
239239
#endif
240240
#endif
241241
#ifndef DEC_LIMIT_DOWN
242242
#ifdef OAM
243-
#define DEC_LIMIT_DOWN 100.0f
243+
#define DEC_LIMIT_DOWN 135.0f
244244
#else
245245
#define DEC_LIMIT_DOWN 0.0f
246246
#endif

Constants.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,5 @@
9292
#define DEBUG_FOCUS 0x1000 // Focuser activity
9393
#define DEBUG_COORD_CALC 0x2000 // Calculations of coordinates
9494
#define DEBUG_DISPLAY 0x4000 // Info display
95+
#define DEBUG_GUIDE 0x8000 // Guiding info
9596
#define DEBUG_ANY 0xFFFF // All debug output

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.8"
6+
#define VERSION "V1.13.9"

platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ lib_deps =
1313
arduino-libraries/LiquidCrystal @ ^1.0.7
1414
lincomatic/LiquidTWI2@^1.2.7
1515
olikraus/U8g2@^2.28.8
16-
https://github.com/ThingPulse/[email protected].1
16+
https://github.com/ClutchplateDude/[email protected].0
1717

1818
[env]
1919
extra_scripts =
@@ -95,7 +95,7 @@ debug_build_flags =
9595
lib_deps =
9696
${common.lib_deps}
9797
jdolinay/avr-debugger @ 1.2
98-
https://github.com/andre-stefanov/[email protected].3
98+
https://github.com/andre-stefanov/[email protected].4
9999

100100
[env:mksgenlv21]
101101
extends = env:ramps

src/MeadeCommandProcessor.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
500500
// "x" is the stepper to move (r for RA, d for DEC, f for FOC, z for AZ, t for ALT)
501501
// "nnnn" is the number of steps
502502
// Returns:
503-
// "1" if successfully scheduled
503+
// "1" if successfully scheduled, else "0"
504504
//
505505
// :MHRxn#
506506
// Description:
@@ -743,7 +743,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
743743
// one Hall sensor based autohoming axis is enabled.
744744
// Returns:
745745
// "rastate|decstate#" if either axis is enabled
746-
// "|" if no autohoming is enabled
746+
// "|#" if no autohoming is enabled
747747
// Remarks:
748748
// While the mount status (:GX#) is 'Homing', the command returns one of these:
749749
// MOVE_OFF
@@ -935,7 +935,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
935935
// Information:
936936
// Get the current LST of the mount.
937937
// Returns:
938-
// "HHMMSS"
938+
// "HHMMSS#"
939939
//
940940
// :XSBn#
941941
// Description:
@@ -1856,23 +1856,23 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd)
18561856
{
18571857
if (inCmd.length() > 2)
18581858
{
1859-
LOG(DEBUG_MOUNT, "[MEADE]: XGH -> %s", inCmd.c_str());
1859+
LOG(DEBUG_MEADE, "[MEADE]: XGH -> %s", inCmd.c_str());
18601860
if (inCmd[2] == 'R') // :XGHR#
18611861
{
1862-
LOG(DEBUG_MOUNT, "[MEADE]: XGHR -> %s", inCmd.c_str());
1862+
LOG(DEBUG_MEADE, "[MEADE]: XGHR -> %s", inCmd.c_str());
18631863
return String(_mount->getHomingOffset(StepperAxis::RA_STEPS)) + "#";
18641864
}
18651865
else if (inCmd[2] == 'D') // :XGHD#
18661866
{
1867-
LOG(DEBUG_MOUNT, "[MEADE]: XGHD -> %s", inCmd.c_str());
1867+
LOG(DEBUG_MEADE, "[MEADE]: XGHD -> %s", inCmd.c_str());
18681868
return String(_mount->getHomingOffset(StepperAxis::DEC_STEPS)) + "#";
18691869
}
18701870
else if (inCmd[2] == 'S') // :XGHS#
18711871
{
1872-
LOG(DEBUG_MOUNT, "[MEADE]: XGHS -> %s", inCmd.c_str());
1872+
LOG(DEBUG_MEADE, "[MEADE]: XGHS -> %s", inCmd.c_str());
18731873
return String(inNorthernHemisphere ? "N#" : "S#");
18741874
}
1875-
LOG(DEBUG_MOUNT, "[MEADE]: XGH? -> %s", inCmd.c_str());
1875+
LOG(DEBUG_MEADE, "[MEADE]: XGH? -> %s", inCmd.c_str());
18761876

18771877
return "0#";
18781878
}

src/Mount.cpp

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ void Mount::configureDECStepper(byte pin1, byte pin2, uint32_t maxSpeed, uint32_
343343
_stepperDEC->setPinsInverted(true, false, false);
344344
_stepperGUIDE->setPinsInverted(true, false, false);
345345
#endif
346+
_stepperGUIDE->setCurrentPosition(0);
346347
}
347348

348349
/////////////////////////////////
@@ -1540,14 +1541,17 @@ void Mount::stopGuiding(bool ra, bool dec)
15401541
// Stop RA guide first, since it's just a speed change back to tracking speed
15411542
if (ra && (_mountStatus & STATUS_GUIDE_PULSE_RA))
15421543
{
1543-
LOG(DEBUG_STEPPERS, "[STEPPERS]: stopGuiding(RA): TRK.setSpeed(%f)", _trackingSpeed);
1544+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
1545+
"[GUIDE]: stopGuide: RA set speed : %f (at %l)",
1546+
_trackingSpeed,
1547+
_stepperTRK->currentPosition());
15441548
_stepperTRK->setSpeed(_trackingSpeed);
15451549
_mountStatus &= ~STATUS_GUIDE_PULSE_RA;
15461550
}
15471551

15481552
if (dec && (_mountStatus & STATUS_GUIDE_PULSE_DEC))
15491553
{
1550-
LOG(DEBUG_STEPPERS, "[STEPPERS]: stopGuiding(DEC): Stop motor");
1554+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: stopGuide: DEC stop guide at : %l", _stepperGUIDE->currentPosition());
15511555

15521556
// Stop DEC guiding and wait for it to stop.
15531557
_stepperGUIDE->stop();
@@ -1558,16 +1562,20 @@ void Mount::stopGuiding(bool ra, bool dec)
15581562
_stepperTRK->runSpeed();
15591563
}
15601564

1561-
LOG(DEBUG_STEPPERS, "[STEPPERS]: stopGuiding(DEC): GuideStepper stopped at %l", _stepperGUIDE->currentPosition());
1562-
1565+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: stopGuide: DEC stopped at : %l", _stepperGUIDE->currentPosition());
15631566
_mountStatus &= ~STATUS_GUIDE_PULSE_DEC;
15641567
}
15651568

15661569
//disable pulse state if no direction is active
15671570
if ((_mountStatus & STATUS_GUIDE_PULSE_DIR) == 0)
15681571
{
1572+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: Clear guiding state");
15691573
_mountStatus &= ~STATUS_GUIDE_PULSE_MASK;
15701574
}
1575+
else
1576+
{
1577+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: One axis still guiding");
1578+
}
15711579
}
15721580

15731581
/////////////////////////////////
@@ -1577,7 +1585,26 @@ void Mount::stopGuiding(bool ra, bool dec)
15771585
/////////////////////////////////
15781586
void Mount::guidePulse(byte direction, int duration)
15791587
{
1580-
LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: > Guide Pulse %d for %dms", direction, duration);
1588+
#if (DEBUG_LEVEL & (DEBUG_STEPPERS | DEBUG_GUIDE))
1589+
const char *directionName = "-NE-S---W";
1590+
#endif
1591+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: > Guide Pulse %c for %dms", directionName[direction], duration);
1592+
if ((direction == NORTH) || (direction == SOUTH))
1593+
{
1594+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC current steps : %l", _stepperGUIDE->currentPosition());
1595+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC steps/deg : %f", _stepsPerDECDegree);
1596+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
1597+
"[GUIDE]: guidePulse: DEC Microstep ratio : %f",
1598+
(DEC_GUIDE_MICROSTEPPING / DEC_SLEW_MICROSTEPPING));
1599+
}
1600+
else
1601+
{
1602+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA current steps : %l", _stepperTRK->currentPosition());
1603+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA steps/deg : %f", _stepsPerRADegree);
1604+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
1605+
"[GUIDE]: guidePulse: RA Microstep ratio : %f",
1606+
(RA_TRACKING_MICROSTEPPING / RA_SLEW_MICROSTEPPING));
1607+
}
15811608

15821609
// DEC stepper moves at sidereal rate in both directions
15831610
// RA stepper moves at either 2.5x sidereal rate or 0.5x sidereal rate.
@@ -1586,7 +1613,6 @@ void Mount::guidePulse(byte direction, int duration)
15861613
/ 3600.0f; // u-steps/deg * deg/hr / sec/hr = u-steps/sec
15871614
float raGuidingSpeed = _stepsPerRADegree * (RA_TRACKING_MICROSTEPPING / RA_SLEW_MICROSTEPPING) * siderealDegreesInHour
15881615
/ 3600.0f; // u-steps/deg * deg/hr / sec/hr = u-steps/sec
1589-
raGuidingSpeed *= _trackingSpeedCalibration;
15901616

15911617
// TODO: Do we need to track how many steps the steppers took and add them to the GoHome calculation?
15921618
// If so, we need to remember where we were when we started the guide pulse. Then at the end,
@@ -1596,30 +1622,46 @@ void Mount::guidePulse(byte direction, int duration)
15961622
switch (direction)
15971623
{
15981624
case NORTH:
1599-
LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: DEC.setSpeed(%f)", DEC_PULSE_MULTIPLIER * decGuidingSpeed);
1625+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed);
1626+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC guide speed : %f", DEC_PULSE_MULTIPLIER * decGuidingSpeed);
16001627
_stepperGUIDE->setSpeed(DEC_PULSE_MULTIPLIER * decGuidingSpeed);
16011628
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC;
16021629
_guideDecEndTime = millis() + duration;
16031630
break;
16041631

16051632
case SOUTH:
1606-
LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: DEC.setSpeed(%f)", -DEC_PULSE_MULTIPLIER * decGuidingSpeed);
1633+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC base speed : %f", decGuidingSpeed);
1634+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: DEC guide speed : %f", -DEC_PULSE_MULTIPLIER * decGuidingSpeed);
16071635
_stepperGUIDE->setSpeed(-DEC_PULSE_MULTIPLIER * decGuidingSpeed);
16081636
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_DEC;
16091637
_guideDecEndTime = millis() + duration;
16101638
break;
16111639

16121640
case WEST:
16131641
// We were in tracking mode before guiding, so no need to update microstepping mode on RA driver
1614-
LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: TRK.setSpeed(%f)", (RA_PULSE_MULTIPLIER * raGuidingSpeed));
1642+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA base speed : %f", raGuidingSpeed);
1643+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA speed factor : %f", _trackingSpeedCalibration);
1644+
raGuidingSpeed *= _trackingSpeedCalibration;
1645+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA adjusted speed : %f", raGuidingSpeed);
1646+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
1647+
"[GUIDE]: guidePulse: RA guide speed : %f (%f x adjusted speed)",
1648+
(RA_PULSE_MULTIPLIER * raGuidingSpeed),
1649+
RA_PULSE_MULTIPLIER);
16151650
_stepperTRK->setSpeed(RA_PULSE_MULTIPLIER * raGuidingSpeed); // Faster than siderael
16161651
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_RA;
16171652
_guideRaEndTime = millis() + duration;
16181653
break;
16191654

16201655
case EAST:
16211656
// We were in tracking mode before guiding, so no need to update microstepping mode on RA driver
1622-
LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: TRK.setSpeed(%f)", (raGuidingSpeed * (2.0f - RA_PULSE_MULTIPLIER)));
1657+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA base speed : %f", raGuidingSpeed);
1658+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA speed factor : %f", _trackingSpeedCalibration);
1659+
raGuidingSpeed *= _trackingSpeedCalibration;
1660+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: RA adjusted speed : %f", raGuidingSpeed);
1661+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE,
1662+
"[GUIDE]: guidePulse: RA guide speed : %f (%f x adjusted speed)",
1663+
(2.0 - RA_PULSE_MULTIPLIER * raGuidingSpeed),
1664+
(2.0 - RA_PULSE_MULTIPLIER));
16231665
_stepperTRK->setSpeed(raGuidingSpeed * (2.0f - RA_PULSE_MULTIPLIER)); // Slower than siderael
16241666
_mountStatus |= STATUS_GUIDE_PULSE | STATUS_GUIDE_PULSE_RA;
16251667
_guideRaEndTime = millis() + duration;
@@ -1630,7 +1672,7 @@ void Mount::guidePulse(byte direction, int duration)
16301672
updateInfoDisplay();
16311673
#endif
16321674

1633-
LOG(DEBUG_STEPPERS, "[STEPPERS]: guidePulse: < Guide Pulse");
1675+
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: < Guide Pulse");
16341676
}
16351677

16361678
/////////////////////////////////

0 commit comments

Comments
 (0)