Thanks to Danny I discovered FreeRTOS that probably will make controlling the 7 stepper motors fluently. It is a small "Real Time Operating System" (RTOS) designed for small devices.
I went to the FreeRTOS web site but when I unzipped the files, I did not find a Arduino Sketch version.
In the end I found out how easily you can install it from Sketch itself.
Open Arduino Sketch
Once installed you are ready to go.
The source code fro that Arduino version is coming from: https://github.com/feilipu/Arduino_FreeRTOS_Library
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
My browser did some strange things, sorry for the many 'Hi's' :-)
I continue my conversation,
Use this script,
#include <TaskScheduler.h>
void vStp01TaskON();
void vStp02TaskON();
void vStp03TaskON();
Scheduler TS;
Task t1(10, TASK_FOREVER, &vStp01TaskON,&TS); // 10ms task
Task t2(500, TASK_FOREVER, &vStp02TaskON,&TS); // 500ms task
Task t3(100, TASK_FOREVER, &vStp03TaskON, &TS); // 100ms task
t1.enable();void setup(){
t2.enable();
}t3.enable();
void loop() {
TS.execute();
}
// TASK 01
// do your thing every 10ms...void vStp01TaskON() {
}
// TASK 01
void vStp02TaskON() {
// do your thing every 500ms...
}
// TASK 03
void vStp03TaskON() {
// do your thing every 100ms...
This works perfect!}
Are you sure? yes | no
Hi,
It's not really multitasking, the processor has one hardware thread, so what the do is pausing things in software and handle the rest of it. I worked with RTOS but it wasn't that good, did go to the standard arduino library 'TaskScheduler' works perfect for me!
#include <TaskScheduler.h>
Are you sure? yes | no
HI,
Are you sure? yes | no
Hi,
Are you sure? yes | no
No I want to develop it myself from scratch. This Thor project for me it is a learning process, it does not matter if I build it or not. This FreeTOS would severely slow down my performance in movement. The time to learn this OS would take the same amount for me to develop from scratch.
Are you sure? yes | no
Do you still use FreeRTOS today?
Are you sure? yes | no