-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcommonSteps.js
More file actions
775 lines (758 loc) · 34.9 KB
/
commonSteps.js
File metadata and controls
775 lines (758 loc) · 34.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
// Common step definitions shared across all tracker configurations
// Tracker Selection Step
export const createTrackerSelectionStep = () => ({
id: 'TR',
title: 'Tracker',
label: 'For which tracker do you want to generate firmware:',
variable: 'tracker',
preamble: [
'/////////////////////////////////////////////////////////////////////////////////////////////////////////',
'// This configuration file was generated by the OpenAstroTech Configurator at https://config.openastrotech.com',
'// and is for firmware to be used on a {v}.',
'// Save this as Configuration_local.hpp in the folder where you placed the firmware code.',
'/////////////////////////////////////////////////////////////////////////////////////////////////////////',
'/////////////////////////////////////////////////////////////////////////////////////////////////////////',
],
define: '',
control: {
type: 'radioimg',
choices: [
{ key: 'OAT', value: 'OpenAstroTracker', image: '/images/oat.png', defineValue: '' },
{ key: 'OAM', value: 'OpenAstroMount', image: '/images/oam.png', defineLine: '#define OAM' },
{ key: 'OAE', value: 'OpenAstroExplorer', image: '/images/oae.png', defineLine: '#define OAE' }
]
},
});
// Hemisphere Selection Step
export const createHemisphereStep = () => ({
id: 'HS',
title: 'Hemisphere',
label: 'Which hemisphere do you live in:',
variable: 'hemi',
preamble: ['// We live in the {v}'],
define: 'NORTHERN_HEMISPHERE',
control: {
type: 'radioimg',
choices: [
{ key: 'N', value: 'Northern Hemisphere', image: '/images/north.png', defineValue: '1' },
{ key: 'S', value: 'Southern Hemisphere', image: '/images/south.png', defineValue: '0' }
]
},
});
// Tracking on boot step
export const createTrackingOnBootStep = () => ({
id: 'RTR',
title: 'Tracking on boot',
label: 'Do you want the mount to start tracking after boot:',
variable: 'trackonboot',
preamble: ['// Track immediately after boot'],
postamble: [{
condition: "($tracker == OAT)",
literal: [
'',
'// Define limits for RA... ',
'#define RA_LIMIT_LEFT 5.5f',
'#define RA_LIMIT_RIGHT 6.5f',
'#define RA_TRACKING_LIMIT 6.75f // can\'t quite get to 7h...',
]
},
{
condition: "($tracker != OAT)",
literal: [
'',
'// Define limits for RA... ',
'#define RA_LIMIT_LEFT 6.0f',
'#define RA_LIMIT_RIGHT 6.0f',
'#define RA_TRACKING_LIMIT 6.5f',
]
}],
define: 'TRACK_ON_BOOT',
control: {
type: 'radioimg',
choices: [
{ key: 'Y', value: 'Yes, immediately start tracking', image: '/images/none.png', defineValue: '1' },
{ key: 'N', value: 'No, don\'t track until enabled', image: '/images/none.png', defineValue: '0' },
]
},
});
// Board selection step (OAT/OAM)
export const createBoardStep = () => ({
id: 'BD',
title: 'Board',
label: 'Which microcontroller board are you using:',
variable: 'board',
preamble: ['// We are using the {v} board'],
postamble: [{
literal: [
'#if defined(BOARD) && BOARD != {v}',
' #error Selected PIO environment does not match this configuration',
'#else',
' #define BOARD {v}',
'#endif'
]
}],
control: {
type: 'radioimg',
choices: [
{ key: 'M', value: 'RAMPS c/w ATMega 2560 (or clone)', image: '/images/mega2560.png', defineValue: 'BOARD_AVR_RAMPS' },
{ key: 'E', value: 'ESP32', image: '/images/esp32.png', defineValue: 'BOARD_ESP32_ESP32DEV' },
{ 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' },
]
},
});
// RA Driver step (OAT/OAM/OAE)
export const createRADriverStep = () => ({
id: 'RDO',
title: 'RA Driver',
label: 'Which driver board are you using to drive the RA stepper motor:',
variable: 'radrv',
preamble: ['// Using the {v} driver for RA stepper motor'],
define: 'RA_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' },
]
},
});
// RA Pulley Teeth step (OAT/OAM)
export const createRAPulleyTeethStep = () => ({
id: 'RT',
title: 'RA Pulley Teeth',
label: 'How many teeth does your RA gear have?',
variable: 'racog',
preamble: ['// Using the {v} for RA belt'],
define: 'RA_PULLEY_TEETH',
control: {
type: 'radioimg',
choices: [
{ key: '1', value: '16 tooth gear (recommended)', image: '/images/cog16t.png', defineValue: '16' },
{ key: '2', value: '20 tooth gear', image: '/images/cog20t.png', defineValue: '20' },
]
},
});
// DEC Stepper step (OAT/OAM)
export const createDECStepperStep = () => ({
id: 'DS',
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: 'BY', value: 'Modded 28BYJ-48 (Bipolar)', image: '/images/byj48.png', defineValue: 'STEPPER_TYPE_ENABLED', additionalLines: ['#define DEC_STEPPER_SPR 2048.0f'], condition: "($stepperlib != N)" },
{
key: 'N9',
value: 'NEMA 17, 0.9°/step',
image: '/images/nema17.png',
defineValue: 'STEPPER_TYPE_ENABLED',
condition: "($tracker == OAT)",
},
{
key: 'N8',
value: 'NEMA 17, 1.8°/step',
image: '/images/nema17.png',
defineValue: 'STEPPER_TYPE_ENABLED',
condition: "($tracker == OAT)",
additionalLines: ['#define DEC_STEPPER_SPR 200.0f']
},
{
key: 'N49',
value: 'NEMA 14, 0.9°/step',
image: '/images/nema14.png',
defineValue: 'STEPPER_TYPE_ENABLED',
condition: "($tracker == OAT)",
},
{
key: 'N48',
value: 'NEMA 14, 1.8°/step',
image: '/images/nema14.png',
defineValue: 'STEPPER_TYPE_ENABLED',
condition: "($tracker == OAT)",
additionalLines: ['#define DEC_STEPPER_SPR 200.0f'] },
{
key: 'N9O',
value: 'NEMA 17, 0.9°/step',
image: '/images/nema17.png',
defineValue: 'STEPPER_TYPE_ENABLED',
condition: "($tracker == OAM)",
additionalLines: ['#define DEC_STEPPER_SPR (400 * 9)'],
},
{
key: 'N8O',
value: 'NEMA 17, 1.8°/step',
image: '/images/nema17.png',
defineValue: 'STEPPER_TYPE_ENABLED',
condition: "($tracker == OAM)",
additionalLines: ['#define DEC_STEPPER_SPR (200 * 9)']
},
]
},
postamble: [{
literal: ['#define DEC_WHEEL_CIRCUMFERENCE 816.814f'],
}],
});
// DEC Driver step (OAT/OAM/OAE)
export const createDECDriverStep = () => ({
id: 'DDT',
title: 'DEC Driver',
label: 'Which driver board are you using to drive the DEC stepper motor:',
variable: 'decdrv',
preamble: ['// Using the {v} driver for DEC stepper'],
define: 'DEC_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' },
]
},
});
// DEC Pulley Teeth step (OAT/OAM)
export const createDECPulleyTeethStep = () => ({
id: 'DT',
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_TEETH',
control: {
type: 'radioimg',
choices: [
{ key: '1', value: '16 tooth gear (recommended)', image: '/images/cog16t.png', defineValue: '16' },
{ key: '2', value: '20 tooth gear', image: '/images/cog20t.png', defineValue: '20' },
]
},
});
// Stepper Stealth Mode step (OAT/OAM)
export const createStepperStealthModeStep = () => ({
id: 'STL',
title: 'Stepper Stealth Mode',
label: 'What mode do you want to run the RA and DEC steppers in? If Stealth Mode, they will be inaudible (when not slewing), but have slightly lower performance. In Normal mode, they will make a soft hissing sound, but will have better performance. \nAZ and ALT are always set to Stealth mode.',
variable: 'stealhmode',
condition: "($radrv == TU) AND ($decdrv == TU)",
preamble: ['// TMC2209 Stealth Mode (spreadCycle) - When set to 0, tracking is more precise, but noisy (high-pitched hissing sound). When set to 1, they are silent.'],
define: '',
control: {
type: 'radioimg',
choices: [
{ key: 'S', value: 'Stealth Mode (silent)', image: '/images/none.png', additionalLines: ['#define RA_UART_STEALTH_MODE 1', '#define DEC_UART_STEALTH_MODE 1'] },
{ key: 'N', value: 'Normal Mode (hissing)', image: '/images/none.png', additionalLines: ['#define RA_UART_STEALTH_MODE 0', '#define DEC_UART_STEALTH_MODE 0'] },
]
},
});
// Display step (OAT/OAM)
export const createDisplayStep = () => ({
id: 'DY',
title: 'Display',
label: 'What kind of interactive display are you using:',
variable: 'display',
define: 'DISPLAY_TYPE',
preamble: ['////////////////////////////////', '// Display configuration ', '// Define the type of display we are using. Currently: {v}'],
control: {
type: 'radioimg',
choices: [
{ key: 'NO', value: 'No display', image: '/images/none.png', defineValue: 'DISPLAY_TYPE_NONE' },
{ key: 'LCD', value: 'LCD Shield w/ keypad', image: '/images/lcdshield.png', defineValue: 'DISPLAY_TYPE_LCD_KEYPAD' },
{ key: 'I08', value: 'I2C LCD Shield w/ MCP23008 controller', image: '/images/lcd23008.png', defineValue: 'DISPLAY_TYPE_LCD_KEYPAD_I2C_MCP23008' },
{ key: 'I17', value: 'I2C LCD Shield w/ MCP23017 controller', image: '/images/lcd23017.png', defineValue: 'DISPLAY_TYPE_LCD_KEYPAD_I2C_MCP23017' },
{ key: 'S13', value: 'I2C 32x128 OLED w/ joystick', image: '/images/ssd1306.png', defineValue: 'DISPLAY_TYPE_LCD_JOY_I2C_SSD1306' },
]
},
});
// Informational Display step
export const createInfoDisplayStep = () => ({
id: 'IDY',
title: 'Informational Display',
label: 'What kind of information display are you using:',
variable: 'infodisplay',
condition: "($display == NO)",
preamble: ['////////////////////////////////', '// InfoDisplay configuration ', '// Define the type of info display we are using. Currently: {v}'],
control: {
type: 'radioimg',
choices: [
{ key: 'NO', value: 'No info display', image: '/images/none.png', additionalLines: ['#define INFO_DISPLAY_TYPE INFO_DISPLAY_TYPE_NONE'] },
{ key: 'OLED', value: 'I2C 128x64 OLED display', image: '/images/oledsmall.png', additionalLines: ['#define INFO_DISPLAY_TYPE INFO_DISPLAY_TYPE_I2C_SSD1306_128x64'] },
]
},
postamble: [
{ 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)",
},
],
});
// WiFi steps (OAT/OAM)
export const createWiFiSteps = () => [
{
id: 'WW',
title: 'Use WiFi',
label: 'Do you want to enable WiFi:',
variable: 'wifi',
condition: "($board == E)",
preamble: ['////////////////////////////////', '// WiFi configuration ', '// Are we using WiFi: {v}'],
define: 'WIFI_ENABLED',
control: {
type: 'radioimg',
choices: [
{ key: 'Y', value: 'Yes, use WiFi', image: '/images/wifi.png', defineValue: '1' },
{ key: 'N', value: 'No, disable WiFi', image: '/images/nowifi.png', defineValue: '0' },
]
},
},
{
id: 'WM',
title: 'WiFi Mode',
label: 'In what mode do you want to use WiFi:',
condition: "$wifi == Y",
variable: 'wifimode',
preamble: ['// Using WiFi in mode {v}'],
define: 'WIFI_MODE',
control: {
type: 'radioimg',
choices: [
{ key: 'I', value: 'Infrastructure, all devices connect to same network', image: '/images/infra.png', defineValue: 'WIFI_MODE_INFRASTRUCTURE' },
{ key: 'A', value: 'Access Point, OAT is a hotspot', image: '/images/ap.png', defineValue: 'WIFI_MODE_AP_ONLY' },
{ key: 'F', value: 'Infrastructure with failover to Access Point', image: '/images/failover.png', defineValue: 'WIFI_MODE_ATTEMPT_INFRASTRUCTURE_FAIL_TO_AP' },
]
},
},
{
id: 'WI',
title: 'WiFi Infrastructure Setup',
label: 'Enter the WiFi parameters for Infrastructure mode:',
variable: 'wifiparamsi',
condition: "($wifi == Y) AND ($wifimode == I)",
preamble: ['// Define the SSID, WPA key and host name for the network'],
define: '',
control: {
type: 'textinput',
choices: [
{ key: 'S', label: 'WiFi SSID', defineLine: '#define WIFI_INFRASTRUCTURE_MODE_SSID "{0}"' },
{ key: 'P', label: 'WPA Key', defineLine: '#define WIFI_INFRASTRUCTURE_MODE_WPAKEY "{0}"' },
{ key: 'H', label: 'Hostname', defaultValue: 'OATScope', defineLine: '#define WIFI_HOSTNAME "{0}"' },
]
},
},
{
id: 'WA',
title: 'WiFi Access Point Setup',
label: 'Enter the WiFi parameters for Access Point mode:',
variable: 'wifiparamsa',
condition: "($wifi == Y) AND ($wifimode == A)",
define: '',
preamble: ['// Define the WPA key and host name for the network'],
control: {
type: 'textinput',
choices: [
{ key: 'P', label: 'WPA Key for OAT hotspot', defineLine: '#define WIFI_AP_MODE_WPAKEY "{0}"' },
{ key: 'H', label: 'Hostname', defaultValue: 'OATScope', defineLine: '#define WIFI_HOSTNAME "{0}"' },
]
},
},
{
id: 'WF',
title: 'WiFi Failover Setup',
label: 'Enter the WiFi parameters for Failover mode:',
variable: 'wifiparamsf',
condition: "($wifi == Y) AND ($wifimode == F)",
define: '',
preamble: ['// Define the SSID, WPA keys and host name for the network'],
control: {
type: 'textinput',
choices: [
{ key: 'S', label: 'WiFi SSID of network', defineLine: '#define WIFI_INFRASTRUCTURE_MODE_SSID "{0}"' },
{ key: 'P', label: 'WPA Key for network', defineLine: '#define WIFI_INFRASTRUCTURE_MODE_WPAKEY "{0}"' },
{ key: 'N', label: 'WPA Key for OAT hotspot', defineLine: '#define WIFI_AP_MODE_WPAKEY "{0}"' },
{ key: 'H', label: 'Hostname', defaultValue: 'OATScope', defineLine: '#define WIFI_HOSTNAME "{0}"' },
]
},
}
];
// Focuser steps (OAT/OAM)
export const createFocuserSteps = () => [
{
id: 'FC',
title: 'Focuser support',
label: 'Do you want to support a focuser on E1:',
variable: 'focuser',
condition: "($board IN [M,M10,M20,M21])",
preamble: ['////////////////////////////////', '// Focuser configuration ', '// Define whether to support a focusing stepper motor on E1 or not. Currently: {v}'],
define: '',
control: {
type: 'radioimg',
choices: [
{ key: 'N', value: 'No Focuser', image: '/images/none.png', additionalLines: ['// No Focuser settings'] },
{ key: 'Y', value: 'Focuser stepper', image: '/images/focuser.png' },
]
},
},
{
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}' },
]
},
}
];
// Hall sensor steps (OAT/OAM)
export const createHallSensorSteps = () => [
{
id: 'RAH',
title: 'RA Auto Home via Hall sensors',
label: 'Do you have the Hall sensor-based AutoHome add ons installed on the RA axis:',
variable: 'hallhomera',
condition: "($board IN [M,M21])",
preamble: ['////////////////////////////////', '// Auto Homing addons'],
define: 'USE_HALL_SENSOR_RA_AUTOHOME',
control: {
type: 'radioimg',
choices: [
{ key: 'N', value: 'No RA Hall sensor homing', image: '/images/none.png', defineValue: '0' },
{ key: 'Y', value: 'RA Homing Hall sensor installed', image: '/images/none.png', defineValue: '1' },
]
},
},
{
id: 'RAHA',
title: 'RA Auto Home Settings',
label: 'What settings would you like to use for the RA homing sensor:',
variable: 'hallhomerasettings',
condition: "($hallhomera == Y)",
define: '',
control: {
type: 'textinput',
choices: [
{ key: 'P', label: 'Pin that sensor is attached to', defaultValue: '{Defaults.RAHallSensorPin.tracker}', defineLine: '#define RA_HOMING_SENSOR_PIN {0}' },
{ key: 'S', label: 'Number of degrees to search for sensor', defaultValue: '10', defineLine: '#define RA_HOMING_SENSOR_SEARCH_DEGREES {0}' },
]
},
}
];
// 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' },
]
},
}
];