PDA

View Full Version : Question Servo Hack - Custom Motor Controller


Krogoth
Nov 13, 2007, 02:37 AM
Hi all,

I'm working on a custom-built UAV project and need controllers for our control surface actuators that are more advanced than standard hobby servos. I'm looking at creating something similar to the OpenServo project to allow more flexibility - i.e. hacking apart an existing servo and creating custom drive circuitry.

Currently i've chosen the Hitec HS-645MG for the ailerons on the wings and the Futaba S3150 for the ailerons in the v-tail. Does anyone have any experience or pictures of the internals of either of these two servos?

Our UAV is powered by a Jetcat P-120 and has a cruising speed of around 160mph, therefore the servos will be under a considerable stress. I've read all the horror stories about the Hitec 125MG, can anyone vouch for or against the reliability of the 645 or the 3150?

Thanks in advance,

Will.

coro
Nov 13, 2007, 05:18 AM
Virtually All ordinary servos electronic connection is very simple, a pot that is driven by output position, and ordinary brushed motor driven by two wires to turn left/right.
Reliability is given by brushes in the motor and also by how long the pot survives turning.
Great improvement in reliability would be done by optical sensing of position and also using brushless motor.

erazz
Nov 13, 2007, 07:48 AM
Hmmm... Been there, done that! :D

IMHO the manufacturers do a very good job in creating reliable servos. I've used Voltz servos with great success in some very critical areas.

Look, if you're doing this as a business then I'd suggest you contact Hitec or Voltz directly and simply ask them. They can probably point you to the solution that will be the simplest, easiest and cheapest as well.

Using the OpenServo boards will also work as well. They are being tested by a very experienced group of people. I believe this will give you a cheap servo that is relatively reliable. Tough I would suggest you read through their forums and see what kind of trouble can arise.

Simply hacking a servo yourself is asking for trouble. Especially since you want reliability. Just look into how much R&D the OpenServo group is doing. Look at how much testing they are doing and still hitting problems. Developing a servo drive by yourself will require you to go through all that by yourself.

It does seem like a simple job but it's actually very complex. You probably have enough on your plate already creating a custom UAV.

Just my $0.02

phil_g
Nov 13, 2007, 10:35 AM
Can you explain why the standard electronics are unsuitable, why they need to be replaced by 'custom drive circuitry' ?
As supplied, the servos have very accurate, very reliable & proven electronics, with a standard interface (1-2ms pwm) which is very very simple to interface to microcontrollers such as PICs etc.
Sorry but without more detail I cant see how 'custom drive circuitry' would offer any benefit over standard, can you explain?
Cheers
Phil

Krogoth
Nov 13, 2007, 05:50 PM
The inbuilt circuitry in a servo is more than fine for a hobby project, but for the UAV we need something a little more advanced. We are implementing a customized state-space controller for all our control surfaces (more advanced than PID) which means we need complete control over every component and know the state of all components at any given time (i.e. motor current, back EMF, pot position). Also, the control loop will be running at 100Hz which is twice the speed you can control a servo at.

Plus, the custom drive circuitry means we can design it to be EMI resistant and have a low quiescent current draw.

Basically, it's not enough to just set the desired position and wait an unknown amount of time for the servo to move to that position - by the time it gets there you may want to have changed the desired position, and this delay could cause oscillations in a control surface leading to failure. Of course, if you knew all the electrical and programming parameters of a hobby servo you could account for this, but I doubt they're willing to release electrical and firmware specs...

Will.

phil_g
Nov 13, 2007, 07:06 PM
This is interesting, a few thoughts:
Basically, it's not enough to just set the desired position and wait an unknown amount of time for the servo to move to that position
I wonder, if you're proposing to use hobby servo mechanics, how will the transit time change, be more controllable or more predictable?

...and have a low quiescent current draw
In a hobby servo, almost all the current draw is in the motor rather than in the servo elecronics - if you're keeping the motor, any savings in the consumption of the electronics will surely be minimal?

Also, the control loop will be running at 100Hz which is twice the speed you can control a servo at.
Will this be of benefit given that you're using standard RC mechanics with transit times much slower than the frame rate?

