From 824b55db227b7eeaf906e0fb4e9d3e9d3686b7b4 Mon Sep 17 00:00:00 2001 From: k3ng Date: Mon, 27 Dec 2021 16:26:02 -0500 Subject: [PATCH] 2021.12.27.01 Coded FEATURE_MASTER_SEND_AZ_ROTATION_COMMANDS_TO_REMOTE and FEATURE_MASTER_SEND_EL_ROTATION_COMMANDS_TO_REMOTE but haven't tested yet \M command: query moon azimuth and elevation \U command: query sun azimuth and elevation Still working on FEATURE_CALIBRATION --- k3ng_rotator_controller/rotator.h | 14 ++++++++++++-- k3ng_rotator_controller/rotator_dependencies.h | 6 ++++++ .../rotator_features_wb6kcn_k3ng.h | 9 ++++++--- k3ng_rotator_controller/rotator_settings_m0upu.h | 8 +++++++- k3ng_rotator_controller/rotator_settings_test.h | 8 +++++++- k3ng_rotator_controller/rotator_settings_wb6kcn.h | 8 +++++++- .../rotator_settings_wb6kcn_k3ng.h | 7 ++++++- 7 files changed, 51 insertions(+), 9 deletions(-) diff --git a/k3ng_rotator_controller/rotator.h b/k3ng_rotator_controller/rotator.h index d05e3cf..ea6129a 100755 --- a/k3ng_rotator_controller/rotator.h +++ b/k3ng_rotator_controller/rotator.h @@ -125,6 +125,14 @@ #define REMOTE_UNIT_CL_COMMAND 7 #define REMOTE_UNIT_RC_COMMAND 8 #define REMOTE_UNIT_GS_COMMAND 9 +#define REMOTE_UNIT_RL_COMMAND 10 +#define REMOTE_UNIT_RR_COMMAND 11 +#define REMOTE_UNIT_RU_COMMAND 12 +#define REMOTE_UNIT_RD_COMMAND 13 +#define REMOTE_UNIT_RA_COMMAND 14 +#define REMOTE_UNIT_RE_COMMAND 15 +#define REMOTE_UNIT_RS_COMMAND 16 +#define REMOTE_UNIT_PG_COMMAND 17 #define NOT_PARKED 0 #define PARK_INITIATED 1 @@ -180,6 +188,9 @@ // for debugging +#define DBG_PROCESS_REMOTE_SLAVE_COMMAND 43 + + #define DBG_CHECK_AZ_PRESET_POT 44 #define DBG_CHECK_PRESET_ENCODERS_NOT_IDLE 45 @@ -325,5 +336,4 @@ -/* ------end of macros ------- */ - +/* ------end of macros ------- */ \ No newline at end of file diff --git a/k3ng_rotator_controller/rotator_dependencies.h b/k3ng_rotator_controller/rotator_dependencies.h index 7eca405..af00d34 100755 --- a/k3ng_rotator_controller/rotator_dependencies.h +++ b/k3ng_rotator_controller/rotator_dependencies.h @@ -150,4 +150,10 @@ #error "FEATURE_GPS requires either OPTION_GPS_USE_TINY_GPS_LIBRARY or OPTION_GPS_USE_SPARKFUN_U_BLOX_GNSS_LIBRARY" #endif +#if defined(FEATURE_MASTER_SEND_AZ_ROTATION_COMMANDS_TO_REMOTE) && !defined(FEATURE_MASTER_WITH_SERIAL_SLAVE) && !defined(FEATURE_MASTER_WITH_ETHERNET_SLAVE) + #error FEATURE_MASTER_SEND_AZ_ROTATION_COMMANDS_TO_REMOTE can only be used with FEATURE_MASTER_WITH_SERIAL_SLAVE or FEATURE_MASTER_WITH_ETHERNET_SLAVE +#endif +#if defined(FEATURE_MASTER_SEND_EL_ROTATION_COMMANDS_TO_REMOTE) && !defined(FEATURE_MASTER_WITH_SERIAL_SLAVE) && !defined(FEATURE_MASTER_WITH_ETHERNET_SLAVE) + #error FEATURE_MASTER_SEND_EL_ROTATION_COMMANDS_TO_REMOTE can only be used with FEATURE_MASTER_WITH_SERIAL_SLAVE or FEATURE_MASTER_WITH_ETHERNET_SLAVE +#endif diff --git a/k3ng_rotator_controller/rotator_features_wb6kcn_k3ng.h b/k3ng_rotator_controller/rotator_features_wb6kcn_k3ng.h index e6d53fd..fa4c331 100755 --- a/k3ng_rotator_controller/rotator_features_wb6kcn_k3ng.h +++ b/k3ng_rotator_controller/rotator_features_wb6kcn_k3ng.h @@ -21,9 +21,9 @@ #define FEATURE_STEPPER_MOTOR // Requires TimerFive library to be copied to the Arduino libraries directory (If using OPTION_STEPPER_MOTOR_USE_TIMER_ONE_INSTEAD_OF_FIVE below, copy the TimeOne library) // #define FEATURE_AUTOCORRECT // #define FEATURE_TEST_DISPLAY_AT_STARTUP -#define FEATURE_CALIBRATION // under development - this will get rid of azimuth and elevation offsets and replace with runtime calibration tables +// #define FEATURE_CALIBRATION // under development - this will get rid of azimuth and elevation offsets and replace with runtime calibration tables -// #define FEATURE_SATELLITE_TRACKING // https://github.com/k3ng/k3ng_rotator_controller/wiki/707-Satellite-Tracking +#define FEATURE_SATELLITE_TRACKING // https://github.com/k3ng/k3ng_rotator_controller/wiki/707-Satellite-Tracking #define LANGUAGE_ENGLISH // all languages customized in rotator_language.h // #define LANGUAGE_SPANISH @@ -41,6 +41,9 @@ // #define FEATURE_MASTER_WITH_SERIAL_SLAVE // [master]{remote_port}<-------serial-------->{control_port}[slave] // #define FEATURE_MASTER_WITH_ETHERNET_SLAVE // [master]<-------------------ethernet--------------------->[slave] +// #define FEATURE_MASTER_SEND_AZ_ROTATION_COMMANDS_TO_REMOTE +// #define FEATURE_MASTER_SEND_EL_ROTATION_COMMANDS_TO_REMOTE + //#define FEATURE_ADC_RESOLUTION12 // 12 bit ADC resolution for Teensy 3.x, Arduino Due Zero MKR families /* position sensors - pick one for azimuth and one for elevation if using an az/el rotator */ @@ -85,7 +88,7 @@ // #define FEATURE_MIDAS_I2C_DISPLAY // #define FEATURE_FABO_LCD_PCF8574_DISPLAY -#define FEATURE_NEXTION_DISPLAY // Documentation: https://github.com/k3ng/k3ng_rotator_controller/wiki/425-Human-Interface:-Nextion-Display +// #define FEATURE_NEXTION_DISPLAY // Documentation: https://github.com/k3ng/k3ng_rotator_controller/wiki/425-Human-Interface:-Nextion-Display // #define FEATURE_ANALOG_OUTPUT_PINS diff --git a/k3ng_rotator_controller/rotator_settings_m0upu.h b/k3ng_rotator_controller/rotator_settings_m0upu.h index 03efa22..81f7675 100755 --- a/k3ng_rotator_controller/rotator_settings_m0upu.h +++ b/k3ng_rotator_controller/rotator_settings_m0upu.h @@ -110,7 +110,13 @@ You can tweak these, but read the online documentation! // various code settings #define AZIMUTH_TOLERANCE 3.0 // rotator will stop within X degrees when doing autorotation #define ELEVATION_TOLERANCE 0.1 //1.0 -#define OPERATION_TIMEOUT 120000 // timeout for any rotation operation in mS ; 120 seconds is usually enough unless you have the speed turned down + +#if defined(FEATURE_REMOTE_UNIT_SLAVE) + #define OPERATION_TIMEOUT 1000 // timeout for remote unit any rotation operation in mS - 1 seconds +#else + #define OPERATION_TIMEOUT 120000 // timeout for any rotation operation in mS ; 120 seconds is usually enough unless you have the speed turned down +#endif + #define TIMED_INTERVAL_ARRAY_SIZE 20 #define LCD_COLUMNS 20 //16 diff --git a/k3ng_rotator_controller/rotator_settings_test.h b/k3ng_rotator_controller/rotator_settings_test.h index f3b6b53..13b90d2 100755 --- a/k3ng_rotator_controller/rotator_settings_test.h +++ b/k3ng_rotator_controller/rotator_settings_test.h @@ -119,7 +119,13 @@ You can tweak these, but read the online documentation! // various code settings #define AZIMUTH_TOLERANCE 5.0 // rotator will stop within X degrees when doing autorotation #define ELEVATION_TOLERANCE 5.0 -#define OPERATION_TIMEOUT 120000 // timeout for any rotation operation in mS ; 120 seconds is usually enough unless you have the speed turned down + +#if defined(FEATURE_REMOTE_UNIT_SLAVE) + #define OPERATION_TIMEOUT 1000 // timeout for remote unit any rotation operation in mS - 1 second +#else + #define OPERATION_TIMEOUT 120000 // timeout for any rotation operation in mS ; 120 seconds is usually enough unless you have the speed turned down +#endif + #define TIMED_INTERVAL_ARRAY_SIZE 20 #define LCD_COLUMNS 20 //16 diff --git a/k3ng_rotator_controller/rotator_settings_wb6kcn.h b/k3ng_rotator_controller/rotator_settings_wb6kcn.h index 510bbfa..aff9537 100755 --- a/k3ng_rotator_controller/rotator_settings_wb6kcn.h +++ b/k3ng_rotator_controller/rotator_settings_wb6kcn.h @@ -109,7 +109,13 @@ You can tweak these, but read the online documentation! // various code settings #define AZIMUTH_TOLERANCE 0.1 // rotator will stop within X degrees when doing autorotation #define ELEVATION_TOLERANCE 0.1 //1.0 -#define OPERATION_TIMEOUT 120000 // timeout for any rotation operation in mS ; 120 seconds is usually enough unless you have the speed turned down + +#if defined(FEATURE_REMOTE_UNIT_SLAVE) + #define OPERATION_TIMEOUT 1000 // timeout for remote unit any rotation operation in mS - 1 seconds +#else + #define OPERATION_TIMEOUT 120000 // timeout for any rotation operation in mS ; 120 seconds is usually enough unless you have the speed turned down +#endif + #define TIMED_INTERVAL_ARRAY_SIZE 20 #define LCD_COLUMNS 20 //16 diff --git a/k3ng_rotator_controller/rotator_settings_wb6kcn_k3ng.h b/k3ng_rotator_controller/rotator_settings_wb6kcn_k3ng.h index 386d638..f35ccb7 100755 --- a/k3ng_rotator_controller/rotator_settings_wb6kcn_k3ng.h +++ b/k3ng_rotator_controller/rotator_settings_wb6kcn_k3ng.h @@ -109,7 +109,12 @@ You can tweak these, but read the online documentation! // various code settings #define AZIMUTH_TOLERANCE 0.01 // rotator will stop within X degrees when doing autorotation #define ELEVATION_TOLERANCE 0.01 //1.0 + #define OPERATION_TIMEOUT 120000 // timeout for any rotation operation in mS ; 120 seconds is usually enough unless you have the speed turned down +#define REMOTE_UNIT_ROTATION_TIMEOUT 5000 // timeout any remote unit rotation operation if a ping (PG) is not receive within 5 seconds + +#define REMOTE_UNIT_ROTATION_COMMAND_REPEAT_MS 500 // used by the master unit; this need to be less than OPERATION_TIMEOUT on the remote unit + #define TIMED_INTERVAL_ARRAY_SIZE 20 #define LCD_COLUMNS 20 //16 @@ -345,7 +350,7 @@ You can tweak these, but read the online documentation! // Serial Port Settings #define CONTROL_PORT_MAPPED_TO &Serial // change this line to map the control port to a different serial port (Serial1, Serial2, etc.) #define CONTROL_PORT_BAUD_RATE 115200 //9600 -//#define REMOTE_PORT Serial3 // used to control remote unit +#define REMOTE_PORT Serial3 // used to control remote unit #define REMOTE_UNIT_PORT_BAUD_RATE 9600 #define GPS_PORT Serial2 #define GPS_PORT_BAUD_RATE 9600