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.13 - Updates**
- Improved Meade command documentation
- Fixed a bug that was not correctly showing the stepper direction in the :GX# command reply./

**V1.13.12 - Updates**
- Parallelize matrix_build.py for faster CI builds
- Added basic test mode that can be run via terminal connection.
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.12"
#define VERSION "V1.13.13"
60 changes: 32 additions & 28 deletions src/MeadeCommandProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Parameters:
// "s" is the sign
// "HH" is the number of hours
// Remarks
// Remarks:
// Note that this is NOT simply the timezone offset you are in (like -8 for Pacific Standard Time), it is the negative of it. So how many hours need to be added to your local time to get to UTC.
//
// :Ga#
Expand Down Expand Up @@ -271,25 +271,28 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Description:
// Get Mount Status
// Information:
// String reflecting the mounts' status. The string is a comma-delimited list of statuses
// String reflecting the mounts' status. The string is a comma-delimited list of statuses.
// Returns:
// "Idle,--T--,11219,0,927,071906,+900000,#"
// "Idle,--T--,11219,0,927,071906,+900000,,#"
// Parameters:
// [0] The mount status. One of 'Idle', 'Parked', 'Parking', 'Guiding', 'SlewToTarget', 'FreeSlew', 'ManualSlew', 'Tracking', 'Homing'
// [1] The motion state.
// [1] The motion state (see Remarks below).
// [2] The RA stepper position
// [3] The DEC stepper position
// [4] The Tracking stepper position
// [5] The current RA position
// [6] The current DEC position
// [5] The current RA coordinate
// [6] The current DEC coordinate
// [7] The FOC stepper position (if FOC enabled, else empty)
// Remarks:
// The motion state
// The motion state consists of 6 characters. If the character is a '-', the corresponding axis is not moving.
// First character is RA slewing state ('R' is East, 'r' is West, '-' is stopped).
// Second character is DEC slewing state ('d' is North, 'D' is South, '-' is stopped).
// Third character is TRK slewing state ('T' is Tracking, '-' is stopped).
// Fourth character is AZ slewing state ('Z' and 'z' is adjusting, '-' is stopped).
// Fifth character is ALT slewing state ('A' and 'a' is adjusting, '-' is stopped).
// Az and Alt are optional. The string may only be 3 characters long
// Sixth character is FOC slewing state ('F' and 'f' is adjusting, '-' is stopped).
// AZ, ALT, and FOC are only set if the corresponding axis is enabled. If not, the character is always '-'.
// Since AZ/ALT rarely move, their positions are not returned here. To get the AZ and ALT stepper positions, use the ":XGAA#" command.
//
//------------------------------------------------------------------
// SET FAMILY
Expand Down Expand Up @@ -424,7 +427,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Description:
// Synchronize Declination and Right Ascension.
// Information:
// This tells the scope what it is currently pointing at.
// This tells the scope what exact coordinates it is currently pointing at. These coordinates become the new current RA/DEC coordinates of the mount.
// Returns:
// "1" if successfully set
// "0" otherwise
Expand Down Expand Up @@ -464,7 +467,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Description:
// Run a Guide pulse
// Information:
// This runs the motors at increased speed for a short period of time.
// This runs the RA or DEC steppers at an increased or decreased speed (in the case of RA) or a constant speed (in the case of DEC) for a short period of time. It is used for guiding.
// Parameters:
// "d" is one of 'N', 'E', 'W', or 'S'
// "nnnn" is the duration in ms
Expand All @@ -485,7 +488,8 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Description:
// Start slewing
// Information:
// This starts slewing the mount in the given direction.
// This starts slewing the mount in the given direction. You must issue a stop command (such as the corresponding ":Qc#",
// where 'c' is the same direction as passed to this command) or ":Q#" (stops all steppers) to stop it.
// Parameters:
// "c" is one of 'n', 'e', 'w', or 's'
// Returns:
Expand All @@ -495,7 +499,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Description:
// Move stepper
// Information:
// This starts moving one of the steppers by the given amount of steps and returns immediately.
// This starts moving one of the steppers by the given amount of steps and returns immediately. Steps can be positive or negative.
// Parameters:
// "x" is the stepper to move (r for RA, d for DEC, f for FOC, z for AZ, t for ALT)
// "nnnn" is the number of steps
Expand All @@ -521,7 +525,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// specified direction.
// Returns:
// "1" if search is started
// "0" if homing has not been enabled in the local config
// "0" if homing has not been enabled in the local configuration file
//
// :MHDxn#
// Description:
Expand All @@ -542,13 +546,13 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// specified direction.
// Returns:
// "1" if search is started
// "0" if homing has not been enabled in the local config
// "0" if homing has not been enabled in the local configuration file
//
// :MAAH#
// Description:
// Move Azimuth and Altitude to home
// Information:
// If the scope supports automated azimuth and altitutde operations, move AZ and ALT axis to their zero positions.
// If the scope supports automated azimuth and altitude operations, move AZ and ALT axis to their zero positions.
// Returns:
// "1"
//
Expand Down Expand Up @@ -644,7 +648,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// nothing
//
//------------------------------------------------------------------
// EXTRA OAT FAMILY - These are meant for the PC control app
// EXTRA OAT FAMILY - These are used by the PC control application OATControl
//
// :XFR#
// Description:
Expand Down Expand Up @@ -723,7 +727,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Sets the reference pitch value of the mount (Digital Level addon). This is the value
// at which the mount is level.
// Returns:
// "1#" if succsessful
// "1#" if successful
// "0#" if there is no Digital Level
//
// :XGAA#
Expand Down Expand Up @@ -895,12 +899,12 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// "<Stepper Info>" is a pipe-delimited string of Motor type (NEMA or 28BYJ), Pulley Teeth, Steps per revolution)
// "<GPS info>" is either NO_GPS or GPS, depending on whether a GPS module is present
// "<AzAlt info>" is either NO_AZ_ALT, AUTO_AZ_ALT, AUTO_AZ, or AUTO_ALT, depending on which AutoPA stepper motors are present
// "<Gyro info>" is either NO_GYRO or GYRO depending on whether the Digial level is present
// "<Gyro info>" is either NO_GYRO or GYRO depending on whether the Digital level is present
// "<Display info>" is either NO_LCD or LCD_display_type depending on whether LCD is present and if so, which one
// "<Focuser info>" is either NO_FOC or FOC depending on whether the focuser motor is enabled
// "<RAHallSensor info>" is either NO_HSAH or HSAH depending on whether the Hall sensor based auto homing for RA is enabled
// "<Endswitch info>" is either NO_ENDSW or ENDS_RA, ENDSW_DEC, or ENDSW_RA_DEC depending on which axis have end switches installed
// Remarks
// Remarks:
// As OAT/OAM firmware supports more features, these may be appended, separated by a comma. Any further features will
// have a 'NO_xxxxx' if the feature is not supported.
// To differentiate between OAT and OAM, use the Get Product Name (#GVP) command.
Expand Down Expand Up @@ -952,7 +956,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// This offset is added to the position of the RA ring when it is centered on the hall sensor triggered range after running.
// the RA homing command (:MHRx#)
// Parameters:
// "n" is the (positive or negative) number of steps that are needed from the center of the Hall senser trigger range to the actual home position.
// "n" is the (positive or negative) number of steps that are needed from the center of the Hall sensor trigger range to the actual home position.
// Returns:
// nothing
//
Expand All @@ -963,7 +967,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// This offset is added to the position of the DEC ring when it is centered on the hall sensor triggered range after running.
// the DEC homing command (:MHDx#)
// Parameters:
// "n" is the (positive or negative) number of steps that are needed from the center of the Hall senser trigger range to the actual home position.
// "n" is the (positive or negative) number of steps that are needed from the center of the Hall sensor trigger range to the actual home position.
// Returns:
// nothing
//
Expand Down Expand Up @@ -995,7 +999,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// otherwise to the given angle (in degrees from the home position).
// Parameters:
// "nnnnn" is the number of steps from home that the DEC ring can travel upwards. Passing 0 will reset it to the
// limits defined in your config file. Omitting this parameter sets it to the current DEC position.
// limits defined in your configuration file. Omitting this parameter sets it to the current DEC position.
// Returns:
// nothing
//
Expand All @@ -1004,7 +1008,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Clear DEC upper limit
// Information:
// Resets the upper limit for the DEC axis to the configuration-defined position.
// If unconfigured, the limit is cleared.
// If not configured, the limit is cleared.
// Returns:
// nothing
//
Expand All @@ -1016,7 +1020,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// otherwise to the given angle (in degrees from the home position).
// Parameters:
// "nnnnn" is the number of steps from home that the DEC ring can travel downwards. Passing 0 will reset it to the
// limits defined in your config file. Omitting this parameter sets it to the current DEC position.
// limits defined in your configuration file. Omitting this parameter sets it to the current DEC position.
// Returns:
// nothing
//
Expand All @@ -1025,7 +1029,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Clear DEC lower limit
// Information:
// Resets the lower limit for the DEC axis to the configuration-defined position.
// If unconfigured, the limit is cleared.
// If not configured, the limit is cleared.
// Returns:
// nothing
//
Expand All @@ -1034,7 +1038,8 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Set DEC parking position offset
// Information:
// This stores the number of steps needed to move from home to the parking position.
// Returns: nothing
// Returns:
// nothing
//
// :XSSn.nnn#
// Description:
Expand Down Expand Up @@ -1109,7 +1114,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Description:
// Set speed factor
// Information:
// Set focuser speed to <n> where <n> is an ASCII digit 1..4. 1 is slowest, 4 i fastest
// Set focuser speed to <n> where <n> is an ASCII digit 1..4. 1 is slowest, 4 is fastest
// Returns:
// nothing
//
Expand Down Expand Up @@ -1137,7 +1142,6 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
// Returns:
// "nnn#" "nnn" is the current position of the stepper
//
//
// :FPnnn#
// Description:
// Set position
Expand Down
34 changes: 18 additions & 16 deletions src/Mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,13 @@ PUSH_NO_WARNINGS
#endif
POP_NO_WARNINGS