...by the time it gets there you may want to have changed the desired position, and this delay could cause oscillations in a control surface leading to failure
But at worst these oscillations would be at the servo transit speed - ie relatively slow - if the surfaces are designed to withstand aerodynamic flutter, surely this wouldnt lead to failure?

Sounds like a fascinating project, you've taken the opposite angle to that which I'd have expected... ie the loop being GPS/Gyro/horizon/terrain mapping rather than absolute control of every individual movement... like a centipede has no idea what its legs are doing, he just trusts their individual processes to get him from A to B...

Another thought:
If you could record every minute movement of a birds flight, and somehow force it to repeat perfectly those exact movements, it would plummet because most of flying is about correcting rather than guiding...

I'd love to hear more about this, please keep the info coming in.

Cheers
Phil

Unterhausen
Nov 13, 2007, 11:50 PM
far cheaper to buy the best digital servo you can get your hands on. For one thing, you'll be crashing due to bugs in your servo code, how insane is that? If you were spending my research budget, I'd want to see benefits in a system model first. There are aircraft toolboxes and blocksets for matlab/simulink.

my advice is that this is only a distraction and you would be far better off getting something flying.

erazz
Nov 14, 2007, 02:15 AM
The inbuilt circuitry in a servo is more than fine for a hobby project, but for the UAV we need something a little more advanced. We are implementing a customized state-space controller for all our control surfaces (more advanced than PID) which means we need complete control over every component and know the state of all components at any given time (i.e. motor current, back EMF, pot position). Also, the control loop will be running at 100Hz which is twice the speed you can control a servo at.

Plus, the custom drive circuitry means we can design it to be EMI resistant and have a low quiescent current draw.

Basically, it's not enough to just set the desired position and wait an unknown amount of time for the servo to move to that position - by the time it gets there you may want to have changed the desired position, and this delay could cause oscillations in a control surface leading to failure. Of course, if you knew all the electrical and programming parameters of a hobby servo you could account for this, but I doubt they're willing to release electrical and firmware specs...

Will.

I think you'd be surprised with what you can get off the shelf. Try contacting Volz (http://www.volz-actuators.com/en/index.php?m=m) actuators. They can supply actuators that will do all that AND be extremely reliable.

Acetronics
Nov 14, 2007, 04:16 AM
The inbuilt circuitry in a servo is more than fine for a hobby project, but for the UAV we need something a little more advanced. We are implementing a customized state-space controller for all our control surfaces (more advanced than PID) which means we need complete control over every component and know the state of all components at any given time (i.e. motor current, back EMF, pot position). Also, the control loop will be running at 100Hz which is twice the speed you can control a servo at.


Will.


Hi, I think I already saw that in these columns about HITEC digital servos and programmer hacking ...

Nothing new here, in your post ... :(

Alain

Krogoth
Nov 14, 2007, 07:42 AM
Alain:

Thank you, this is exactly what I've been looking for. I've been reviewing all my options and it may be easier just to find the transfer function of the servo electronics and use it as a given. I must have used the wrong search terms, I'm pretty sure I couldn't find any other info on the forums...

Erazz:

I've had a brief look at their servos and they seem quite good. Any idea where I can buy them that will ship to Australia?

Unterhausen:

Luckily, no-one's spending their research grants on us - we're a group of (only just) undergraduate engineering students working on an entry to the Outback UAV Challenge, with a view to commercialising our efforts depending on how much progress we make. Our aim is a 'fly-and-forget' UAV with a 10kg payload and a range of 200km with onboard Core 2 Duo for intensive image processing of the 5MP video camera... for less than $AU10000. We have a diverse group of keen aerospace, mechanical, electrical, mechatronic and software engineers (and a tradie :P), and our research costs are zilch.

Phil:

With custom drive electronics almost anything is possible - you can fully characterise a motor (as well as anything really) with something called a 'transfer function' - which relates the output (motor position, speed) to the input (voltage delivered) over time. This is the basis of control theory, working out what kind of input to give a system to get a desired output.

About your bird analogy, you're absolutely correct - what you described is an open loop system. By closing the loop with a control system, you can give the plane a required state (a heading angle etc) and it will dynamically adjust and correct all its control surfaces to reach and hold that state.

Will.

Acetronics
Nov 14, 2007, 07:58 AM
Hi, Krogoth

I had also downloaded those files ... ( some look broken links ) ;)

