Skip to content

Commit 35827ca

Browse files
V1.7.25.Az01 - Updates
- Switched to Left/Right buttons - Slowed down the motor - Accelerated slower - Decelerated slower - Assigned pins 38, 40, 42, and 44 to Azimuth motor.
1 parent 336533e commit 35827ca

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

Software/Arduino code/OpenAstroTracker/Mount.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,9 @@ void Mount::configureDECStepper(byte stepMode, byte pin1, byte pin2, byte pin3,
311311
_maxDECAcceleration = maxAcceleration;
312312

313313
#if AZIMUTH_MOTOR
314-
_stepperAZ = new AccelStepper(FULLSTEP, PINA1, PINA3, PINA2, PINA4);
314+
_stepperAZ = new AccelStepper(FULLSTEP, 38, 42, 40, 44);
315315
_stepperAZ ->setSpeed(0);
316-
_stepperAZ ->setMaxSpeed(400);
316+
_stepperAZ ->setMaxSpeed(300);
317317
_stepperAZ->setAcceleration(400);
318318
#endif
319319
}

Software/Arduino code/OpenAstroTracker/c76_menuCAL.hpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,36 +149,43 @@ bool processCalibrationKeys() {
149149
}
150150
}
151151
else if (calState == AZIMUTH_CONTROL) {
152-
if (lcdButtons.currentState() == btnUP) {
152+
if (lcdButtons.currentState() == btnLEFT) {
153+
// Speed up to the left
153154
if (AzimuthSpeed < 100) {
154155
AzimuthSpeed += 1; //0.0001;
155156
}
156157

157-
calDelay = max(2, 0.96 * calDelay);
158+
// Accelerate speed increase over time
159+
calDelay = max(2, 0.98 * calDelay);
158160
checkForKeyChange = false;
159161
}
160-
else if (lcdButtons.currentState() == btnDOWN) {
162+
else if (lcdButtons.currentState() == btnRIGHT) {
163+
// Speed up to the right
161164
if (AzimuthSpeed > -100) {
162165
AzimuthSpeed -= 1; //0.0001;
163166
}
164167

165-
calDelay = max(2, 0.96 * calDelay);
168+
// Accelerate speed increase over time
169+
calDelay = max(2, 0.98 * calDelay);
166170
checkForKeyChange = false;
167171
}
168172
else {
173+
// No more buttons pressed, decelerate at 3% per cycle
169174
if (AzimuthSpeed > 0) {
170-
AzimuthSpeed = adjustClamp(AzimuthSpeed, -5, 0, 100);
175+
AzimuthSpeed = adjustClamp(AzimuthSpeed, -3, 0, 100);
171176
}
172177
else if (AzimuthSpeed < 0) {
173-
AzimuthSpeed = adjustClamp(AzimuthSpeed, 5, -100, 0);
178+
AzimuthSpeed = adjustClamp(AzimuthSpeed, 3, -100, 0);
174179
}
175180
else {
181+
// Once we're stopped, set the initial key delay back to 100ms
176182
calDelay = 100;
177183
}
178184
}
179185

186+
// If we changed speeds, tell the mount motor
180187
if (AzimuthSpeed != lastAzimuthSpeed) {
181-
mount.setSpeed(AZIMUTH_STEPS, 500.0 * AzimuthSpeed / 100.0);
188+
mount.setSpeed(AZIMUTH_STEPS, 300.0 * AzimuthSpeed / 100.0);
182189
lastAzimuthSpeed = AzimuthSpeed;
183190
}
184191

0 commit comments

Comments
 (0)