// slewingStatus()
// slewStatus()
#define SLEWING_DEC B00000010
#define SLEWING_RA B00000001
#define SLEWING_BOTH B00000011
#define SLEWING_TRACKING B00001000
#define NOT_SLEWING B00000000

// slewStatus
#define SLEW_MASK_DEC B0011
#define SLEW_MASK_NORTH B0001
#define SLEW_MASK_SOUTH B0010
#define SLEW_MASK_RA B1100
#define SLEW_MASK_EAST B0100
#define SLEW_MASK_WEST B1000
#define SLEW_MASK_ANY B1111
#define SLEW_MASK_ANY B1111

#define UART_CONNECTION_TEST_RETRIES 5

Expand Down Expand Up @@ -2278,28 +2270,38 @@ String Mount::getStatusString()
{
byte slew = slewStatus();
if (slew & SLEWING_RA)
disp[0] = _stepperRA->speed() < 0 ? 'R' : 'r';
{
disp[0] = _stepperRA->targetPosition() < _stepperRA->currentPosition() ? 'R' : 'r';
}
if (slew & SLEWING_DEC)
disp[1] = _stepperDEC->speed() < 0 ? 'D' : 'd';
{
disp[1] = _stepperDEC->targetPosition() < _stepperDEC->currentPosition() ? 'D' : 'd';
}
if (slew & SLEWING_TRACKING)
{
disp[2] = 'T';
}
}
else if (isSlewingTRK())
{
disp[2] = 'T';
}
#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE)
if (_stepperAZ->isRunning())
disp[3] = _stepperAZ->speed() < 0 ? 'Z' : 'z';
{
disp[3] = _stepperAZ->targetPosition() < _stepperAZ->currentPosition() ? 'Z' : 'z';
}
#endif
#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE)
if (_stepperALT->isRunning())
disp[4] = _stepperALT->speed() < 0 ? 'A' : 'a';
{
disp[4] = _stepperALT->targetPosition() < _stepperALT->currentPosition() ? 'A' : 'a';
}
#endif

#if (FOCUS_STEPPER_TYPE != STEPPER_TYPE_NONE)
if (_stepperFocus->isRunning())
disp[5] = _stepperFocus->speed() < 0 ? 'F' : 'f';
disp[5] = _stepperFocus->targetPosition() < _stepperFocus->currentPosition() ? 'F' : 'f';
#endif

status += disp;
Expand All @@ -2320,7 +2322,7 @@ String Mount::getStatusString()

/////////////////////////////////
//
// slewingStatus
// slewStatus
//
// Returns the current state of the motors and is a bitfield with these flags:
// NOT_SLEWING is all zero. SLEWING_DEC, SLEWING_RA, SLEWING_BOTH, SLEWING_TRACKING are bits.
Expand Down