Many Thanks to its author ...

Alain

phil_g
Nov 14, 2007, 10:32 AM
With custom drive electronics almost anything is possibleErm...

you can fully characterise a motor (as well as anything really) with something called a 'transfer function'

Hmm. You can tailor the reponse, but not within the boundaries of the physical limitations you cant. Transfer function is simply a name for the process between request & result, what I'm suggesting is that the servo has physical parameters such as transit speed etc which no electronics can override without seriously overvolting the motor, at which point your reliability suffers.

I'm kinda wondering what impovements over standard your custom electronics can provide - your transfer func might include filtering, slow or exponential movement, failsafe, preset pattern following, over-ride priorities, prediction etc, but at the end of the day the result is that the servo simply moves, and all of this processing can be done outside the servo and its original electronics. I'm just suggesting that perhaps all your clever processing could be in a separate box which feeds standard RC servos - high-spec ones, but standard COTS items with proven reliability.

About your bird analogy, you're absolutely correct - what you described is an open loop system. By closing the loop with a control system, you can give the plane a required state (a heading angle etc) and it will dynamically adjust and correct all its control surfaces to reach and hold that state.
Yes, that was exactly my point. I feel that theres a lot more to worry about in your loop than motor back emf. You don't steer a car by conciously measuring the pressure you're applying to turn the wheel, you watch the road. I got the impression maybe wrongly that you are using data from the servos, ie deflection, applied force (via motor current) etc to control the aircraft in a manner akin to the bird replay analogy.

Have you anything built yet, maybe a prototype or model? Some photos would be good, its a fascinating project, I'm pretty sure it would be outlawed over here!

Cheers
Phil

Ivan2280
Nov 14, 2007, 11:15 AM
Hello this is my hitech hs-55 digital with pic 12f683 and maxim 4016 driver.In prototype i use maxim 4020.
http://www.youtube.com/watch?v=OYWlNCcKwQg

erazz
Nov 14, 2007, 11:23 AM
I'm kinda wondering what impovements over standard your custom electronics can provide - your transfer func might include filtering, slow or exponential movement, failsafe, preset pattern following, over-ride priorities, prediction etc, but at the end of the day the result is that the servo simply moves, and all of this processing can be done outside the servo and its original electronics. I'm just suggesting that perhaps all your clever processing could be in a separate box which feeds standard RC servos - high-spec ones, but standard COTS items with proven reliability.



I absolutely second that!

Like I've said in my firs post... I've been there and I've done that. I've tried messing with the servo's electronics once. That was enough. I quickly figured out that the only improvements I can get is by buying a better servo!

And if the big guys can fly multi-million $ UAV's on COTS actuators (yes, standard commercial off-the-shelf!) on PID loops then that's good enough for me.


We're not trying to discourage you but to point you to more productive areas. You'll probably spend way too much money and not get what you need. Again, just look at what the OpenServo group is doing and how hard and long they need to work to get a simple digital servo to work!

Unterhausen
Nov 14, 2007, 01:02 PM
And if the big guys can fly multi-million $ UAV's on COTS actuators (yes, standard commercial off-the-shelf!) on PID loops then that's good enough for me.


We're not trying to discourage you but to point you to more productive areas. You'll probably spend way too much money and not get what you need. Again, just look at what the OpenServo group is doing and how hard and long they need to work to get a simple digital servo to work!

well said. but in this case it appears that the money may not be the problem so much as the time. They have less than a year before the competition, and the best approach is to get flying as soon as possible so that the real issues become apparent. the difficult issues for a plane that size have nothing to do with servos.

You really don't care what the actuator position is, you care what the airframe is doing. There are issues if you have to use more than one servo per actuator, but that can generally be handled externally using a servo matcher. Since the servo dynamics are so much faster than the airframe dynamics, open loop is appropriate here.

there was a post similar to this in the UAV forum. I eventually convinced the person that they should concentrate on more profitable portions of the problem.