I am currently working on a project, where I design a PID-Controller for a 2-axis stabilization with brushless-propeller-motors.
My question is: Does an Arduino UNO have enough computing power to perform this task in a useful manner? Arduino UNO Specs
And secondly: If the UNO was really too slow for this task, would the newly released Arduino ZERO PRO perform at an acceptable rate? Arduino ZERO PRO Specs
Thanks for your help and inputs in advance!
-
2what bandwidth do you require? that's the real question. Can you complete the accumulation tasks before your next sample is due to satisfy your system bandwidthJonRB– JonRB2015年05月31日 18:25:47 +00:00Commented May 31, 2015 at 18:25
-
JonRB is exactly right! And don't forget about any processing which needs to be done on the sensor inputs before getting to the PIDs. Also note: on the UNO a floating-point PID implementation will be much slower than a 'long' PID implementation.Jay J– Jay J2015年05月31日 18:32:11 +00:00Commented May 31, 2015 at 18:32
-
1PID is a relatively simple algorithm. You probably only need something like 50 updates per second at the most (wild guess). So my guess, on the limited amount of info given, is that the uno will do fine.Gerben– Gerben2015年05月31日 19:03:16 +00:00Commented May 31, 2015 at 19:03
-
@Jay J floating point math is not that much slower than fixed on the UNO. In my experience the time savings (if any) have not been worth the extra work to do fixed point safely.BrettFolkins– BrettFolkins2015年05月31日 19:14:14 +00:00Commented May 31, 2015 at 19:14
1 Answer 1
Assuming you're not doing anything too fancy, yes, it should be fine.
There's even a library to do all the work for you: http://playground.arduino.cc/Code/PIDLibrary
-
Also look for the ospid project which is a full hardware/software arduino based pidhildred– hildred2015年06月26日 03:06:10 +00:00Commented Jun 26, 2015 at 3:06