DIY MegaServo?

Lbrombach

New Member
Got me a few of those windshield wiper gearmotors laying around, and coincidentally, I could use some mega-beefy servos. Anyone have any ideas to turn one into a proper (positioning) servo that works with the standard servo signals?
 

MiB1986

Member
Hello,

how many poles does this motor have?

a servo works on feedback, if you have an old one take a look inside and maybe knick the board from it...

kind regards
 

Michael 2727

Senior Member
If you hacked the output stage of a normal RC Servo, bypassing/replacing the original components with power MOSFETs e.g. IRF540 you may get a good result.
You will need to attach, as said, a POT for feedback/position information back to the servo control section.
The pot goes on the output shaft of the WSW Motor.

Edited by - Michael 2727 on 27/07/2007 16:46:08
 

Tom2000

Senior Member
That's a pretty interesting question. I've been giving it some thought for the last several minutes.

I haven't done any sketching, but "seat of the pants" tells me something like the following could be an approach you could pursue.

First, reading the servo signal. Should be simple. Pulsin?

Next, the output. It seems to me you could feed a PWM signal to an inverter, then feed an H bridge with the normal and inverted PWM signals. With the Picaxe generating 50% PWM, that should be a neutral signal to the motor. At 100% PWM, maximum CW. At 0%, maximum CCW.

You'd require another Picaxe output line to enable or disable the H bridge.

You could read the servo position pot with an ADC.

Now comes the fun. You've got the gozintas - the servo pulse width and the servo position pot value. You've got the gozoutas - the PWM signal.

"All ya gotta do" (cough!) is to implement a real-time PID algorithm to calculate, moment by moment, the proper motor drive level and direction to critically-damp your servo under dynamic load conditions.

Both motor control and exacting PID algorithms are outside my experience, but seat of the pants tells me that you should be able to implement a servo with a single 08M, an L298 H bridge and its supporting cast, and maybe a glue logic chip.

Sounds interesting, and I'll bet that it will be very educational!

Good luck!

Tom
 
You can use pulsin to accurately decode PWM signals from radio gear. If you offset and compare this to the voltage reading from a pot you can easily make a servo. I found that with bog standard 18s you can get servos with 16 step positional accuracy. With better ADCs like the 18X the step resolution and accuracy can be greatly improved.
 

BeanieBots

Moderator
A PICAXE simply isn't quick enough for PID motor control.
If your motor/gearbox output is quite slow and you use an overclocked PICAXE then it might be worth a try.
I'd go with the 'beef'd up' hacked servo guts method. Simply take the guts of a hobby servo and use it to drive a suitably high current H-Bridge. Don't forget to fit the feedback pot to the shaft (the correct way round) or it'll shoot off out of control.

Another I've seen in the 'Robot Wars' arena is to use use a regular hobby servo mounted with correct 'servo saver' mechanics that pushes two microswitches in a similar manner to a car power steering mechanism.
ie the servo pushes the microswitch which in turn drives the large motor to pull the switch away from the servo. Crude, but good enough for a robot wars style robot.

Edited by - beaniebots on 27/07/2007 17:41:37
 

Rickharris

Senior Member
<A href='http://www.rev-ed.co.uk/picaxe/forum/topic.asp?topic_id=7327&amp;forum_id=31&amp;Topic_Title=DIY+Servo&amp;forum_title=PICAXE+Forum&amp;M=False' Target=_Blank>External Web Link</a> in this earlier post I raised the idea of a picaxe 08 as a servo controller. There are some thoughts there.

Note the code in that post was developed to try the idea and the feedback pot is not connected to the motor but moved by hand to simulate the process whilst the demand is fixed in the code for the test.

My experiment shows that with very simple software a geared motor can be controlled by the picaxe, and L293 in my case although I think for WS wiper motors I might look at a relay H bridge arrangement.

The software is very simple - Read the pot position with ADC, output a difference between the demand and current position as a drive signal in the appropriate direction.

It works on my desk so I would expect it to be scaled up to run wiper motors with little more than the addition of 12 volts supply and a couple of relays. Speed isn't an issue as long as the pot is driven by the slow end of the gear system.

On the other side take care mechanically, do damage if it hits a stop or restriction.

