Experience with servo controllers?
r.daneel
Posts: 96
I'm working on a project that uses 5 servos. I'm driving the servos with a Pololu Micro Maestro 6-channel servo controller, but the question here is a generic one regarding servo controllers.
I want to make fairly rapid changes to the servos - I want to make up to 5 changes per second per servo, so maybe 25 changes per second overall (no servos change at the same time). I seem to be hitting a problem with the rate at which the servo controller processes commands - which is something that I confess didn't even occur to me when I was designing this project.
The prop communicates with the servo controller via TTL serial at 19.2k baud. The command to set the position for a servo consists of 4 bytes, and I send one command to the controller for each servo up to 5 times a second, so up to 25 commands per second. Anything over about 8 commands per second causes an error on the servo controller, and it stops driving the servos - a red error light comes on and querying the controller for the error code indicates a serial overrun error. If I lower the rate at which I send commands to 8 per second I can run like that for hours and the servos happily swing to wherever I want them. Anything more than 8 commands per second and gets me the red error light and no servo action (the faster the rate the quicker the red light appears - 9 or 10 commands per second takes a couple of minutes to cause the error, whereas at 20 commands per second the error appears in 15 seconds or so).
I haven't thought about it hard enough yet to work out whether I can get around the problem by setting multiple servos in a single command - that's not available on the controller I have (but is in varying degrees on other controllers), and I don't really want to do it anyway. Maybe I just have to ditch the servo controller and control the servos directly from the prop - might cost me a few cogs and IO pins but it might be my only option.
Has anybody had any experience with different servo controllers (e.g. Parallax (I know it's discontinued), LynxMotion etc)? I imagine they are all speed limited in the sense that commands take some time to process, but does anyone know of a controller out there that will process commands at or better than (say) 25 per second? Unless of course I am missing something and the problem is not the command processing rate of the servo controller... I don't know what that would be though, but 8 commands per second seems to be a fairly low rate.
I want to make fairly rapid changes to the servos - I want to make up to 5 changes per second per servo, so maybe 25 changes per second overall (no servos change at the same time). I seem to be hitting a problem with the rate at which the servo controller processes commands - which is something that I confess didn't even occur to me when I was designing this project.
The prop communicates with the servo controller via TTL serial at 19.2k baud. The command to set the position for a servo consists of 4 bytes, and I send one command to the controller for each servo up to 5 times a second, so up to 25 commands per second. Anything over about 8 commands per second causes an error on the servo controller, and it stops driving the servos - a red error light comes on and querying the controller for the error code indicates a serial overrun error. If I lower the rate at which I send commands to 8 per second I can run like that for hours and the servos happily swing to wherever I want them. Anything more than 8 commands per second and gets me the red error light and no servo action (the faster the rate the quicker the red light appears - 9 or 10 commands per second takes a couple of minutes to cause the error, whereas at 20 commands per second the error appears in 15 seconds or so).
I haven't thought about it hard enough yet to work out whether I can get around the problem by setting multiple servos in a single command - that's not available on the controller I have (but is in varying degrees on other controllers), and I don't really want to do it anyway. Maybe I just have to ditch the servo controller and control the servos directly from the prop - might cost me a few cogs and IO pins but it might be my only option.
Has anybody had any experience with different servo controllers (e.g. Parallax (I know it's discontinued), LynxMotion etc)? I imagine they are all speed limited in the sense that commands take some time to process, but does anyone know of a controller out there that will process commands at or better than (say) 25 per second? Unless of course I am missing something and the problem is not the command processing rate of the servo controller... I don't know what that would be though, but 8 commands per second seems to be a fairly low rate.
Comments
While you can do it with your Prop, since you're already thinking of a separate controller anyway, why not get the least expensive Propeller board, and implement your own? The firmware for the now-discontinued Propeller servo controller is available for download, so you can modify as you wish. It's designed to take commands for a single servo at a time, but of course you could structure the command sequence to do just about anything you want.
The only thing left is to create for yourself a small interface board for the servos with common distributed power and ground.
Additional the servo needs time to reach the new position. The time for that depends on the servos speed and the degrees you want to turn the servos.
More advanced servos reduced the time down to around 10 milliseconds.
So please tell us what you want to do in the end. Maybe the task can be solved on different ways
best regards
Stefan
Can't you use this Beau's object ( http://obex.parallax.com/object/524) directly from within your Prop?
Stefan, actually it's an academic exercise - I teach a robotics class at my kids' high school (years 7 - 10), and this was just an exercise to mount Pings on servos to cover a full 360-degree field of vision. The idea was to have the servos swing and take sonar readings at defined intervals. So, yes, there are probably various ways to achieve that but, as I said, it's really an academic exercise. The maximum change rate per servo is 50 times per second, but we didn't want to get anywhere near that.
As it happens though, I think the problem was really a hardware problem - I believe one of my voltage regulators was getting hot (through a silly mistake). I have several voltage regulators to supply different rails, and in operation these are supplied power from different batteries - a 6.6V battery for 3.3V and 5V regulators, and a 9.9V battery for a 7.5V regulator. However, I was running off a single bench supply while testing, and that supply had been turned up to 15V. When I turned it down 10V everything magically worked. This was a consistent result - if I turned the supply up to 15V the red light on the servo controller would come on after 20 or so seconds, and if I turned it back down to 10V the red light would go out and stay out. I am a software person with a superficial, but reasonable, understanding of electronics, but was thoroughly confused by what was happening until I discussed it with someone far more knowledgeable than me. It seems that with an input of 15V my 5V regulator had to dissipate too much energy and was getting hot and breaking down. With a 10V input it doesn't need to discard so much energy so doesn't get so hot. It was purely by chance that I happened to notice the supply had been turned up to 15V - it is not something I would have even thought about checking. I had checked the outputs of the regulators and they were all correct... I'm now looking at switching regulators instead of linear regulators.
So, ultimately my superficial understanding of electronics was the cause of this problem - but I learned something, and every day I learn something is a good day :-)