I think you will run out of GPIO pins before you get to 40 servos so you may have to use arduinos as well or an additional pi.MauiSunset wrote:Hi - this is my first post to what looks like a fantastic resource for us developers!
What I'm trying to do:
I'm building a device that controls up to 40 servo motors and each one must be turned on and off to a tolerance of 1/10 of a second. I've played with the Arduino and got one servo working, but now I need to think of programming and 40 servos working. This is going in a unit sold to consumers and will be maintained and monitored via WiFi. The unit itself will be driven by Apps on cell phones and there will be a touch screen on the unit used daily by the operator.
True but unless you are very compute intensive I should have thought 0.1 second tolerance should be ok. I would like to see real evidence that "random" garbage collection is a real problem. What might be more important is the "Global Interpretter Lock" that stops a multi threaded python program using multiple cores. This would probably only matter if your code is compute intensive.I picked the Raspberry Pi 2 and Python as the tools to do the job. However now I'm now reading that the garbage collection in Python is random and can interfere with real time operations and Linux is multitasking that can cause a servo to miss a cycle or shorten the time it is on because I can't set a priority level for my program. My high hopes are now being deflated by reality.
I have played with python but not done anything like this for real. Perhaps someone else can give a more qualified reply.I could develop in C++ but it will take 5 times as long to produce the software and the Quad processor on the Pi 2 should handle the Python interpreter to a tolerance of 1/10 of a second with no problem - that's my assumptions that are now being challenged with comments from other developers.
I'm assuming many here have worked with the Pi 2 and Python and might have some real-time experience that might save me thousands of man hours just to learn that garbage collection means more to the Pi and Linux than my program.
Thanks for any input...
It sounds like you have managed to keep pace with them.MauiSunset wrote: I just remember programming in Basic 30+ years ago and the garbage collection problem hurt me then on a time critical program - sounds like the geeks in academia haven't made much progress in that area in 30 years.
So a newbie then. My first programs were on 5 hole paper tape sent by van to a Ferranti computer that used valves (vacuum tubes) not transistors.MauiSunset wrote:I'm 68 years old and still programming - I remember punching in Hex into some Heath Kit that had 4 K memory and thought I was in heaven then...
That's my leaning at this time - for the past 20 years I have only worked with prototyping systems and then turned over the fully functional system to an army of kids who program in C++.RogerW wrote:So a newbie then. My first programs were on 5 hole paper tape sent by van to a Ferranti computer that used valves (vacuum tubes) not transistors.MauiSunset wrote:I'm 68 years old and still programming - I remember punching in Hex into some Heath Kit that had 4 K memory and thought I was in heaven then...
Seriously I would stick to python. If you eventally find real problems you will have a prototype that you can translate into C++ so the investment will not be wasted.