|
22 | 22 | #define BUFFER_LOGS false |
23 | 23 | #endif |
24 | 24 |
|
| 25 | +#ifndef OAM |
| 26 | + #ifndef OAE |
| 27 | + #define OAT "OAT" |
| 28 | + #endif |
| 29 | +#endif |
| 30 | +#if defined(OAE) && defined(OAM) |
| 31 | + #error "OAE and OAM cannot be defined at the same time" |
| 32 | +#endif |
| 33 | + |
25 | 34 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
26 | 35 | // //////// |
27 | 36 | // MOTOR & DRIVER SETTINGS //////// |
|
232 | 241 | #endif |
233 | 242 |
|
234 | 243 | #ifndef DEC_LIMIT_UP |
235 | | - #ifdef OAM |
| 244 | + #if defined(OAM) || defined(OAE) |
236 | 245 | #define DEC_LIMIT_UP 135.0f |
237 | 246 | #else |
238 | 247 | #define DEC_LIMIT_UP 0.0f |
239 | 248 | #endif |
240 | 249 | #endif |
241 | 250 | #ifndef DEC_LIMIT_DOWN |
242 | | - #ifdef OAM |
| 251 | + #if defined(OAM) || defined(OAE) |
243 | 252 | #define DEC_LIMIT_DOWN 135.0f |
244 | 253 | #else |
245 | 254 | #define DEC_LIMIT_DOWN 0.0f |
|
332 | 341 | #define AZ_STEPPER_ACCELERATION (100 * AZ_MICROSTEPPING) |
333 | 342 | #endif |
334 | 343 |
|
335 | | - // the Circumference of the AZ rotation. 808mm dia. |
| 344 | + // the Circumference of the AZ rotation. 808mm dia (OAT) |
336 | 345 | #ifndef AZ_CIRCUMFERENCE |
337 | | - #define AZ_CIRCUMFERENCE 2538.4f |
| 346 | + #ifdef OAE |
| 347 | + // Roughly from the joint to the rod placement is 70mm |
| 348 | + #define AZ_CIRCUMFERENCE 56.0f * 2 * PI |
| 349 | + #ifndef AZ_ROD_PITCH |
| 350 | + #define AZ_ROD_PITCH 0.5 |
| 351 | + #endif |
| 352 | + #define AZIMUTH_STEPS_PER_REV \ |
| 353 | + +(AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / AZ_ROD_PITCH) * AZ_STEPPER_SPR * AZ_MICROSTEPPING) // Actually u-steps/rev |
| 354 | + #else |
| 355 | + #define AZ_CIRCUMFERENCE 2538.4f |
| 356 | + #endif |
338 | 357 | #endif |
| 358 | + |
| 359 | + #ifndef OAE |
| 360 | + #define AZ_WORMGEAR_RATIO 1.0f |
| 361 | + #endif |
| 362 | + |
339 | 363 | #ifndef AZIMUTH_STEPS_PER_REV |
340 | 364 | #define AZIMUTH_STEPS_PER_REV \ |
341 | 365 | (AZ_CORRECTION_FACTOR * (AZ_CIRCUMFERENCE / (AZ_PULLEY_TEETH * GT2_BELT_PITCH)) * AZ_STEPPER_SPR \ |
342 | 366 | * AZ_MICROSTEPPING) // Actually u-steps/rev |
343 | 367 | #endif |
344 | | - #define AZIMUTH_STEPS_PER_ARC_MINUTE (AZIMUTH_STEPS_PER_REV / (360 * 60.0f)) // Used to determine move distance in steps |
| 368 | + |
| 369 | + #ifndef AZIMUTH_STEPS_PER_ARC_MINUTE |
| 370 | + #define AZIMUTH_STEPS_PER_ARC_MINUTE (AZIMUTH_STEPS_PER_REV / (360 * 60.0f)) // Used to determine move distance in steps |
| 371 | + #endif |
345 | 372 |
|
346 | 373 | // AZ TMC2209 UART settings |
347 | 374 | // These settings work only with TMC2209 in UART connection (single wire to TX) |
|
373 | 400 | #define ALT_MICROSTEPPING 4 |
374 | 401 | #endif |
375 | 402 | #ifndef ALT_STEPPER_SPR |
376 | | - #define ALT_STEPPER_SPR 400 // NEMA 0.9° = 400 | NEMA 1.8° = 200 |
| 403 | + #define ALT_STEPPER_SPR (400.0) // NEMA 0.9° = 400 | NEMA 1.8° = 200 |
377 | 404 | #endif |
378 | 405 | #ifndef ALT_STEPPER_SPEED |
379 | 406 | #define ALT_STEPPER_SPEED 2000 |
|
398 | 425 | (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING) // Actually u-steps/rev |
399 | 426 |
|
400 | 427 | #else |
401 | | - // the Circumference of the AZ rotation. 770mm dia. |
402 | | - #define ALT_CIRCUMFERENCE 2419.0f |
403 | | - #if AUTOPA_VERSION == 1 |
404 | | - // the ratio of the ALT gearbox for AutoPA V1 (40:3) |
405 | | - #define ALT_WORMGEAR_RATIO (40.0f / 3.0f) |
406 | | - #else |
407 | | - // the ratio of the ALT gearbox for AutoPA V2 (40:1) |
408 | | - #define ALT_WORMGEAR_RATIO (40.0f) |
409 | | - #endif |
410 | | - #ifndef ALTITUDE_STEPS_PER_REV |
| 428 | + #ifdef OAE |
| 429 | + #ifndef ALT_ROD_PITCH |
| 430 | + #define ALT_ROD_PITCH 1.25 // mm/rev |
| 431 | + #endif |
| 432 | + // the Circumference of the ALT rotation. Roughly 146mm radius. |
| 433 | + #define ALT_CIRCUMFERENCE 130.0f * 2 * PI |
411 | 434 | #define ALTITUDE_STEPS_PER_REV \ |
412 | | - (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR * ALT_MICROSTEPPING \ |
413 | | - * ALT_WORMGEAR_RATIO) // Actually u-steps/rev |
| 435 | + +(ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR \ |
| 436 | + * ALT_MICROSTEPPING) // Actually u-steps/rev |
| 437 | + #else |
| 438 | + // the Circumference of the AZ rotation. 770mm dia. |
| 439 | + #define ALT_CIRCUMFERENCE 2419.0f |
| 440 | + #if AUTOPA_VERSION == 1 |
| 441 | + // the ratio of the ALT gearbox for AutoPA V1 (40:3) |
| 442 | + #define ALT_WORMGEAR_RATIO (40.0f / 3.0f) |
| 443 | + #else |
| 444 | + // the ratio of the ALT gearbox for AutoPA V2 (40:1) |
| 445 | + #define ALT_WORMGEAR_RATIO (40.0f) |
| 446 | + #endif |
| 447 | + #ifndef ALTITUDE_STEPS_PER_REV |
| 448 | + #define ALTITUDE_STEPS_PER_REV \ |
| 449 | + (ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR \ |
| 450 | + * ALT_MICROSTEPPING * ALT_WORMGEAR_RATIO) // Actually u-steps/rev |
| 451 | + #endif |
414 | 452 | #endif |
415 | 453 | #endif |
416 | 454 |
|
|
620 | 658 | // //////// |
621 | 659 | //////////////////////////////////////////// |
622 | 660 |
|
623 | | -// Stepper drivers |
624 | | -#if (RA_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) |
625 | | - #if defined(ESP32) |
626 | | - #define RA_SERIAL_PORT Serial2 // Can be shared with DEC_SERIAL_PORT |
627 | | - #elif defined(__AVR_ATmega2560__) |
628 | | - // Uses SoftwareSerial |
629 | | - #endif |
630 | | -#endif |
631 | | - |
632 | | -#if (DEC_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) |
633 | | - #if defined(ESP32) |
634 | | - #define DEC_SERIAL_PORT Serial2 // Can be shared with RA_SERIAL_PORT |
635 | | - #elif defined(__AVR_ATmega2560__) |
636 | | - // Uses SoftwareSerial |
637 | | - #endif |
638 | | -#endif |
639 | | - |
640 | 661 | // Focuser |
641 | 662 | #if (FOCUS_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART) |
642 | 663 | #if defined(ESP32) |
|
0 commit comments