Skip to content

Commit

Permalink
fix issue #152: lower max speed to 70kSteps/s
Browse files Browse the repository at this point in the history
  • Loading branch information
gin66 committed Dec 7, 2022
1 parent ae0cb43 commit 86556d8
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 21 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ TODO:
- #include-file structure needs to be cleaned up
- setCurrentPosition() should adjust the maintained last position bits in queue. can be called a bug

0.28.3:
- reduce AVR max single stepper speed to 70kSteps/s due to issue [Issue #152](https://github.com/gin66/FastAccelStepper/issues/152)

0.28.2:
- fix for issue [Issue #150](https://github.com/gin66/FastAccelStepper/issues/150)
- fix for issue [Issue #150](https://github.com/gin66/FastAccelStepper/issues/150) for low speed not reducing below startup speed

0.28.1:
- try to fix [Issue #142](https://github.com/gin66/FastAccelStepper/issues/142) for esp32 mcpwm/pcnt and format code
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,21 @@ Comments to pin sharing:

### AVR ATMega 328

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

### AVR ATMega 32u4

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

### AVR ATMega 2560

* allows up to 76000 generated steps per second for single stepper operation, 37000 for dual stepper and 25000 for three steppers
* allows up to 70000 generated steps per second for single stepper operation, 37000 for dual stepper and 25000 for three steppers
* supports up to three stepper motors using Step/Direction/Enable Control (Direction and Enable is optional)
* Uses `F_CPU` Macro for the relation tick value to time, so it should now not be limited to 16 MHz CPU frequency (untested)
* Steppers' command queue depth: 16
Expand Down
2 changes: 1 addition & 1 deletion examples/Issue151/Issue151.ino
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void setup() {
void loop() {
// test to check single stepper high speed operation
int32_t target = 20000;
stepper->setSpeedInHz(75000);
stepper->setSpeedInHz(70000);
stepper->moveTo(target);
while(stepper->isRunning()) {
};
Expand Down
2 changes: 1 addition & 1 deletion examples/Issue152/Issue152.ino
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void setup() {
void loop() {
// test to check single stepper high speed operation
int32_t target = 20000;
stepper->setSpeedInHz(75000);
stepper->setSpeedInHz(70000);
stepper->moveTo(target);
while(stepper->isRunning()) {
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Time in EnableA max=217159 us, total=217159 us

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

Time in EnableC max=242116 us, total=242116 us
Time in EnableC max=242115 us, total=242115 us

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

Expand Down
14 changes: 7 additions & 7 deletions extras/tests/simavr_based/test_sd_04_timing_328p/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 2*L->H, 1*H->L
StepA: 1000*L->H, 1000*H->L, Max High=15us Total High=5505us
StepB: 1000*L->H, 1000*H->L, Max High=17us Total High=5540us
StepA: 1000*L->H, 1000*H->L, Max High=15us Total High=5504us
StepB: 1000*L->H, 1000*H->L, Max High=17us Total High=5497us
Position[A]=1000

Position[B]=1000

Time in EnableA max=213060 us, total=213060 us
Time in EnableA max=213059 us, total=213059 us

Time in EnableB max=225632 us, total=225632 us
Time in EnableB max=225630 us, total=225630 us

Time in FillISR max=2409 us, total=46255 us
Time in FillISR max=2409 us, total=46246 us

Time in StepA max=15 us, total=5505 us
Time in StepA max=15 us, total=5504 us

Time in StepB max=17 us, total=5540 us
Time in StepB max=17 us, total=5497 us

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

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
StepA: 1000*L->H, 1000*H->L, Max High=12us Total High=5258us
StepA: 1000*L->H, 1000*H->L, Max High=12us Total High=5262us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=1000

Time in EnableA max=213060 us, total=213060 us
Time in EnableA max=213059 us, total=213059 us

Time in FillISR max=1937 us, total=26708 us
Time in FillISR max=1937 us, total=26715 us

Time in StepA max=12 us, total=5258 us
Time in StepA max=12 us, total=5262 us

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

4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name=FastAccelStepper
version=0.28.2
version=0.28.3
1icense=MIT
author=Jochen Kiemes <[email protected]>
maintainer=Jochen Kiemes <[email protected]>
sentence=A high speed stepper library for Atmega 328p (nano), 32u4 (leonardo), 2560, ESP32, ESP32S2 and Atmel SAM Due
paragraph=Drive stepper motors with acceleration/deceleration profile up to 76 kSteps/s (Atmega) and 200kSteps/s (esp32).
paragraph=Drive stepper motors with acceleration/deceleration profile up to 70 kSteps/s (Atmega) and 200kSteps/s (esp32).
url=https://github.com/gin66/FastAccelStepper
repository=https://github.com/gin66/FastAccelStepper.git
architectures=avr,esp32,sam
Expand Down
2 changes: 1 addition & 1 deletion src/StepperISR_avr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ void StepperQueue::adjustSpeedToStepperCount(uint8_t steppers) {
// using test_sd_04_timing_328p version 0.25.6 as reference
// manageStepper (fillISR) already needs max 2.3 ms !
//
max_speed_in_ticks = 213 * steppers;
max_speed_in_ticks = (steppers == 1) ? 228 : 213 * steppers;
}

void fas_init_engine(FastAccelStepperEngine* engine, uint8_t cpu_core) {
Expand Down

0 comments on commit 86556d8

Please sign in to comment.