Not withstanding any fancy PID algorithms I eventually just put in a dead band to allow the servo to settle seemed to work quite well.

Edited by - rickharris on 27/07/2007 18:31:53

Edited by - rickharris on 27/07/2007 20:02:28
 

Wrenow

Senior Member
Lbrombach

It may be helpful to look at a hobby servo as 3 major components that happen to be in a nice, compact, mountable box.
A) a geared motor
B) a position sensor (in this case being a pot tied to the gear drivetrain)
and C) the electronics package that integrates the sensed position signal (voltage) and the commanded position signal (the pulse from the radio).

By understanding that it is really 3 systems in one little case, it becomes tremendously hackable. For instance www.servocity.com makes a kit for replacing the pot in a standard servo with an external one mounted in bearings on a frame to make an incredibly beefy servo with fully accurate positioning (at the sacrifice of a bit of speed).

Instead of gears, you could use pulleys and a belt to do the same thing but with a &quot;safety clutch&quot;.

In your case, you are doing much the same thing, but the current draw and voltage of the windscreen wiper motor need to be considered. That voltage and current draw would fry most hobby servo electrics. However you could probably use the pwm? output of the servo to as the input to drive MOSFETs or something else to settle the motor load issue (exactly what and how is above my current paygrade, sorry). However, all the logic, PID stuff, sensing stuff, and command stuff is built in.

If you want something other than RC pulse input, the openservo.com board might be just the ticket.

I hope the above is helpful.

Cheers,

Wreno
 

Rickharris

Senior Member
On the subject of cordless drills I have noticed in the past that a number of DIY outlets and pound shops often sell them as loss leaders at very low prices, down to &#163;1 or &#163;2. As I see them I buy a couple - Currently I have about 20 in my garage.

Breaking them down gives a useful low speed motor rated (by the battery) at 3 volts.

As far as drive motors are concerned they are too slow for driving wheels, tracks may be OK as are actuators and roboarms. They can draw large currents when stalled so I have always used relay H bridges to control them.
 

demonicpicaxeguy

Senior Member
1 or 2 pounds????????????? tell me thats a typo?? crikey thats cheap..

over here we can get cordless drills for $18 and cordless screw drivers for $8
the chucks on the cordless drills are usefull to clamp onto threaded rods nicely and can deliver tonnes of tourque

as for throttling them pwm can take care of that with the approatriate power supply
encoding disks arn't too hard
you could potentially make quite a powerfull and quick servo
 

MurrayJ

Senior Member
Dont know if this helps, but there is a kit from Oatley Electronics here in Australia that seems to be what you want.

http://www.oatleyelectronics.com/

Go to: Other Kits &gt; Motor Driver &amp; Speed Controller &gt; Jumbo Servo Kit.

Price is $29. (controller only)

By the discription it will work from a pot or standard RC signal.
 

Tom2000

Senior Member
<i>&quot;A PICAXE simply isn't quick enough for PID motor control. </i>
OK, then, maybe it might be possible to simplify the solution?

What the PID would give you would be a precise PWM level to apply at any given moment. I'll accept, from you experience, that a Picaxe doesn't have the horsepower to implement a fast PID.

Would a lookup table approach, consisting of PWM values vs error magnitude, serve as a substitute? I'm thinking something like a U-shaped curve, with zero error located at bottom-center.

I know that a lookup would lose dynamics, but I'm beginning to wonder just how important accomdating dynamic loading actually is, and whether or not a lookup table would actually be compensating for dynamics anyway.

Thinking about this is starting to make my head hurt. :)

Tom


Edited by - Tom2000 on 28/07/2007 23:43:03
 

Rickharris

Senior Member
DPG - The price is right but I misread the context - what I have is cordless screwdrivers because I was interested in the epicyclic gearbox/motor combo. Still they appear to use the same motor as the low price drills.

 

moxhamj

New Member
Re &quot;A PICAXE simply isn't quick enough for PID motor control.&quot;

