Skip to content

Commit ff1ce54

Browse files
V1.8.14 - Updates
- Turned the power to the Azimuth and Altitude motors on and off as needed. - Enabled Altitude correction from LX200 commands - Prevented tracking from starting after parking for NEMA motors.
1 parent 46c6294 commit ff1ce54

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

Software/Arduino code/OpenAstroTracker/Configuration.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
=======================================================================================================================================
1919
*/
2020

21-
String version = "V1.8.13";
21+
String version = "V1.8.14";
2222

2323
///////////////////////////////////////////////////////////////////////////
2424
// Also use Configuration_adv for further adjustments!

Software/Arduino code/OpenAstroTracker/MeadeCommandProcessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,10 @@ String MeadeCommandProcessor::handleMeadeMovement(String inCmd) {
659659
#if AZIMUTH_ALTITUDE_MOTORS == 1
660660
float arcMinute = inCmd.substring(2).toFloat();
661661
if (inCmd[1] == 'Z'){
662-
_mount->moveBy (AZIMUTH_STEPS, arcMinute);
662+
_mount->moveBy(AZIMUTH_STEPS, arcMinute);
663663
}
664664
else if (inCmd[1] == 'L'){
665-
//_mount->moveBy(ALTITUDE_STEPS, arcMinute);
665+
_mount->moveBy(ALTITUDE_STEPS, arcMinute);
666666
}
667667
#endif
668668
return "";

Software/Arduino code/OpenAstroTracker/Mount.cpp

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "Utility.hpp"
66
#include "EPROMStore.hpp"
77
#include "Sidereal.cpp"
8+
#include "Configuration_adv.hpp"
89
#include "Configuration_pins.hpp"
910

1011
//mountstatus
@@ -86,6 +87,11 @@ Mount::Mount(int stepsPerRADegree, int stepsPerDECDegree, LcdMenu* lcdMenu) {
8687
_mountStatus = 0;
8788
_lastDisplayUpdate = 0;
8889
_stepperWasRunning = false;
90+
91+
#if AZIMUTH_ALTITUDE_MOTORS == 1
92+
_azAltWasRunning = false;
93+
#endif
94+
8995
_totalDECMove = 0;
9096
_totalRAMove = 0;
9197
_moveRate = 4;
@@ -1180,11 +1186,13 @@ void Mount::goHome()
11801186
/////////////////////////////////
11811187
void Mount::moveBy(int direction, float arcMinutes)
11821188
{
1183-
if (direction == AZIMUTH_STEPS){
1189+
if (direction == AZIMUTH_STEPS) {
1190+
enableAzAltMotors();
11841191
int stepsToMove = 2.0f * arcMinutes * AZIMUTH_STEPS_PER_ARC_MINUTE;
11851192
_stepperAZ->move(stepsToMove);
11861193
}
1187-
else if (direction == ALTITUDE_STEPS){
1194+
else if (direction == ALTITUDE_STEPS) {
1195+
enableAzAltMotors();
11881196
int stepsToMove = arcMinutes * ALTITUDE_STEPS_PER_ARC_MINUTE;
11891197
_stepperALT->move(stepsToMove);
11901198
}
@@ -1623,7 +1631,20 @@ void Mount::loop() {
16231631
_lastMountPrint = now;
16241632
}
16251633
#endif
1626-
1634+
1635+
#if AZIMUTH_ALTITUDE_MOTORS == 1
1636+
if (!_stepperALT->isRunning() && !_stepperAZ->isRunning() && _azAltWasRunning)
1637+
{
1638+
// One of the motors was running last time through the loop, but not anymore, so shutdown the outputs.
1639+
disableAzAltMotors();
1640+
_azAltWasRunning = false;
1641+
}
1642+
if (_stepperALT->isRunning() || _stepperAZ->isRunning() )
1643+
{
1644+
_azAltWasRunning = true;
1645+
}
1646+
#endif
1647+
16271648
#if RA_DRIVER_TYPE == TMC2209_UART && DEC_DRIVER_TYPE == TMC2209_UART && USE_AUTOHOME == 1
16281649
if (isFindingHome()) {
16291650
if (digitalRead(DEC_DIAG_PIN) == HIGH) {
@@ -1684,7 +1705,9 @@ void Mount::loop() {
16841705
_currentRAStepperPosition = _stepperRA->currentPosition();
16851706
#if RA_DRIVER_TYPE == TMC2209_UART
16861707
_driverRA->microsteps(TRACKING_MICROSTEPPING);
1687-
startSlewing(TRACKING);
1708+
if (!isParking()) {
1709+
startSlewing(TRACKING);
1710+
}
16881711
//_driverRA->en_spreadCycle(0); // only for audio feedback for quick debug
16891712
#endif
16901713
if (_correctForBacklash) {

Software/Arduino code/OpenAstroTracker/Mount.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ class Mount {
322322
#if AZIMUTH_ALTITUDE_MOTORS == 1
323323
AccelStepper* _stepperAZ;
324324
AccelStepper* _stepperALT;
325+
bool _azAltWasRunning;
325326
#endif
326327

327328
unsigned long _guideEndTime;

0 commit comments

Comments
 (0)