stepper.h

Nutsy
Mon Jul 25, 2016 2:53 pm
I realise its a fairly simply control library, But ive noticed it doesnt seem to fully work under STM.

Running the same code in STM i get very very slow stepper move loops…
Anyone know whats causing it and how to make it go fast again? :D


RogerClark
Mon Jul 25, 2016 9:56 pm
where is this file?

Nutsy
Tue Jul 26, 2016 12:54 pm
Hmm its in the core library of arduino… Tbh dont worry about it. The library works… Just for some reason its very slow on the stm. Its just a set of bit read outs and if statements. It shouldn’t be this slow and tbh shouldn’t need porting.

Sorry


madias
Tue Jul 26, 2016 1:17 pm
I think the problem is in line 177 of stepper.cpp
this->step_delay = 60L * 1000L * 1000L / this->number_of_steps / whatSpeed;

madias
Tue Jul 26, 2016 1:37 pm
I would give the acc stepper library a try:
https://www.pjrc.com/teensy/td_libs_AccelStepper.html

Nutsy
Wed Jul 27, 2016 7:48 pm
trying to run the accel stepper lib but getting an error

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -hardware "/Users/Helen/Library/Arduino15/packages" -hardware "/Users/Helen/Documents/Arduino/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -tools "/Users/Helen/Library/Arduino15/packages" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/Helen/Documents/Arduino/libraries" -fqbn=Arduino_STM32:STM32F1:mapleMini:bootloader_version=bootloader20 -ide-version=10609 -build-path "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/arduino_modified_sketch_49855/ProportionalControl.pde"
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -hardware "/Users/Helen/Library/Arduino15/packages" -hardware "/Users/Helen/Documents/Arduino/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -tools "/Users/Helen/Library/Arduino15/packages" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/Helen/Documents/Arduino/libraries" -fqbn=Arduino_STM32:STM32F1:mapleMini:bootloader_version=bootloader20 -ide-version=10609 -build-path "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/arduino_modified_sketch_49855/ProportionalControl.pde"
Warning: platform.txt from core 'STM32 Boards (STM32duino.com)' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
"/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_maple_mini -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_MAPLE_MINI -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -DSERIAL_USB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -DSERIAL_USB -mthumb -march=armv7-m -D__STM32F1__ "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/include" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/stm32f1/include" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/stm32f1" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/usb_lib" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/cores/maple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/variants/maple_mini" "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp/sketch/ProportionalControl.pde.cpp" -o "/dev/null"
"/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_maple_mini -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_MAPLE_MINI -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -DSERIAL_USB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -DSERIAL_USB -mthumb -march=armv7-m -D__STM32F1__ "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/include" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/stm32f1/include" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/stm32f1" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/usb_lib" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/cores/maple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/variants/maple_mini" "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp/sketch/ProportionalControl.pde.cpp" -o "/dev/null"
"/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_maple_mini -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_MAPLE_MINI -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -DSERIAL_USB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -DSERIAL_USB -mthumb -march=armv7-m -D__STM32F1__ "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/include" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/stm32f1/include" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/stm32f1" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/usb_lib" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/cores/maple" "-I/Users/Helen/Documents/Arduino/hardware/Arduino_STM32/STM32F1/variants/maple_mini" "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp/sketch/ProportionalControl.pde.cpp" -o "/var/folders/sn/kx4gb1293p36_qjhrml9gshw0000gn/T/builddf1314cd6eb98113cb271cf322217ada.tmp/preproc/ctags_target_for_gcc_minus_e.cpp"
fork/exec /bin/arm-none-eabi-g++: no such file or directory
Error compiling for board Maple Mini.


martinayotte
Wed Jul 27, 2016 8:44 pm
Did you upgraded your IDE recently ?
Becuase it seems that you lost the toolchain path, and/or it can not read the plateform.txt file properly

Warning: platform.txt from core 'STM32 Boards (STM32duino.com)' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
"/bin/arm-none-eabi-g++" ...


Nutsy
Wed Jul 27, 2016 9:11 pm
Hmmm nope but I have been tidying up the library folder as i was trying all sorts and some conflicted…

Its possible i might have moved that file. Though its not there now. Im trying to find the download to put it back


Nutsy
Thu Jul 28, 2016 12:27 am
found it, it in the hardware folder… looking inside the file it seems complete… no corrupted text, complete code. If there anything I can do to fix the links?

davey
Wed Jun 28, 2017 10:03 pm
Fast again? You mean it was working faster before or do you mean fast as compared to an Arduino?

I upgraded to STM32 partially because Arduino stepping is too slow. I hope it will be much faster though I’m also considering using hardware timers for pulses. Haven’t found a lot of info in that. :-(

I wrote the Accelstepper code last night and hope to test it tonite :-) I’ll let you know if I run across something related to your error but that sounds like a general tool chain issue than anything related to the library.

I’m a noob at stm32duino but if it were me I’d try reinstalling stm32duino. Maybe that’ll restore the tool path. Which ide are you using?

Davey

[Nutsy – Mon Jul 25, 2016 2:53 pm] –
I realise its a fairly simply control library, But ive noticed it doesn’t seem to fully work under STM.

Running the same code in STM i get very very slow stepper move loops…
Anyone know whats causing it and how to make it go fast again? :D


Nutsy
Fri Jun 30, 2017 9:45 am
WOW, year old thread reborn :p

Im way past from this issue. So much so ive completely forgot what it was :p

Im using x27 motor gauge steppers now… Manually driving them from a arduino mini.

And theyre fine. A little noisy but fine. Seem to get enough current from the arduino pins directly.

Im also using a tweaked version of the x27 stepper library… I tweaked it…
Cant remember what i did though :p

As for IDE i use eclipse now. But still using arduino for building. Eclipse doesnt always seem to correctly build some libraries for some reason, must be something missing in the sloeber toolchain.


JTC
Tue Dec 19, 2017 8:40 pm
Roger, I need to control one stepper motor. I am looking at the Accelstepper lib. I see it says max speed for Arduino is 4,000/sec.
Is the speed of the STM32F103 just the ratio of the crystals*4,000?
Arduino 16mhz = 4,000/sec. 72mhz/16mhz = 4.5.

4.5* 4,000 = 18,000/sec.
is this correct?


victor_pv
Wed Dec 20, 2017 6:10 am
I do not know the library you are using, but in Marlin I can run steppers at over 40Khz with interrupts in the F1, and that’s while doing several other things at the same time, so you should be able to achieve those 18000 steps/s easily.

Leave a Reply

Your email address will not be published. Required fields are marked *