I once built a servo circuit out of a couple of 324 op amps. A few chips were configured as a sawtooth generator and then as reference voltages rose and fell, one could compare this with the sawtooth and generate varying PWM outputs for driving the servo motor. The algorithm was that full power was applied if the servo was more than 10% out of range, then if it was 10% to 3% out of range a decreasing PWM was applied, and if within 3% then no power was applied. All done in analog circuitry, and still (possibly) cheaper than a picaxe. Three variables can be adjusted - the slope of the PWM decrease as the motor apporaches target, the width of the dead zone, and the cutoff point near the deadzone at which no power is applied (no point in powering at a 1%PWM if the motor is very close to target as 1% will not be enough power to move the motor). This last value was about 25% of full power.

There is no reason a picaxe could not do this all with one chip. A windscreen motor takes at least 500ms to go from one side to the other. A picaxe can sample the position pot at least 1000 times a second, and can adjust power in varying PWM. The algorithm can be as above - full power if way out of range, no power if within a narrow range, and decreasing power as the servo approaches its target.

This is a compromise algorithm - more complex than simple on/off, but less complex than feed-forward mechanisms.

Edited by - Dr_Acula on 29/07/2007 10:25:10
 
This is what I always used to use when I wanted to interface a high torque motor to radio gear or an SSC.

;#####################################
;
; ELECTRONIC SPEED CONTROL
; C.JONES 01/07/05
; STANDARD PICAXE 18
; this version works 01/07/05
; Notes:
; 1) Values are approximate
; 2) +Ve edge is assumed
; 3) byte data width is used
;
; MILFORD PULSIN VALUE
; -------------------------------
; 029 080
; 041 090 - lower limit
; 053 100
; 067 110
; 076 120
; 090 130
; 100 140
; 105 150
; 125 160
; 140 170
; 153 180
; 160 190
; 172 200
; 231 250 - upper limit
;
; ADC range 0-160
; use pulsin - 90 for values &gt; 90
;
;#####################################

symbol DEMAND1 = b0
symbol FEEDBACK1 = b1
symbol DEADZONE = 5
symbol UPPER1 = b2
symbol LOWER1 = b3
symbol DEMAND2 = b4
symbol FEEDBACK2 = b5
symbol UPPER2 = b6
symbol LOWER2 = b7
symbol HI = 1
symbol LO = 0

high 5 ;test and monitor/wachdog output

loop: ;#############################
;
; MOTOR 1 CONTROL
;
;#############################
pulsin 1,HI,DEMAND1
readadc 0, FEEDBACK1
if DEMAND1 &gt; 90 then sub1

ret1: UPPER1 = FEEDBACK1 + DEADZONE
LOWER1 = FEEDBACK1 - DEADZONE

if DEMAND1 &gt; UPPER1 then cw1
if DEMAND1 &lt; LOWER1 then ccw1

low 1
low 2

ret2: ;############################
;
; MOTOR 2 CONTROL
;
;############################
pulsin 7,HI,DEMAND2
readadc 2, FEEDBACK2
if DEMAND2 &gt; 90 then sub2

ret3: UPPER2 = FEEDBACK2 + DEADZONE
LOWER2 = FEEDBACK2 - DEADZONE

if DEMAND2 &gt; UPPER2 then cw2
if DEMAND2 &lt; LOWER2 then ccw2

low 3
low 4
ret4: goto loop





sub1: DEMAND1 = DEMAND1 - 90
goto ret1

sub2: DEMAND2 = DEMAND2 - 90
goto ret3

ccw1: high 1
low 2
goto ret2

cw1: low 1
high 2
goto ret2

ccw2: high 3
low 4
goto ret4

cw2: low 3
high 4
goto ret4




 

Lbrombach

New Member
WoW, I go away for a couple days and you guys have really hooked me up. I really dig beaniebots &quot;use and switches hooked up to regular servo&quot; solution, and I may use that for other things but probaby not this project.

MurrayJ: Oatleys' product looks good, I don't suppose you have voltage/current limit data? I suppose I could e-mail hem directly....


Thanks everyone
 

Tom2000

Senior Member
<i>&quot;I really dig beaniebots &quot;use and switches hooked up to regular servo&quot; solution... </i>

I thought that was incredibly clever, too, and said &quot;Wow!&quot; when I read it.

I've been Googling for specs on windshield wiper motors. Near as I can tell, you can plan on about a 2.5 amp draw from 12 volts no load, with stall current in the vicinity of 45 amps. But that range seems to vary widely with the type.

