diff --git a/public/images/cog40t.png b/public/images/cog40t.png new file mode 100644 index 0000000..fdc0cfc Binary files /dev/null and b/public/images/cog40t.png differ diff --git a/public/images/cog50t.png b/public/images/cog50t.png new file mode 100644 index 0000000..46644a4 Binary files /dev/null and b/public/images/cog50t.png differ diff --git a/public/images/cog60t.png b/public/images/cog60t.png new file mode 100644 index 0000000..3862457 Binary files /dev/null and b/public/images/cog60t.png differ diff --git a/src/modules/Home.jsx b/src/modules/Home.jsx index 02d8d14..80dc3ad 100644 --- a/src/modules/Home.jsx +++ b/src/modules/Home.jsx @@ -13,7 +13,7 @@ const Home = (props) => {

OAT/OAM/OAE Firmware Configuration Generator

START -

V3.10

+

V3.11

diff --git a/src/modules/configurations/base/commonSteps.js b/src/modules/configurations/base/commonSteps.js index d88be9b..9dc0c8e 100644 --- a/src/modules/configurations/base/commonSteps.js +++ b/src/modules/configurations/base/commonSteps.js @@ -103,12 +103,12 @@ export const createBoardStep = () => ({ { key: 'M10', value: 'MKS GEN L V1.0', image: '/images/mksv10.png', defineValue: 'BOARD_AVR_MKS_GEN_L_V1' }, { key: 'M20', value: 'MKS GEN L V2.0', image: '/images/mksv20.png', defineValue: 'BOARD_AVR_MKS_GEN_L_V2' }, { key: 'M21', value: 'MKS GEN L V2.1', image: '/images/mksv21.png', defineValue: 'BOARD_AVR_MKS_GEN_L_V21' }, - { key: 'OAEV1', value: 'OAE_V1', image: '/images/oaeboard.png', defineValue: 'BOARD_OAE_V1' }, + { key: 'OAEV1', value: 'OAE V1', image: '/images/oaeboard.png', defineValue: 'BOARD_OAE_V1' }, ] }, }); -// RA Driver step (OAT/OAM) +// RA Driver step (OAT/OAM/OAE) export const createRADriverStep = () => ({ id: 'RDO', title: 'RA Driver', @@ -208,7 +208,7 @@ export const createDECStepperStep = () => ({ }], }); -// DEC Driver step (OAT/OAM) +// DEC Driver step (OAT/OAM/OAE) export const createDECDriverStep = () => ({ id: 'DDT', title: 'DEC Driver', @@ -297,9 +297,9 @@ export const createInfoDisplayStep = () => ({ ] }, postamble: [ - { literal: ['#define INFO_DISPLAY_I2C_ADDRESS 0x3C'] }, - { literal: ['#define INFO_DISPLAY_I2C_SDA_PIN 20'] }, - { literal: ['#define INFO_DISPLAY_I2C_SCL_PIN 21'] }, + { literal: ['#define INFO_DISPLAY_I2C_ADDRESS 0x3C'], condition: "($display == YES)", }, + { literal: ['#define INFO_DISPLAY_I2C_SDA_PIN 20'], condition: "($display == YES)", }, + { literal: ['#define INFO_DISPLAY_I2C_SCL_PIN 21'], condition: "($display == YES)", }, { literal: ['// Note that the E1 port is not usable since I2C requires pin 21!'], condition: "($board == M10) OR ($board == M20) OR ($board == M21)", @@ -519,4 +519,257 @@ export const createHallSensorSteps = () => [ ] }, } +]; + +// Auto PA steps (OAT/OAM/OAE) +export const createAutoPASteps = () => [ + { + id: 'AP', + title: 'Auto Polar Align', + label: 'Do you have the AutoPA add on:', + variable: 'autopa', + preamble: ['////////////////////////////////', '// AutoPA Addon configuration ', '// Define whether we have the AutoPA add on or not. Currently: {v}'], + define: '', + control: { + type: 'radioimg', + choices: [ + { key: 'N', value: 'No AutoPA', image: '/images/none.png', additionalLines: ['// No AutoPA settings'] }, + { key: 'Y', value: 'AutoPA is installed', image: '/images/autopa.png' }, + ] + }, + }, + { + id: 'AV', + title: 'AutoPA Version', + label: 'What version of AutoPA do you have installed:', + variable: 'autopaversion', + condition: "($autopa == Y)", + preamble: ['// Using AutoPA {v}.'], + define: '', + control: { + type: 'radioimg', + choices: [ + { key: '1', value: 'V1.0', image: '/images/none.png' }, + { key: '2', value: 'V2.0', image: '/images/none.png', additionalLines: ['#define AUTOPA_VERSION 2'] }, + ] + }, + }, + { + id: 'ZS', + title: 'Azimuth Stepper', + label: 'Which stepper motor are you using for the Azimuth:', + variable: 'az', + condition: "($autopa == Y)", + preamble: ['// Using the {v} stepper for AZ'], + define: 'AZ_STEPPER_TYPE', + control: { + type: 'radioimg', + choices: [ + { key: 'BY', value: 'Modded 28BYJ-48 (Bipolar)', image: '/images/byj48mod.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define AZ_STEPPER_SPR 2048.0f'], condition: "$tracker != OAM" }, + { key: 'N9', value: 'NEMA 17, 0.9°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED' }, + { key: 'N8', value: 'NEMA 17, 1.8°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define AZ_STEPPER_SPR 200.0f'] }, + ] + }, + }, + { + id: 'ZD', + title: 'Azimuth Driver', + label: 'Which driver board are you using to drive the Azimuth stepper motor:', + variable: 'azdrv', + condition: "($autopa == Y)", + preamble: ['// Using the {v} driver for AZ stepper motor'], + define: 'AZ_DRIVER_TYPE', + control: { + type: 'radioimg', + choices: [ + { key: 'A', value: 'Generic A4988', image: '/images/a4988.png', defineValue: 'DRIVER_TYPE_A4988_GENERIC', condition: "$tracker != OAM" }, + { key: 'TU', value: 'TMC2209-UART', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_UART' }, + { key: 'TS', value: 'TMC2209-Standalone', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_STANDALONE' }, + ] + }, + postamble: [{ + condition: '$tracker == OAE', + literal: [ + '#define AZ_MICROSTEPPING 1', + '#define AZ_STEPPER_SPEED 800', + '#define AZ_STEPPER_ACCELERATION 2000' + ] + }] + }, + { + id: 'ZA', + title: 'Azimuth Advanced Settings', + label: 'These are some advanced settings you may want to override. The defaults are set already. Please only change them if you are sure what they do and what their valid ranges are. Enter the AZ stepper specs and desired settings:', + variable: 'azpower', + condition: "$azdrv == TU", + preamble: ['// Define AZ stepper motor power settings'], + postamble: [{ + literal: [ + '#define AZ_STEPPER_SPEED 1000', + '#define AZ_STEPPER_ACCELERATION 500', + '', + '', + '///////////////////////////////', + '// AZ parameters will require tuning according to your setup', + '', + '// If you have a custom solution involving a rod you can uncomment and use the next 3 lines for calculations', + '// #define AZ_CIRCUMFERENCE (115 * 2 * 3.1415927) // the circumference of the circle where the movement is anchored', + '// #define AZ_ROD_PITCH 1.0f // mm per full rev of stepper', + '// #define AZIMUTH_STEPS_PER_REV (AZ_CIRCUMFERENCE / AZ_ROD_PITCH * AZ_STEPPER_SPR * AZ_MICROSTEPPING) // Steps needed to turn AZ 360deg', + '', + '// If you have a belt drive solution, you can uncomment and use the next 2 lines for calculations', + '// #define AZ_CIRCUMFERENCE (725) // the circumference of the circle where the movement is anchored', + '// #define AZ_PULLEY_TEETH 16', + '', + '// Is it going the wrong way?', + '#define AZ_INVERT_DIR 0' + ] + }, + { + literal: [ + '', + '// Should AZ motor stay energized?', + '#define AZ_ALWAYS_ON 1', + ], + condition: "$tracker == OAM", + } + ], + define: '', + control: { + type: 'textinput', + choices: [ + { key: 'P', label: 'Power rating in mA', defaultValue: '{Defaults.PowerRating.az}', defineLine: '#define AZ_MOTOR_CURRENT_RATING {0} // mA' }, + { key: 'O', label: 'Operating percentage', defaultValue: '{Defaults.PowerUtilization.az}', defineLine: '#define AZ_OPERATING_CURRENT_SETTING {0} // %' }, + { key: 'S', label: 'Microstepping setting', defaultValue: '{Defaults.AZALTMicrostepping.az}', defineLine: '#define AZ_MICROSTEPPING {0} // steps' }, + { key: 'H', label: 'Hold current percentage (0 to power down)', defaultValue: '{Defaults.HoldPercentage.az}', defineLine: '#define AZ_MOTOR_HOLD_SETTING {0} // %' }, + ] + }, + }, + { + id: 'ZAO', + title: 'Azimuth Always On', + label: 'It is possible to keep the azimuth motor energized at all times to prevent any shifting in position. This is not necessarily needed for 28BYJ motors, however it is recommended for NEMAs when using AutoPA V2.0.', + variable: 'azalwayson', + condition: "($autopa == Y) AND ($tracker == OAT) OR ($tracker == OAE)", + preamble: ['// Define AZ always-on'], + define: 'AZ_ALWAYS_ON', + control: { + type: 'radioimg', + choices: [ + { key: 'Y', value: 'Yes', image: '/images/none.png', defineValue: '1' }, + { key: 'N', value: 'No', image: '/images/none.png', defineValue: '0' }, + ] + }, + }, + { + id: 'LST', + title: 'Altitude Stepper', + label: 'Which stepper motor are you using for the Altitude:', + variable: 'alt', + condition: "($autopa == Y)", + preamble: ['// Using the {v} stepper for ALT'], + define: 'ALT_STEPPER_TYPE', + control: { + type: 'radioimg', + choices: [ + { key: 'BY', value: 'Modded 28BYJ-48 (Bipolar)', image: '/images/byj48mod.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define ALT_STEPPER_SPR 2048.0f'], condition: "$tracker != OAM" }, + { key: 'N9', value: 'NEMA 17, 0.9°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED' }, + { key: 'N8', value: 'NEMA 17, 1.8°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define ALT_STEPPER_SPR 200.0f'] }, + ] + }, + postamble: [ + { + condition: '$tracker == OAE', + literal: [ + '// ALT', + '#define ALT_MICROSTEPPING 1', + '#define ALT_STEPPER_SPEED 800', + '#define ALT_STEPPER_ACCELERATION 2000' + ] + }] + }, + { + id: 'LD', + title: 'Altitude Driver', + label: 'Which driver board are you using to drive the Altitude stepper motor:', + variable: 'altdrv', + condition: "($autopa == Y)", + preamble: ['// Using the {v} driver for ALT stepper motor'], + define: 'ALT_DRIVER_TYPE', + control: { + type: 'radioimg', + choices: [ + { key: 'A', value: 'Generic A4988', image: '/images/a4988.png', defineValue: 'DRIVER_TYPE_A4988_GENERIC', condition: "$tracker != OAM" }, + { key: 'TU', value: 'TMC2209-UART', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_UART' }, + { key: 'TS', value: 'TMC2209-Standalone', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_STANDALONE' }, + ] + }, + }, + { + id: 'LA', + title: 'Altitude Advanced Settings', + label: 'These are some advanced settings you may want to override. The defaults are set already. Please only change them if you are sure what they do and what their valid ranges are. Enter the ALT stepper specs and desired settings:', + variable: 'altpower', + condition: "$altdrv == TU", + preamble: ['// Define ALT stepper motor power settings'], + define: '', + control: { + type: 'textinput', + choices: [ + { key: 'P', label: 'Power rating in mA', defaultValue: '{Defaults.PowerRating.alt}', defineLine: '#define ALT_MOTOR_CURRENT_RATING {0} // mA' }, + { key: 'O', label: 'Operating percentage', defaultValue: '{Defaults.PowerUtilization.alt}', defineLine: '#define ALT_OPERATING_CURRENT_SETTING {0} // %' }, + { key: 'S', label: 'Microstepping setting', defaultValue: '{Defaults.AZALTMicrostepping.alt}', defineLine: '#define ALT_MICROSTEPPING {0} // steps' }, + { key: 'H', label: 'Hold current percentage (0 to power down)', defaultValue: '{Defaults.HoldPercentage.alt}', defineLine: '#define ALT_MOTOR_HOLD_SETTING {0} // %' }, + ] + }, + postamble: [{ + condition: '$tracker == OAM', + literal: [ + '#define ALT_STEPPER_SPEED 3000', + '#define ALT_STEPPER_ACCELERATION 1000', + '', + '///////////////////////////////', + '// ALT parameters are for hardware as designed', + '#define ALTITUDE_STEPS_PER_ARC_MINUTE ((1640 / 60) * ALT_MICROSTEPPING)', + '', + '// Is it going the wrong way?', + '#define ALT_INVERT_DIR 0' + ] + }, + { + condition: '$tracker == OAT', + literal: [ + '#define ALT_STEPPER_SPEED 2000', + '#define ALT_STEPPER_ACCELERATION 1000', + '', + '// Is it going the wrong way?', + '#define ALT_INVERT_DIR 0' + ] + }, + { + condition: '$tracker == OAE', + literal: [ + '', + '// Is it going the wrong way?', + '#define ALT_INVERT_DIR 0' + ] + } + ] + }, + { + id: 'LAO', + title: 'Altitude Always On', + label: 'It is possible to keep the altitude motor energized at all times to prevent any shifting in position. This is usually not needed.', + variable: 'altalwayson', + condition: "($autopa == Y) AND ($tracker == OAT) OR ($tracker == OAE)", + preamble: ['// Define ALT always-on'], + define: 'ALT_ALWAYS_ON', + control: { + type: 'radioimg', + choices: [ + { key: 'Y', value: 'Yes', image: '/images/none.png', defineValue: '1' }, + { key: 'N', value: 'No', image: '/images/none.png', defineValue: '0' }, + ] + }, + } ]; \ No newline at end of file diff --git a/src/modules/configurations/base/sharedDefaults.js b/src/modules/configurations/base/sharedDefaults.js index f55a827..679295c 100644 --- a/src/modules/configurations/base/sharedDefaults.js +++ b/src/modules/configurations/base/sharedDefaults.js @@ -46,5 +46,9 @@ export const Defaults = { OAMSpeed: { N9: 2.0, N8: 2.0, N9O: 2.0, N8O: 2.0, rastpr: { N9: 2.0, N8: 2.0, N9O: 2.0, N8O: 2.0 }, decstpr: { N9: 2.0, N8: 2.0, N9O: 2.0, N8O: 2.0 } }, OAMAcceleration: { N9: 2.0, N8: 2.0, N9O: 2.0, N8O: 2.0, rastpr: { N9: 2.0, N8: 2.0, N9O: 2.0, N8O: 2.0 }, decstpr: { N9: 2.0, N8: 2.0, N9O: 2.0, N8O: 2.0 } }, OAMMicrostepping: { N9: 128, N8: 128, N9O: 128, N8O: 128, rastpr: { N9: 128, N8: 128, N9O: 128, N8O: 128 }, decstpr: { N9: 128, N8: 128, N9O: 128, N8O: 128 } }, - RAHallSensorPin: { tracker: 18 } + RAHallSensorPin: { OAT: 53, OAM: 27, OAE: 27 }, + OAEPowerRating: { N9: 2000, N8: 2000, N9O: 2000, N8O: 2000 }, + OAEPowerUtilization: { N9: 50, N8: 50, N9O: 50, N8O: 50 }, + OAESlewMicrostepping: { N9: 4, N8: 4, N9O: 16, N8O: 16 }, + OAETrackMicrostepping: { N9: 256, N8: 256, N9O: 256, N8O: 256 } }; \ No newline at end of file diff --git a/src/modules/configurations/oae/oaeSteps.js b/src/modules/configurations/oae/oaeSteps.js index a99a1f8..c1569a7 100644 --- a/src/modules/configurations/oae/oaeSteps.js +++ b/src/modules/configurations/oae/oaeSteps.js @@ -1,5 +1,19 @@ // OAE Configuration Steps -import { createTrackerSelectionStep, createHemisphereStep, createTrackingOnBootStep } from '../base/commonSteps.js'; +import { + createTrackerSelectionStep, + createHemisphereStep, + createBoardStep, + createRADriverStep, + createRAPulleyTeethStep, + createDECDriverStep, + createTrackingOnBootStep, + createStepperStealthModeStep, + createWiFiSteps, + createFocuserSteps, + createHallSensorSteps, + createAutoPASteps +} from '../base/commonSteps.js'; +import { Defaults } from '../base/sharedDefaults.js'; export const getOAESteps = () => [ createTrackerSelectionStep(), @@ -28,130 +42,227 @@ export const getOAESteps = () => [ }, }, createHemisphereStep(), + createBoardStep(), { - id: 'BD', - title: 'Board', - label: 'Which microcontroller board are you using:', - variable: 'board', - preamble: ['// We are using the {v} board'], + id: 'RSE', + title: 'RA Stepper', + label: 'Which stepper motor are you using for RA:', + variable: 'rastpr', + preamble: ['////////////////////////////////', '// RA Stepper configuration (OAE)', '// See supported stepper values. Change according to the steppers you are using', '// Using the {v} stepper for RA'], + define: 'RA_STEPPER_TYPE', + control: { + type: 'radioimg', + choices: [ + { key: 'N9', value: 'NEMA 17, 0.9°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define RA_STEPPER_SPR (400 * 9) // change to (200 * 9) for 1.8° stepper',] }, + { key: 'N8', value: 'NEMA 17, 1.8°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define RA_STEPPER_SPR (200 * 9) // change to (400 * 9) for 0.9° stepper',] }, + ] + }, + }, + createRADriverStep(), + { + id: 'RAE', + title: 'RA Advanced Settings', + label: 'These are some advanced settings you may want to override. The defaults are set already. Please only change them if you are sure what they do and what their valid ranges are. Enter the RA stepper specs and desired settings:', + variable: 'rapower', + condition: "($radrv == TU)", + preamble: ['// Define some RA stepper motor settings'], + define: '', + control: { + type: 'textinput', + choices: [ + { key: 'P', label: 'Power rating in mA', defaultValue: '{Defaults.OAEPowerRating.rastpr}', defineLine: '#define RA_MOTOR_CURRENT_RATING {0} // mA' }, + { key: 'O', label: 'Operating percentage', defaultValue: '{Defaults.OAEPowerUtilization.rastpr}', defineLine: '#define RA_OPERATING_CURRENT_SETTING {0} // %' }, + { key: 'S', label: 'Microstepping while slewing', defaultValue: '{Defaults.OAESlewMicrostepping.rastpr}', defineLine: '#define RA_SLEW_MICROSTEPPING {0}' }, + { key: 'T', label: 'Microstepping while tracking', defaultValue: '{Defaults.OAETrackMicrostepping.rastpr}', defineLine: '#define RA_TRACKING_MICROSTEPPING {0}' }, + ] + }, postamble: [{ literal: [ - '#if defined(BOARD) && BOARD != {v}', - ' #error Selected PIO environment does not match this configuration', - '#else', - ' #define BOARD {v}', - '#endif', - '', - '////////////////////////////////', - '// RA Stepper configuration ', - '// See supported stepper values. Change according to the steppers you are using', - '// Using the NEMA 17, 0.9°/step stepper for RA', - '#define RA_STEPPER_TYPE STEPPER_TYPE_ENABLE', - '', - '// Using the TMC2209-UART driver for RA stepper motor', - '#define RA_DRIVER_TYPE DRIVER_TYPE_TMC2209_UART', - '', - '// Define some RA stepper motor settings', - '#define RA_MOTOR_CURRENT_RATING 1200 // mA', - '#define RA_OPERATING_CURRENT_SETTING 80 // %', - '#define RA_SLEW_MICROSTEPPING 4', - '#define RA_TRACKING_MICROSTEPPING 256', - '', - '// TMC2209 Stealth Mode (spreadCycle) - When set to 0, tracking is more precise, but noisy (high-pitched sound). When set to 1, they are silent.', - '#define RA_UART_STEALTH_MODE 0', '', '// Is it going the wrong way?', '#define RA_INVERT_DIR 0', '', '// Define some RA stepper motor settings', '', - '#define RA_SLEWING_SPEED_DEGREE 3', - '#define RA_ACCEL_SecToFullSpeed 1 // Seconds to reach full slewing speed', - '', - '#define RA_STEPPER_SPR (400 * 9) // change to (200 * 9) for 1.8° stepper', - '#define DEC_STEPPER_SPR (200 * 50 * 4.5f) // change "200" to "400" for 0.9° stepper, change "50" to different value depending on worm gear used', - '', - '// Using the 16 tooth gear (recommended) for RA belt', - '#define RA_PULLEY_TEETH 16', + '#define RA_SLEWING_SPEED_DEGREE 4', + '#define RA_ACCEL_SecToFullSpeed 1.5 // Seconds to reach full slewing speed', '', '#define RA_STEPPER_SPEED RA_SLEWING_SPEED_DEGREE * (RA_STEPPER_SPR * RA_SLEW_MICROSTEPPING * (RA_WHEEL_CIRCUMFERENCE / (RA_PULLEY_TEETH * GT2_BELT_PITCH)) / 360) //3525', - '#define RA_STEPPER_ACCELERATION (RA_STEPPER_SPEED / RA_ACCEL_SecToFullSpeed)', - '', - '', - '////////////////////////////////', - '// DEC Stepper configuration ', - '// See supported stepper values. Change according to the steppers you are using', - '// Using the NEMA 17, 0.9°/step stepper for DEC', - '#define DEC_STEPPER_TYPE STEPPER_TYPE_ENABLE', - '', - '// Using the TMC2209-UART driver for DEC stepper', - '#define DEC_DRIVER_TYPE DRIVER_TYPE_TMC2209_UART', - '', - '// Define some DEC stepper motor settings', - '#define DEC_MOTOR_CURRENT_RATING 2000 // mA', - '#define DEC_OPERATING_CURRENT_SETTING 60 // %', - '#define DEC_SLEW_MICROSTEPPING 32', - '#define DEC_GUIDE_MICROSTEPPING 256', - '', - '// TMC2209 Stealth Mode (spreadCycle) - When set to 0, tracking is more precise, but noisy (high-pitched sound). When set to 1, they are silent.', - '#define DEC_UART_STEALTH_MODE 1', + '#define RA_STEPPER_ACCELERATION (RA_STEPPER_SPEED / RA_ACCEL_SecToFullSpeed)' + ] + }] + }, + createRAPulleyTeethStep(), + { + id: 'DTE', + title: 'DEC Pulley Teeth', + label: 'How many teeth does your DEC gear have?', + variable: 'deccog', + preamble: ['// Using the {v} for DEC belt'], + define: 'DEC_PULLEY_GEAR', + control: { + type: 'radioimg', + choices: [ + { key: '1', value: '60 tooth gear', image: '/images/cog60t.png', defineValue: '60' }, + { key: '2', value: '50 tooth gear (recommended)', image: '/images/cog50t.png', defineValue: '50' }, + { key: '3', value: '40 tooth gear', image: '/images/cog40t.png', defineValue: '40' }, + ] + }, + }, + { + id: 'DSE', + title: 'DEC Stepper', + label: 'Which stepper motor are you using for DEC:', + variable: 'decstpr', + preamble: ['////////////////////////////////', '// DEC Stepper configuration ', '// See supported stepper values. Change according to the steppers you are using', '// Using the {v} stepper for DEC'], + define: 'DEC_STEPPER_TYPE', + control: { + type: 'radioimg', + choices: [ + { + key: 'N9O', + value: 'NEMA 17, 0.9°/step', + image: '/images/nema17.png', + defineValue: 'STEPPER_TYPE_ENABLED', + additionalLines: ['#define DEC_STEPPER_SPR (400 * DEC_PULLEY_GEAR * 4.5f) // change "400" to "200" for 1.8° stepper'] + }, + { + key: 'N8O', + value: 'NEMA 17, 1.8°/step', + image: '/images/nema17.png', + defineValue: 'STEPPER_TYPE_ENABLED', + additionalLines: ['#define DEC_STEPPER_SPR (200 * DEC_PULLEY_GEAR * 4.5f) // change "200" to "400" for 0.9° stepper'] + }, + ] + }, + postamble: [{ + literal: ['#define DEC_WHEEL_CIRCUMFERENCE 1.0f'], + }], + }, + createDECDriverStep(), + { + id: 'DAE', + title: 'DEC Advanced Settings', + label: 'These are some advanced settings you may want to override. The defaults are set already. Please only change them if you are sure what they do and what their valid ranges are. Enter the DEC stepper specs and desired settings:', + variable: 'decpower', + condition: "($decdrv == TU)", + preamble: ['// Define some DEC stepper motor settings'], + define: '', + control: { + type: 'textinput', + choices: [ + { key: 'P', label: 'Power rating in mA', defaultValue: '{Defaults.OAEPowerRating.decstpr}', defineLine: '#define DEC_MOTOR_CURRENT_RATING {0} // mA' }, + { key: 'O', label: 'Operating percentage', defaultValue: '{Defaults.OAEPowerUtilization.decstpr}', defineLine: '#define DEC_OPERATING_CURRENT_SETTING {0} // %' }, + { key: 'S', label: 'Microstepping while slewing', defaultValue: '{Defaults.OAESlewMicrostepping.decstpr}', defineLine: '#define DEC_SLEW_MICROSTEPPING {0}' }, + { key: 'T', label: 'Microstepping while guiding', defaultValue: '{Defaults.OAETrackMicrostepping.decstpr}', defineLine: '#define DEC_GUIDE_MICROSTEPPING {0}' }, + ] + }, + postamble: [{ + literal: [ '', '// Is it going the wrong way?', - '#define DEC_INVERT_DIR 0', + '#define DEC_INVERT_DIR 1', '', '#define DEC_SLEWING_SPEED_DEGREE RA_SLEWING_SPEED_DEGREE', '#define DEC_ACCEL_SecToFullSpeed RA_ACCEL_SecToFullSpeed', '', '#define DEC_STEPPER_SPEED DEC_SLEWING_SPEED_DEGREE * (DEC_STEPPER_SPR * DEC_SLEW_MICROSTEPPING / 360 ) // * (DEC_WHEEL_CIRCUMFERENCE / (DEC_PULLEY_TEETH * GT2_BELT_PITCH)) / 360)', '#define DEC_STEPPER_ACCELERATION (DEC_STEPPER_SPEED / DEC_ACCEL_SecToFullSpeed)', - '#define DEC_PULLEY_TEETH 1', - '', - '////////////////////////////////', - '// AZ Stepper Configuration', - '#define AZ_STEPPER_SPR 2048 // 28BYJ-48', - '#define AZ_MICROSTEPPING 1', - '#define AZ_STEPPER_SPEED 1200', - '#define AZ_STEPPER_ACCELERATION 3000', - '', - '////////////////////////////////', - '// ALT Stepper Configuration', - '#define ALT_STEPPER_SPR 2048 // 28BYJ-48', - '#define ALT_MICROSTEPPING 1', - '#define ALT_STEPPER_SPEED 800', - '#define ALT_STEPPER_ACCELERATION 3000', - '', - '////////////////////////////////', - '// Display configuration ', - '// Define the type of display we are using. Currently: No display', - '#define DISPLAY_TYPE DISPLAY_TYPE_NONE', - '', - '////////////////////////////////', - '// GPS Addon configuration ', - '// Define whether we have the GPS addon or not. Currently: No GPS', - '#define USE_GPS 0', - '', - '// Using the NEMA 17, 0.9°/step stepper for AZ', - '#define AZ_STEPPER_TYPE STEPPER_TYPE_ENABLED', - '#define ALT_STEPPER_TYPE STEPPER_TYPE_ENABLED', - '', - '// Using the TMC2209-UART driver for AZ stepper motor', - '#define AZ_DRIVER_TYPE DRIVER_TYPE_A4988_GENERIC ', - '#define ALT_DRIVER_TYPE DRIVER_TYPE_A4988_GENERIC ', - '', - '////////////////////////////////', - '// Digital Level Addon configuration ', - '// Define whether we have the Digital Level or not. Currently: No Digital Level', - '#define USE_GYRO_LEVEL 0', - '', - '#define WIFI_ENABLED 0 ' + '#define DEC_PULLEY_TEETH 1' ] - }], + }] + }, + createTrackingOnBootStep(), + createStepperStealthModeStep(), + ...createWiFiSteps(), + createFocuserSteps(), + { + id: 'FC', + title: 'Focuser support', + label: 'Do you want to support a focuser with additional board:', + variable: 'focuser', + condition: "($board IN [M,M10,M20,M21,OAEV1])", + preamble: ['////////////////////////////////', '// Focuser configuration ', '// Define whether to support a focusing stepper motor on an additional board or not. Currently: {v}'], + define: '', control: { type: 'radioimg', choices: [ - { key: 'OAEV1', value: 'OAE_V1', image: '/images/oaeboard.png', defineValue: 'BOARD_OAE_V1' }, - ], + { key: 'N', value: 'No Focuser', image: '/images/none.png', additionalLines: ['// No Focuser settings'] }, + { key: 'Y', value: 'Focuser stepper', image: '/images/focuser.png' }, + ] }, }, - createTrackingOnBootStep(), + { + id: 'FS', + title: 'Focuser Stepper', + label: 'Which stepper motor are you using for the Focuser:', + variable: 'focstpr', + condition: "$focuser == Y", + preamble: ['// Using the {v} stepper for FOC'], + define: 'FOCUS_STEPPER_TYPE', + control: { + type: 'radioimg', + choices: [ + { key: 'BY', value: 'Modded 28BYJ-48 (Bipolar)', image: '/images/byj48.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define FOCUS_STEPPER_SPR 2048.0f'] }, + { key: 'N9', value: 'NEMA 17, 0.9°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED' }, + { key: 'N8', value: 'NEMA 17, 1.8°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define FOCUS_STEPPER_SPR 200.0f'] }, + { key: 'N49', value: 'NEMA 14, 0.9°/step', image: '/images/nema14.png', defineValue: 'STEPPER_TYPE_ENABLED' }, + { key: 'N48', value: 'NEMA 14, 1.8°/step', image: '/images/nema14.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define FOCUS_STEPPER_SPR 200.0f'] }, + ] + }, + }, + { + id: 'FD', + title: 'Focuser Driver', + label: 'Which driver board are you using to drive the focuser stepper motor:', + variable: 'focdrv', + condition: "$focuser == Y", + preamble: ['// Using the {v} driver for focuser stepper'], + define: 'FOCUS_DRIVER_TYPE', + control: { + type: 'radioimg', + choices: [ + { key: 'A', value: 'Generic A4988', image: '/images/a4988.png', defineValue: 'DRIVER_TYPE_A4988_GENERIC' }, + { key: 'TU', value: 'TMC2209-UART', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_UART' }, + { key: 'TS', value: 'TMC2209-Standalone', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_STANDALONE' }, + ] + }, + }, + { + id: 'FA', + title: 'Focuser Advanced Settings', + label: 'These are some advanced settings you may want to override. The defaults are set already. Please only change them if you are sure what they do and what their valid ranges are. Enter the Focus stepper specs and desired settings:', + variable: 'focuspower', + condition: "$focdrv == TU", + preamble: ['// Define Focus stepper motor power settings'], + postamble: [{ literal: ['#define FOCUSER_ALWAYS_ON 1'] }], + define: '', + control: { + type: 'textinput', + choices: [ + { key: 'P', label: 'Power rating in mA', defaultValue: '{Defaults.PowerRating.focstpr}', defineLine: '#define FOCUS_MOTOR_CURRENT_RATING {0} // mA' }, + { key: 'O', label: 'Operating percentage', defaultValue: '{Defaults.PowerUtilization.focstpr}', defineLine: '#define FOCUS_OPERATING_CURRENT_SETTING {0} // %' }, + { key: 'S', label: 'Microstepping setting', defaultValue: '{Defaults.FocuserMicrostepping.focstpr}', defineLine: '#define FOCUS_MICROSTEPPING {0} // steps' }, + { key: 'H', label: 'Hold current percentage (0 to power down)', defaultValue: 10, defineLine: '#define FOCUSER_MOTOR_HOLD_SETTING {0} // %', additionalLines: ['#define FOCUS_UART_STEALTH_MODE 1 // silent?'] }, + ] + }, + }, + { + id: 'FMS', + title: 'Focuser Motion Settings', + label: 'These are some advanced settings you may want to override. The defaults are set already. Please only change them if you are sure what they do and what their valid ranges are. Enter the Focuser stepper specs and desired settings:', + variable: 'focmotion', + condition: "$focuser == Y", + preamble: ['// Define some focuser stepper motor settings'], + define: '', + control: { + type: 'textinput', + choices: [ + { key: 'A', label: 'Acceleration (steps/s/s)', defaultValue: '{Defaults.Acceleration.focstpr}', defineLine: '#define FOCUS_STEPPER_ACCELERATION {0}' }, + { key: 'V', label: 'Maximum Speed (steps/s)', defaultValue: '{Defaults.Speed.focstpr}', defineLine: '#define FOCUS_STEPPER_SPEED {0}' }, + ] + }, + }, + ...createHallSensorSteps(), + ...createAutoPASteps() ]; diff --git a/src/modules/configurations/oam/oamSteps.js b/src/modules/configurations/oam/oamSteps.js index bc1d541..94adcd5 100644 --- a/src/modules/configurations/oam/oamSteps.js +++ b/src/modules/configurations/oam/oamSteps.js @@ -6,7 +6,6 @@ import { createBoardStep, createRADriverStep, createRAPulleyTeethStep, - createDECStepperStep, createDECDriverStep, createDECPulleyTeethStep, createStepperStealthModeStep, @@ -14,7 +13,8 @@ import { createInfoDisplayStep, createWiFiSteps, createFocuserSteps, - createHallSensorSteps + createHallSensorSteps, + createAutoPASteps } from '../base/commonSteps.js'; import { Defaults } from '../base/sharedDefaults.js'; @@ -103,7 +103,36 @@ export const getOAMSteps = () => [ }, createTrackingOnBootStep(), createRAPulleyTeethStep(), - createDECStepperStep(), + { + id: 'DSM', + title: 'DEC Stepper', + label: 'Which stepper motor are you using for DEC:', + variable: 'decstpr', + preamble: ['////////////////////////////////', '// DEC Stepper configuration ', '// See supported stepper values. Change according to the steppers you are using', '// Using the {v} stepper for DEC'], + define: 'DEC_STEPPER_TYPE', + control: { + type: 'radioimg', + choices: [ + { + key: 'N9O', + value: 'NEMA 17, 0.9°/step', + image: '/images/nema17.png', + defineValue: 'STEPPER_TYPE_ENABLED', + additionalLines: ['#define DEC_STEPPER_SPR (400 * 9)'] + }, + { + key: 'N8O', + value: 'NEMA 17, 1.8°/step', + image: '/images/nema17.png', + defineValue: 'STEPPER_TYPE_ENABLED', + additionalLines: ['#define DEC_STEPPER_SPR (200 * 9)'] + }, + ] + }, + postamble: [{ + literal: ['#define DEC_WHEEL_CIRCUMFERENCE 816.814f'], + }], + }, createDECDriverStep(), { id: 'DAM', @@ -146,97 +175,6 @@ export const getOAMSteps = () => [ ] }, }, - { - id: 'ZST', - title: 'Azimuth Stepper', - label: 'Which stepper motor are you using for the Azimuth:', - variable: 'az', - condition: "($autopa == Y)", - preamble: ['// Using the {v} stepper for AZ'], - define: 'AZ_STEPPER_TYPE', - control: { - type: 'radioimg', - choices: [ - { key: 'N9', value: 'NEMA 17, 0.9°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED' }, - { key: 'N8', value: 'NEMA 17, 1.8°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define AZ_STEPPER_SPR 200.0f'] }, - { key: 'BY', value: 'Modded 28BYJ-48 (Bipolar)', image: '/images/byj48mod.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define AZ_STEPPER_SPR 2048.0f'] }, - ] - }, - }, - { - id: 'ZD', - title: 'Azimuth Driver', - label: 'Which stepper driver are you using to drive the Azimuth stepper motor:', - variable: 'azdrv', - condition: "($autopa == Y)", - preamble: ['// Using the {v} driver for AZ stepper motor'], - define: 'AZ_DRIVER_TYPE', - control: { - type: 'radioimg', - choices: [ - { key: 'TU', value: 'TMC2209-UART', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_UART' }, - { key: 'TS', value: 'TMC2209-Standalone', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_STANDALONE' }, - { key: 'A', value: 'Generic A4988', image: '/images/a4988.png', defineValue: 'DRIVER_TYPE_A4988_GENERIC' }, - ] - }, - }, - { - id: 'ZA', - title: 'Azimuth Advanced Settings', - label: 'These are some advanced settings you may want to override. The defaults are set already. Please only change them if you are sure what they do and what their valid ranges are. Enter the AZ stepper specs and desired settings:', - variable: 'azpower', - condition: "($azdrv == TU)", - preamble: ['// Define AZ stepper motor power settings'], - postamble: [{ - literal: [ - '#define AZ_STEPPER_SPEED 1000', - '#define AZ_STEPPER_ACCELERATION 500', - '', - '', - '///////////////////////////////', - '// AZ parameters will require tuning according to your setup', - '', - '// If you have a custom solution involving a rod you can uncomment and use the next 3 lines for calculations', - '// #define AZ_CIRCUMFERENCE (115 * 2 * 3.1415927) // the circumference of the circle where the movement is anchored', - '// #define AZ_ROD_PITCH 1.0f // mm per full rev of stepper', - '// #define AZIMUTH_STEPS_PER_REV (AZ_CIRCUMFERENCE / AZ_ROD_PITCH * AZ_STEPPER_SPR * AZ_MICROSTEPPING) // Steps needed to turn AZ 360deg', - '', - '// If you have a belt drive solution, you can uncomment and use the next 2 lines for calculations', - '// #define AZ_CIRCUMFERENCE (725) // the circumference of the circle where the movement is anchored', - '// #define AZ_PULLEY_TEETH 16', - '', - '// Is it going the wrong way?', - '#define AZ_INVERT_DIR 0' - ] - }], - define: '', - control: { - type: 'textinput', - choices: [ - { key: 'P', label: 'Power rating in mA', defaultValue: '{Defaults.PowerRating.az}', defineLine: '#define AZ_MOTOR_CURRENT_RATING {0} // mA' }, - { key: 'O', label: 'Operating percentage', defaultValue: '{Defaults.PowerUtilization.az}', defineLine: '#define AZ_OPERATING_CURRENT_SETTING {0} // %' }, - { key: 'S', label: 'Microstepping setting', defaultValue: '{Defaults.AZALTMicrostepping.az}', defineLine: '#define AZ_MICROSTEPPING {0} // steps' }, - { key: 'H', label: 'Hold current percentage (0 to power down)', defaultValue: '{Defaults.HoldPercentage.az}', defineLine: '#define AZ_MOTOR_HOLD_SETTING {0} // %' }, - ] - }, - }, - { - id: 'ZAO', - title: 'Azimuth Always On', - label: 'It is possible to keep the azimuth motor energized at all times to prevent any shifting in position. This is not necessarily needed for 28BYJ motors, however it is recommended for NEMAs when using AutoPA V2.0.', - variable: 'azalwayson', - condition: "($autopa == Y)", - preamble: ['// Define AZ always-on'], - define: 'AZ_ALWAYS_ON', - control: { - type: 'radioimg', - choices: [ - { key: 'Y', value: 'Yes', image: '/images/none.png', defineValue: '1' }, - { key: 'N', value: 'No', image: '/images/none.png', defineValue: '0' }, - ] - }, - }, - createStepperStealthModeStep(), createDisplayStep(), createInfoDisplayStep(), @@ -334,5 +272,5 @@ export const getOAMSteps = () => [ ] }, }, - + ...createAutoPASteps() ]; diff --git a/src/modules/configurations/oat/oatSteps.js b/src/modules/configurations/oat/oatSteps.js index acea6c2..6ad4644 100644 --- a/src/modules/configurations/oat/oatSteps.js +++ b/src/modules/configurations/oat/oatSteps.js @@ -14,7 +14,8 @@ import { createInfoDisplayStep, createWiFiSteps, createFocuserSteps, - createHallSensorSteps + createHallSensorSteps, + createAutoPASteps } from '../base/commonSteps.js'; import { Defaults } from '../base/sharedDefaults.js'; @@ -73,6 +74,8 @@ export const getOATSteps = () => [ { key: 'BY', value: 'Modded 28BYJ-48 (Bipolar)', image: '/images/byj48.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define RA_STEPPER_SPR 2048.0f // steps/rev',], condition: "$stepperlib != N" }, { key: 'N9', value: 'NEMA 17, 0.9°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED' }, { key: 'N8', value: 'NEMA 17, 1.8°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define RA_STEPPER_SPR 200.0f'] }, + { key: 'N49', value: 'NEMA 14, 0.9°/step', image: '/images/nema14.png', defineValue: 'STEPPER_TYPE_ENABLED' }, + { key: 'N48', value: 'NEMA 14, 1.8°/step', image: '/images/nema14.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define DEC_STEPPER_SPR 200.0f'] }, ] }, }, @@ -215,203 +218,6 @@ export const getOATSteps = () => [ }, }, ...createFocuserSteps(), - { - id: 'APT', - title: 'Auto Polar Align', - label: 'Do you have the AutoPA add on:', - variable: 'autopa', - preamble: ['////////////////////////////////', '// AutoPA Addon configuration ', '// Define whether we have the AutoPA add on or not. Currently: {v}'], - define: '', - control: { - type: 'radioimg', - choices: [ - { key: 'N', value: 'No AutoPA', image: '/images/none.png', additionalLines: ['// No AutoPA settings'] }, - { key: 'Y', value: 'AutoPA is installed', image: '/images/autopa.png' }, - ] - }, - }, - { - id: 'AV', - title: 'AutoPA Version', - label: 'What version of AutoPA do you have installed:', - variable: 'autopaversion', - condition: "($autopa == Y)", - preamble: ['// Using AutoPA {v}.'], - define: '', - control: { - type: 'radioimg', - choices: [ - { key: '1', value: 'V1.0', image: '/images/none.png' }, - { key: '2', value: 'V2.0', image: '/images/none.png', additionalLines: ['#define AUTOPA_VERSION 2'] }, - ] - }, - }, - { - id: 'ZST', - title: 'Azimuth Stepper', - label: 'Which stepper motor are you using for the Azimuth:', - variable: 'az', - condition: "($autopa == Y)", - preamble: ['// Using the {v} stepper for AZ'], - define: 'AZ_STEPPER_TYPE', - control: { - type: 'radioimg', - choices: [ - { key: 'BY', value: 'Modded 28BYJ-48 (Bipolar)', image: '/images/byj48mod.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define AZ_STEPPER_SPR 2048.0f'] }, - { key: 'N9', value: 'NEMA 17, 0.9°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED' }, - { key: 'N8', value: 'NEMA 17, 1.8°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define AZ_STEPPER_SPR 200.0f'] }, - ] - }, - }, - { - id: 'ZD', - title: 'Azimuth Driver', - label: 'Which stepper driver are you using to drive the Azimuth stepper motor:', - variable: 'azdrv', - condition: "($autopa == Y)", - preamble: ['// Using the {v} driver for AZ stepper motor'], - define: 'AZ_DRIVER_TYPE', - control: { - type: 'radioimg', - choices: [ - { key: 'A', value: 'Generic A4988', image: '/images/a4988.png', defineValue: 'DRIVER_TYPE_A4988_GENERIC' }, - { key: 'TU', value: 'TMC2209-UART', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_UART' }, - { key: 'TS', value: 'TMC2209-Standalone', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_STANDALONE' }, - ] - }, - }, - { - id: 'ZA', - title: 'Azimuth Advanced Settings', - label: 'These are some advanced settings you may want to override. The defaults are set already. Please only change them if you are sure what they do and what their valid ranges are. Enter the AZ stepper specs and desired settings:', - variable: 'azpower', - condition: "($azdrv == TU)", - preamble: ['// Define AZ stepper motor power settings'], - postamble: [{ - literal: [ - '#define AZ_STEPPER_SPEED 1000', - '#define AZ_STEPPER_ACCELERATION 500', - '', - '', - '///////////////////////////////', - '// AZ parameters will require tuning according to your setup', - '', - '// If you have a custom solution involving a rod you can uncomment and use the next 3 lines for calculations', - '// #define AZ_CIRCUMFERENCE (115 * 2 * 3.1415927) // the circumference of the circle where the movement is anchored', - '// #define AZ_ROD_PITCH 1.0f // mm per full rev of stepper', - '// #define AZIMUTH_STEPS_PER_REV (AZ_CIRCUMFERENCE / AZ_ROD_PITCH * AZ_STEPPER_SPR * AZ_MICROSTEPPING) // Steps needed to turn AZ 360deg', - '', - '// If you have a belt drive solution, you can uncomment and use the next 2 lines for calculations', - '// #define AZ_CIRCUMFERENCE (725) // the circumference of the circle where the movement is anchored', - '// #define AZ_PULLEY_TEETH 16', - '', - '// Is it going the wrong way?', - '#define AZ_INVERT_DIR 0' - ] - }], - define: '', - control: { - type: 'textinput', - choices: [ - { key: 'P', label: 'Power rating in mA', defaultValue: '{Defaults.PowerRating.az}', defineLine: '#define AZ_MOTOR_CURRENT_RATING {0} // mA' }, - { key: 'O', label: 'Operating percentage', defaultValue: '{Defaults.PowerUtilization.az}', defineLine: '#define AZ_OPERATING_CURRENT_SETTING {0} // %' }, - { key: 'S', label: 'Microstepping setting', defaultValue: '{Defaults.AZALTMicrostepping.az}', defineLine: '#define AZ_MICROSTEPPING {0} // steps' }, - { key: 'H', label: 'Hold current percentage (0 to power down)', defaultValue: '{Defaults.HoldPercentage.az}', defineLine: '#define AZ_MOTOR_HOLD_SETTING {0} // %' }, - ] - }, - }, - { - id: 'ZAO', - title: 'Azimuth Always On', - label: 'It is possible to keep the azimuth motor energized at all times to prevent any shifting in position. This is not necessarily needed for 28BYJ motors, however it is recommended for NEMAs when using AutoPA V2.0.', - variable: 'azalwayson', - condition: "($autopa == Y)", - preamble: ['// Define AZ always-on'], - define: 'AZ_ALWAYS_ON', - control: { - type: 'radioimg', - choices: [ - { key: 'Y', value: 'Yes', image: '/images/none.png', defineValue: '1' }, - { key: 'N', value: 'No', image: '/images/none.png', defineValue: '0' }, - ] - }, - }, - { - id: 'LST', - title: 'Altitude Stepper', - label: 'Which stepper motor are you using for the Altitude:', - variable: 'alt', - condition: "($autopa == Y)", - preamble: ['// Using the {v} stepper for ALT'], - define: 'ALT_STEPPER_TYPE', - control: { - type: 'radioimg', - choices: [ - { key: 'BY', value: 'Modded 28BYJ-48 (Bipolar)', image: '/images/byj48mod.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define ALT_STEPPER_SPR 2048.0f'] }, - { key: 'N9', value: 'NEMA 17, 0.9°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED' }, - { key: 'N8', value: 'NEMA 17, 1.8°/step', image: '/images/nema17.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define ALT_STEPPER_SPR 200.0f'] }, - ] - }, - }, - { - id: 'LD', - title: 'Altitude Driver', - label: 'Which driver board are you using to drive the Altitude stepper motor:', - variable: 'altdrv', - condition: "($autopa == Y)", - preamble: ['// Using the {v} driver for ALT stepper motor'], - define: 'ALT_DRIVER_TYPE', - control: { - type: 'radioimg', - choices: [ - { key: 'A', value: 'Generic A4988', image: '/images/a4988.png', defineValue: 'DRIVER_TYPE_A4988_GENERIC' }, - { key: 'TU', value: 'TMC2209-UART', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_UART' }, - { key: 'TS', value: 'TMC2209-Standalone', image: '/images/tmc2209.png', defineValue: 'DRIVER_TYPE_TMC2209_STANDALONE' }, - ] - }, - }, - { - id: 'LA', - title: 'Altitude Advanced Settings', - label: 'These are some advanced settings you may want to override. The defaults are set already. Please only change them if you are sure what they do and what their valid ranges are. Enter the ALT stepper specs and desired settings:', - variable: 'altpower', - condition: "($altdrv == TU)", - preamble: ['// Define ALT stepper motor power settings'], - define: '', - control: { - type: 'textinput', - choices: [ - { key: 'P', label: 'Power rating in mA', defaultValue: '{Defaults.PowerRating.alt}', defineLine: '#define ALT_MOTOR_CURRENT_RATING {0} // mA' }, - { key: 'O', label: 'Operating percentage', defaultValue: '{Defaults.PowerUtilization.alt}', defineLine: '#define ALT_OPERATING_CURRENT_SETTING {0} // %' }, - { key: 'S', label: 'Microstepping setting', defaultValue: '{Defaults.AZALTMicrostepping.alt}', defineLine: '#define ALT_MICROSTEPPING {0} // steps' }, - { key: 'H', label: 'Hold current percentage (0 to power down)', defaultValue: '{Defaults.HoldPercentage.alt}', defineLine: '#define ALT_MOTOR_HOLD_SETTING {0} // %' }, - ] - }, - postamble: [{ - literal: [ - '#define ALT_STEPPER_SPEED 2000', - '#define ALT_STEPPER_ACCELERATION 1000', - '', - '// Is it going the wrong way?', - '#define ALT_INVERT_DIR 0' - ] - }] - }, - { - id: 'LAO', - title: 'Altitude Always On', - label: 'It is possible to keep the altitude motor energized at all times to prevent any shifting in position. This is usually not needed.', - variable: 'altalwayson', - condition: "($autopa == Y)", - preamble: ['// Define ALT always-on'], - define: 'ALT_ALWAYS_ON', - control: { - type: 'radioimg', - choices: [ - { key: 'Y', value: 'Yes', image: '/images/none.png', defineValue: '1' }, - { key: 'N', value: 'No', image: '/images/none.png', defineValue: '0' }, - ] - }, - }, - ...createHallSensorSteps() + ...createHallSensorSteps(), + ...createAutoPASteps() ]; \ No newline at end of file