I am a college engineering student working on this for a project. We have some resources of our own, but it's more of a time constraint issue as much as anything. I am not an electrical engineer nor do I have a huge amount of experience with programming, so I'm mainly focused on finding a C/C++ library that I can use and adapt to our needs. I have found a ton of stuff for python but am having issues with finding C stuff. If we cannot find something in C, I will try to create my own I guess (using similar GPIO libraries in C and python), but I would much rather not reinvent the wheel if possible.
PiGraham wrote: Do you have a specific servomotor in mind?
These will be various DC brush type motors with gear heads for low grade servo positioning, but generally 24VDC in the 3 - 5A range.
PiGraham wrote: You would need a drive stage, have you found one?
We will make or buy a drive stage for it. The readily available servoamps in the $200 range are out of our price bracket for this project.
PiGraham wrote: What encoder signals will you have?
Initially it will be a pot less than 330 degrees rotation is all that is needed); later versions may use low grade/cheaper resolvers if we can manage the conversion hardware in a price package that is compatible with the RPi prices (not easy). We are not using optical encoders.
PiGraham wrote: What response do you need from the control loop for what sort of loads?
Mechanical system bandwidth will be in the 1 - 10 hz range so the control loop rate will be in the 10 - 100 hz range depending on the application. We might like 200 hz max but don't want to push our luck on what the RPi can do. Load will vary greatly depending on application. For now we will be looking at relatively simple servo positioning using PID control code that we will write later.
PiGraham wrote: Could things get nasty if the control went wrong? (then don't use a RasPi)
The purpose of this work is specifically to look at what we can do with the RPi (what are the practical limits?) so that's not really a concern at this point. This is more of an experimental exercise.
PiGraham wrote:In principle the Pi could implement a servo control loop via PWM and encoder feedback, but it won't be suitable for all servomotor applications. Give us some clues.
We do want to look at using the RPi to drive a motor (via output stage) with the PWM and with analog pot feedback. The application is to look at limits of what we can do with the RPi and not so much a specific application, but we are headed towards using the RPi for light duty teleoperated and robotic manipulator control on a scale where RC servos are not practical. The key missing element is/are the interface library/libraries necessary to drive the low level. We're assuming that Python won't be sufficient and that C/C++ will be required. We'll take care of the servo positioning code.
PiGraham wrote: Some people hack RC servos and connect the control to a beefier output stage and link the feedback pot so they can drive bigger motors as if they were RC servos.
We're not interested in using RC servos at this time, but we do think that this is an interesting approach and would like to look at it in the future. However it is not in the current scope of our project.