(And many motors have internal cam switches that are used to park the output shaft in a known position, so you might have to do some surgery on your motors to disable or bypass the parking feature.)

I'd suggest you hook up one of your motors to a power supply and (depending on your test equipment), maybe a small-value series resistor to measure the no-load current either directly or by measuring the voltage drop across that small series resistor.

It would be very convenient if you could use an L298 H-bridge chip as your drive circuit. They're readily available and relatively inexpensive. Unfortunately, the maximum current rating of an L298 is 4 amps, if you parallel the two drive sections.

4 amps, although on the hairy edge, might be OK, if you don't ever put a large mechanical load on the motor. A better solution would be to run the motor at something less than 12 volts. For instance, if that motor delivers enough torque when supplied with 6 volts, the loaded current draw might be within the capability of an L298, (say, 3 amps if you heat sink the chip well) and your motor drive circuit might consist of an L298, four diodes, and a couple of capacitors. (If you need to build a discrete motor drive circuit, the project probably isn't worth it, and a search for an off-the-shelf solution is probably in order.)

Other than the motor drive electronics, assuming you use a lookup table or simple calculation of the PWM level vs error, an 08M should do the job.

You have three pins available to drive the L298, one to read the pot's voltage, and one to read the servo signal.

I'm thinking, with three output pins available, you can eliminate an external gate by doing something ridiculous, like feeding the L298's two control leads with two 08M outputs. Those outputs set the motor's direction. The PWM output might feed the chip's enable input, functioning as both motor speed and L298 enable/disable.

An alternative would be the 50%-PWM-neutral I proprosed earlier, fed to the L298 through inverting logic, one 08M pin used to enable/disable the L298, and the remaining 08M pin used as an ADC to monitor the motor's current as voltage drop across a sense resistor.

The two remaining 08M pins are used for the servo signal input and the servo pot position input.

All told, I think it's doable, but I do have reservations about the L298 driving a windshield wiper motor.

If you can sort that out, the hardest part of the project might be mounting the pot on the wiper motor and coupling it to the output shaft. To simplify that task, you might think about mounting the pot &quot;downstream,&quot; on the mechanism that's driven by the servo, instead of on the motor itself.

Thanks for the idea. I've had a lot of fun thinking about this. I even looked in my parts boxes. I found a couple of L293 chips I might use to test the idea, and a stock of 08Ms, but the few motors I have on hand are all steppers. So I'm unable to breadboard and test the idea.

Have fun with your project, and please let us know how you're progressing.

Tom


Edited by - Tom2000 on 30/07/2007 14:54:16
 

Michael 2727

Senior Member
Don't use an L293 or similar with a windscreen wpier motor, you WILL KILL it.
The park feature is easy, there are usually 2 extra wires, sometimes one, but either way if left open circuit they will park the motor, if closed they allow continious running. Easy.
 

Lbrombach

New Member
Tom and Mike:

Thanks. The park feature is not an issue, I've used these motors before with and without it. 5 or 6 volts might be enought torque. As for hooking up the pot, I haven't figured that out either. I do have some 5k slider pots that I might be able to hook. If I recall, the pot inside a servo is 5k, yes? am leaning toward hacking a standard servo for the guts if I can't find something off the shelf (cheap).
 

boriz

Senior Member
If you don&#8217;t want to hack a servo, how about this:

You glue an external pot to the output disk of a small servo. The shaft of the pot is rotated by your prime motor, the body of the pot is rotated by the small servo.

The pot produces a 0v-5v output which is read by the PICAXE ADC. The PICAXE sends the appropriate power control and direction signals to the prime motor so that the pots shaft is always centred. IE 2.5v on the ADC. The same PICAXE can drive the small servo.
 

MurrayJ

Senior Member
The Oatley Servo controller instructions were in the May 2001 Silicon Chip magaazine. No Amp rating but in the text thay said 24V with extra heatsinking. They also mentioned windscreen wiper motors, so I suspect capable of plenty of amps.
 

Tom2000

Senior Member
Your 5k slider should work well. In this application, the pot's resistance isn't critical; it's just a voltage divider feeding the ADC.

Good luck, and most of all, have fun!

Tom
 
Top