Skip to content

Commit 86556d8

Browse files
committed
fix issue #152: lower max speed to 70kSteps/s
1 parent ae0cb43 commit 86556d8

9 files changed

Lines changed: 24 additions & 21 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ TODO:
33
- #include-file structure needs to be cleaned up
44
- setCurrentPosition() should adjust the maintained last position bits in queue. can be called a bug
55

6+
0.28.3:
7+
- reduce AVR max single stepper speed to 70kSteps/s due to issue [Issue #152](https://github.com/gin66/FastAccelStepper/issues/152)
8+
69
0.28.2:
7-
- fix for issue [Issue #150](https://github.com/gin66/FastAccelStepper/issues/150)
10+
- fix for issue [Issue #150](https://github.com/gin66/FastAccelStepper/issues/150) for low speed not reducing below startup speed
811

912
0.28.1:
1013
- try to fix [Issue #142](https://github.com/gin66/FastAccelStepper/issues/142) for esp32 mcpwm/pcnt and format code

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,21 @@ Comments to pin sharing:
9696

9797
### AVR ATMega 328
9898

99-
* allows up to 76000 generated steps per second for single stepper operation, 37000 for dual stepper
99+
* allows up to 70000 generated steps per second for single stepper operation, 37000 for dual stepper
100100
* supports up to two stepper motors using Step/Direction/Enable Control (Direction and Enable is optional)
101101
* Uses `F_CPU` Macro for the relation tick value to time, so it should now not be limited to 16 MHz CPU frequency (untested)
102102
* Steppers' command queue depth: 16
103103

104104
### AVR ATMega 32u4
105105

106-
* allows up to 76000 generated steps per second for single stepper operation, 37000 for dual stepper and 25000 for three steppers
106+
* allows up to 70000 generated steps per second for single stepper operation, 37000 for dual stepper and 25000 for three steppers
107107
* supports up to three stepper motors using Step/Direction/Enable Control (Direction and Enable is optional)
108108
* Uses `F_CPU` Macro for the relation tick value to time, so it should now not be limited to 16 MHz CPU frequency (untested)
109109
* Steppers' command queue depth: 16
110110

111111
### AVR ATMega 2560
112112

113-
* allows up to 76000 generated steps per second for single stepper operation, 37000 for dual stepper and 25000 for three steppers
113+
* allows up to 70000 generated steps per second for single stepper operation, 37000 for dual stepper and 25000 for three steppers
114114
* supports up to three stepper motors using Step/Direction/Enable Control (Direction and Enable is optional)
115115
* Uses `F_CPU` Macro for the relation tick value to time, so it should now not be limited to 16 MHz CPU frequency (untested)
116116
* Steppers' command queue depth: 16

‎examples/Issue151/Issue151.ino‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void setup() {
4040
void loop() {
4141
// test to check single stepper high speed operation
4242
int32_t target = 20000;
43-
stepper->setSpeedInHz(75000);
43+
stepper->setSpeedInHz(70000);
4444
stepper->moveTo(target);
4545
while(stepper->isRunning()) {
4646
};

‎examples/Issue152/Issue152.ino‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void setup() {
4040
void loop() {
4141
// test to check single stepper high speed operation
4242
int32_t target = 20000;
43-
stepper->setSpeedInHz(75000);
43+
stepper->setSpeedInHz(70000);
4444
stepper->moveTo(target);
4545
while(stepper->isRunning()) {
4646
};

‎extras/tests/simavr_based/test_sd_04_timing_2560/expect.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Time in EnableA max=217159 us, total=217159 us
1717

1818
Time in EnableB max=233738 us, total=233738 us
1919

20-
Time in EnableC max=242116 us, total=242116 us
20+
Time in EnableC max=242115 us, total=242115 us
2121

2222
Time in FillISR max=3655 us, total=2140393 us
2323

‎extras/tests/simavr_based/test_sd_04_timing_328p/expect.txt‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
DirB: 1*L->H, 0*H->L
33
EnableA: 1*L->H, 1*H->L
44
EnableB: 2*L->H, 1*H->L
5-
StepA: 1000*L->H, 1000*H->L, Max High=15us Total High=5505us
6-
StepB: 1000*L->H, 1000*H->L, Max High=17us Total High=5540us
5+
StepA: 1000*L->H, 1000*H->L, Max High=15us Total High=5504us
6+
StepB: 1000*L->H, 1000*H->L, Max High=17us Total High=5497us
77
Position[A]=1000
88

99
Position[B]=1000
1010

11-
Time in EnableA max=213060 us, total=213060 us
11+
Time in EnableA max=213059 us, total=213059 us
1212

13-
Time in EnableB max=225632 us, total=225632 us
13+
Time in EnableB max=225630 us, total=225630 us
1414

15-
Time in FillISR max=2409 us, total=46255 us
15+
Time in FillISR max=2409 us, total=46246 us
1616

17-
Time in StepA max=15 us, total=5505 us
17+
Time in StepA max=15 us, total=5504 us
1818

19-
Time in StepB max=17 us, total=5540 us
19+
Time in StepB max=17 us, total=5497 us
2020

2121
Time in StepISR max=7 us, total=9224 us
2222

‎extras/tests/simavr_based/test_sd_04_timing_328p_37k/expect.txt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
DirB: 1*L->H, 0*H->L
33
EnableA: 1*L->H, 1*H->L
44
EnableB: 1*L->H, 0*H->L
5-
StepA: 1000*L->H, 1000*H->L, Max High=12us Total High=5258us
5+
StepA: 1000*L->H, 1000*H->L, Max High=12us Total High=5262us
66
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
77
Position[A]=1000
88

9-
Time in EnableA max=213060 us, total=213060 us
9+
Time in EnableA max=213059 us, total=213059 us
1010

11-
Time in FillISR max=1937 us, total=26708 us
11+
Time in FillISR max=1937 us, total=26715 us
1212

13-
Time in StepA max=12 us, total=5258 us
13+
Time in StepA max=12 us, total=5262 us
1414

1515
Time in StepISR max=7 us, total=4581 us
1616

‎library.properties‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name=FastAccelStepper
2-
version=0.28.2
2+
version=0.28.3
33
1icense=MIT
44
author=Jochen Kiemes <jochen@kiemes.de>
55
maintainer=Jochen Kiemes <jochen@kiemes.de>
66
sentence=A high speed stepper library for Atmega 328p (nano), 32u4 (leonardo), 2560, ESP32, ESP32S2 and Atmel SAM Due
7-
paragraph=Drive stepper motors with acceleration/deceleration profile up to 76 kSteps/s (Atmega) and 200kSteps/s (esp32).
7+
paragraph=Drive stepper motors with acceleration/deceleration profile up to 70 kSteps/s (Atmega) and 200kSteps/s (esp32).
88
url=https://github.com/gin66/FastAccelStepper
99
repository=https://github.com/gin66/FastAccelStepper.git
1010
architectures=avr,esp32,sam

‎src/StepperISR_avr.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ void StepperQueue::adjustSpeedToStepperCount(uint8_t steppers) {
347347
// using test_sd_04_timing_328p version 0.25.6 as reference
348348
// manageStepper (fillISR) already needs max 2.3 ms !
349349
//
350-
max_speed_in_ticks = 213 * steppers;
350+
max_speed_in_ticks = (steppers == 1) ? 228 : 213 * steppers;
351351
}
352352

353353
void fas_init_engine(FastAccelStepperEngine* engine, uint8_t cpu_core) {

0 commit comments

Comments
 (0)