Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Robotics12 on February 25, 2012, 02:43:43 AM

Title: servo and wiper motor
Post by: Robotics12 on February 25, 2012, 02:43:43 AM
I am wanting to make a more powerful servo. I have the parts but was wondering if anyone knows of any steps to follow to be able to accomplish this?
Title: Re: servo and wiper motor
Post by: mstacho on February 25, 2012, 08:36:02 AM
A servo is just a motor with a control loop inside, so if you have a motor and position sensor, just control it and you're done. 

So I'm going to guess you also want to be able to send it the 1000-2000 microsecond range signal that is needed for servo control?

You have a few options, some much easier (but less accurate).  Easiest possible way is to get a cheap microcontroller and place whatever it is that's sending the signal onto one of its interrupt pins.  Interrupt on the two transitions: when the pin goes from LOW to HIGH, start counting.  When it goes from HIGH to LOW, stop counting, figure out the difference in time, and set the servo's position.

My assumption is that it's possible to do without a micrcontroller, but...

Also, for much more sophisticated ways of doing this, check here:  http://www.openservo.com/Hardware (http://www.openservo.com/Hardware)
Title: Re: servo and wiper motor
Post by: Robotics12 on February 26, 2012, 01:06:24 AM
I was looking for something along the lines of:
http://www.fieroaddiction.com/servo.html (http://www.fieroaddiction.com/servo.html)

The first 6-7 paragraphs kind of explain what I want to do. Was wondering if there is other guidelines or something similar that I can follow.
Title: Re: servo and wiper motor
Post by: Daanii on February 26, 2012, 10:28:27 PM
I tried to convert a windshield wiper motor to a servo too. It didn't work very well.

What did work well was to buy a Pololu jrk 12v12 motor controller: www.pololu.com/catalog/product/1393 (http://www.pololu.com/catalog/product/1393). It cost a lot at $100. But it's a great little board. It can handle up to 30 Amps, and has a tunable PID feedback system.

You don't get a servo using the jrk 12v12 controller. But you can program it like a servo. I think it's an elegant way to turn a windshield wiper motor into a powerful means to control a rotating device where a servo just doesn't provide enough power.
Title: Re: servo and wiper motor
Post by: Robotics12 on February 27, 2012, 03:02:17 AM
I have seen it done a few times with a go-cart, which is what I will be implementing it on. So, for now I am going to try to accomplish this as I have the parts already. If it fails I will look for alternate way. Just wondering if anyone had advice or other guidelines to possibly follow rather than what I submitted in the previous post, or if someone can add more details to that guideline to help me better understand possibly.
Title: Re: servo and wiper motor
Post by: Soeren on February 27, 2012, 07:57:13 AM
Hi,

I have seen it done a few times with a go-cart, which is what I will be implementing it on. So, for now I am going to try to accomplish this as I have the parts already. [...] if someone can add more details to that guideline to help me better understand possibly.
What part is it that you don't understand so well?

One thing... The text mentions replacing the transistors in the servo, but a better approach is to use the servos transistors to drive an external H-bridge.
You mention that you have "the parts". Which parts do you have exactly?

Besides the servo to cannibalize, you need a beefy H-bridge, or transistors to make one. A heatsink to mount them on and wire of a suitable gauge for the H-bridge and the wiper motor (did you measure the max current drain of the motor?). Then you need a good quality feedback potentiometer and a bit of hardware to interface it to the motor.
Title: Re: servo and wiper motor
Post by: Robotics12 on February 27, 2012, 10:21:40 AM
Well, I got the parts this site recommended under "Build Super Servo".
http://www.popsci.com/diy/article/2010-07/add-remote-control-any-project-you-build (http://www.popsci.com/diy/article/2010-07/add-remote-control-any-project-you-build)

I have the wiper motor, servo, motor controller. It doesn't explain it but that is the reason I mentioned the first site in the op because I figured I am to follow that. But was wondering if there are anyone that has went through this process before and could offer better detail or advice.
Title: Re: servo and wiper motor
Post by: Daanii on February 27, 2012, 11:25:55 AM
Did you get the Pololu jrk 21v3 recommended in the PopSci article?

If so, you are just doing what I did. In the PopSci article, they are just using the servo motor as a potentiometer. I used a potentiometer instead, in fact one of the Radio Shack 5k Ohm potentiometers they mention in the article.

The other article that you linked to takes a different approach. They use a lot more of the servo than just the potentiometer. That's why following that article is harder. I could not figure out how to do it. The advantage of that approach is that you can use a cheaper motor driver than the Pololu jrk.

One of the comments to the PopSci article suggests going to the Pololu website under the jrk 21v3 product to get guidance. That's good advice. They have a good forum at Pololu too, if you run into trouble.

Or you can post back here. I did exactly what you are doing, and would be happy to help.

The Pololu jrk controllers are really nice, although pricey. If that is what you have, I don't think you will have much of a problem getting yours to work. I started out with one of Pololu's cheaper and simpler motor drivers, and burned it out. They are harder to use and less forgiving of errors.

Good luck!
Title: Re: servo and wiper motor
Post by: Robotics12 on February 28, 2012, 01:15:15 PM
Believe we are using a:
http://www.pololu.com/catalog/product/760 (http://www.pololu.com/catalog/product/760)

We are using this one with it being able to have two outputs. So one will be for the wiper motor. Since the article I provided above is not what I am looking for, do you recommend anything I can follow or anything out there to turn the servo into a pot and use the wiper motor as the motor?

I took the servo apart and see the connections. I see where the servo motor is connected and such. Just don't want to do something wrong.
Title: Re: servo and wiper motor
Post by: Daanii on February 28, 2012, 03:23:07 PM
Okay, I see what you are planning.

With that motor controller, you need a PWM input plus a direction signal. So you will need the servo to act as more than a potentiometer. The servo will need to do the feedback calculations and you will have to somehow convert its output to the input that your motor controller needs. I don't know much about that, but I don't think that will be easy to do. It will be like putting a square peg in a round hole.

What exactly do you want to do here? Steer your go-cart using a remote control?

Title: Re: servo and wiper motor
Post by: Robotics12 on February 28, 2012, 06:50:16 PM
Plan is to have a go-cart that you can drive but it's inputs and outputs are wireless. So there are no physical connections between pedals/steering wheel and the outputs brake/throttle/steering. So I am working on using a wiper motor and servo for the actual steering. Have two microcontrollers. One for the input components and this MC sends wireless to another MC. The second MC sends the signals to the output parts like the servo/wiper motor. I will have the motor controller with the wiper motor and that is the part I am concentrated on now.

Should I invest in a different motor controller to make it easier to incorporate the wiper motor with the servo motor?
Title: Re: servo and wiper motor
Post by: Soeren on February 28, 2012, 07:45:36 PM
Hi,

Well, I got the parts this site recommended under "Build Super Servo".
Oh, I thought you were just trying to beef up the servo board with MOSFET's in an external H-bridge topology and the wiper motor.


I have the wiper motor, servo, motor controller. It doesn't explain it but that is the reason I mentioned the first site in the op because I figured I am to follow that. But was wondering if there are anyone that has went through this process before and could offer better detail or advice.
OK. They seem to use the servo solely for the potentiometer inside it (what a waste), to act as the feedback, bypassing the wicked control algorithms already built into the servo.
So, you no longer need to think of servo signals.

The same thing (just keeping with the servo signals), could be done by 4 MOSFET's added to the servo board and a better quality potentiometer connected to the wiper motor axle either directly or by gears/timing belt.
Title: Re: servo and wiper motor
Post by: Daanii on February 28, 2012, 10:09:52 PM
There are many ways to approach this. As Soeren says, one way is just to build your own H-bridge out of MOSFETs. That way you would use the servo control circuitry. That's a good way to do it, and you will learn a lot. But it will be harder.

Are you looking for the simplest way to do this? That would probably be to forget the servo completely, get a Pololu jrk 12v12 motor controller, and use a potentiometer for feedback. If you want to do that, I can help, since that is more or less what I did.

One issue with that is how you connect your motor to the steering linkage. That will affect where you put the potentiometer and how your feedback will work.

This is not a hard project, but it is not an easy one either. That is why you are not finding anything on the Internet that gives you step-by-step instructions. It will take some work.
Title: Re: servo and wiper motor
Post by: Robotics12 on February 28, 2012, 10:23:27 PM
Ok thanks for the input. Thing is, we have a set time frame for the project so I can't really incorporate new things or 'harder' configurations to accomplish this. I would like to use the materials I have with the servo/wiper motor/motor controller if possible...if not I am willing to change the servo motor with something else if it makes the project easier to accomplish but still manages to fix the solution.

The reason we chose this motor controller instead of a jkr 12v12 is we are using 2 small motors, like the wiper motor, as outputs of the motor controller. So we needed something to handle that. So, if I incorporate a pot and the motor controller(that I chose above) I should still be able to accomplish what you have done correct?
Title: Re: servo and wiper motor
Post by: Daanii on February 28, 2012, 11:33:46 PM
So, if I incorporate a pot and the motor controller(that I chose above) I should still be able to accomplish what you have done correct?

Sure, if you use a potentiometer and the motor controller you chose, you can do what I have done. The only hard thing will be the PID control algorithm, which you will have to write yourself.

I did not have to write a PID algorithm. I should not keep singing the jrk controller's praises, but it has an on-board microcontroller that has some nice PID software already on it. You can communicate with the jrk board through a USB cable, running Pololu's control panel on your computer. It's a great little board.

You mentioned driving two smaller motors off the Pololu motor controller you chose. But the specifications for that motor controller say it only drives one motor, not two. It's no different from the jrk. I'm not clear on why you are using two motors anyway.

Given your constraints, I would recommend forgetting about the servo. It is not going to help you. I would get a potentiometer, hook it up to your steering linkage so that it gives you the right feedback, and sample that feedback with your microcontroller. Then use a PID algorithm to drive the motor until the feedback matches the target.

That will be easier than trying to use the servo.
Title: Re: servo and wiper motor
Post by: Robotics12 on February 29, 2012, 12:51:58 AM
Ok, well I guess I will go to pot route and disregard the servo for now. I will be using this motor controller instead...I told you the wrong one.
http://www.pololu.com/catalog/product/1495 (http://www.pololu.com/catalog/product/1495)

Would the information you have provided change when using this motor controller?
Title: Re: servo and wiper motor
Post by: Daanii on February 29, 2012, 01:26:53 AM
Would the information you have provided change when using this motor controller?

No, the principle would still be the same. The implementation would change, though.

I'm still not clear on how you are planning to steer the wheels, or why you would use two motors.
Title: Re: servo and wiper motor
Post by: Robotics12 on February 29, 2012, 02:34:26 AM
The other motor is for something not related to the steering with the cart. It is related to braking of some sort, which I am not involved with. So we thought to just buy a motor controller that can handle two outputs rather than two separate motor controllers.  What do you mean by on how, 'planning to steer the wheels'?
Title: Re: servo and wiper motor
Post by: Daanii on February 29, 2012, 11:47:49 AM
The other motor is for something not related to the steering with the cart. It is related to braking of some sort, which I am not involved with. So we thought to just buy a motor controller that can handle two outputs rather than two separate motor controllers. 

I see. The motor controller you bought is designed to do "skid steering" for radio-controlled toy cars. So that had me wondering. But you just wanted it for two independent motors. That makes sense.

What do you mean by on how, 'planning to steer the wheels'?

How is your motor going to actually steer the wheels? Where will you hook it to the steering linkage? What kind of steering linkage do you have? Is there any gearing, or does the motor directly drive the steering? Do you replace an existing steering wheel, or do you leave the steering wheel on?

I ask those questions because the answers will affect the way you implement the steering. As will the parts you chose. For example, it looks like the servo will not be of any use to you.

But as I said, the principle will not change. It sounds like you will get a steering "target" number from someone else. You will need to take that target and compare it against the current position of the steering. That will give you the "error," which is the difference between where the steering is and where it needs to be.

You will (probably want to) plug that error into a PID control algorithm. That is what is hard-wired into a servo and what the Pololu jrk motor controller has already built in. You will need to write one yourself, or use a library that works with your microcontroller. (The PID algorithms are fairly simple. The tuning is the hard part.)

The PID algorithm will give you an offset. You will need to convert that into a speed and direction signal for your motor controller. Your motor controller will then drive your motor to turn the wheels the correct amount. You need a feedback sensor (probably a potentiometer) to tell you the new position of the wheels.

Then you do it all over again.

Using a servo, or buying a jrk motor controller, may help you skip some of the steps, because the work has already been done. But you still have to put it all together.

I'm not sure I'm helping any. Best of luck, though, on the project. It sounds fun.
Title: Re: servo and wiper motor
Post by: Robotics12 on February 29, 2012, 02:34:27 PM
Yes, this is great information you are providing. I am not 'expert' on this topic of robotics, which is why I came to this forum. Here is a better understand by this picture:
http://i.imgur.com/0tX4u.jpg (http://i.imgur.com/0tX4u.jpg)

We are removing that rod. And just having a rod straight down from the steering wheel that just holds the steering wheel in place. The steering wheel pot is connected to first MicroC which sends wireless signals to the second MicroC. This second MicroC is what outputs what needs to be done to motorC/Wiper Motor/Pot/Etc. The wiper motor and things related will be placed somehow in the front(you can see in the picture where we somehow need to mount it near the steering rod with the wheels). I circled a possible location to connect wiper motor if possible as it might seem like the easiest place since it seems like most things are already in place. This might explain it better but I am seeing the big picture now after your explanation. Thank you.
Title: Re: servo and wiper motor
Post by: Daanii on February 29, 2012, 07:30:19 PM
Great! I see what you are planning. That picture helps a lot. You will be doing something very similar to what we are doing. So I can tell you that your basic approach is valid.

That said, it will not be simple. I'm no expert on this either, and it's been hard to get it to work. We are still working on making ours more reliable and robust. That takes a while.

So let me just repeat some suggestions. I would not try to use a servo. I don't think that will help. You will instead need to write some software for your microcontroller, though, that implements a closed-loop control system based on the angle of your Pitman arm as feedback.

You will need to get that angle position. We used a potentiometer fixed to the bottom of our steering gearbox with the wiper attached to the Pitman arm. You might be able to do that too.

What are you using for your second microcontroller? That's what will need to calculate the speed and direction signals for your motor controller. You will probably want to use a PID algorithm. You might be able to find one in a code library that you can use. For example, I think there is a PID library written for the Arduino.

I tried to write my own PID algorithm, had trouble, and during development burned out the Pololu Simple Motor Controller that I was using. I put up a thread on the Pololu forum, and they recommended that I use the jrk controller instead. As I mentioned, that helped a lot.

So your system will probably look like this:

Microcontroller
-- gets wireless signal from another microcontroller that gives the desired steering angle
-- gets the current steering angle from the potentiometer on the end of the steering shaft
-- calculates the speed and direction for the motor controller to move the steering shaft from the current position to the desired position
-- sends the speed and direction signal to the motor controller

Motor controller
-- gets 12 Volt power from a power source (battery?)
-- gets a speed and direction signal from the microcontroller
-- sends current to the motor

Motor
-- gets current from the motor controller
-- moves the Pitman arm which steers the wheels

Potentiometer (or other position sensor)
-- senses the current steering angle
-- sends the current steering angle to the microcontroller


Does that seem right? Any questions on the basic approach? Anything you need guidance on?
Title: Re: servo and wiper motor
Post by: Soeren on February 29, 2012, 07:38:16 PM
Hi,

[...]
So your system will probably look like this:

Microcontroller
-- gets wireless signal from another microcontroller that gives the desired steering angle
-- gets the current steering angle from the potentiometer on the end of the steering shaft
-- calculates the speed and direction for the motor controller to move the steering shaft from the current position to the desired position
-- sends the speed and direction signal to the motor controller

Motor controller
-- gets 12 Volt power from a power source (battery?)
-- gets a speed and direction signal from the microcontroller
-- sends current to the motor

Motor
-- gets current from the motor controller
-- moves the Pitman arm which steers the wheels

Potentiometer (or other position sensor)
-- senses the current steering angle
-- sends the current steering angle to the microcontroller
I sure wonder why you find it harder to weld 4 MOSFET's to an existing servo and be done with it ;D
Title: Re: servo and wiper motor
Post by: Daanii on February 29, 2012, 07:48:34 PM
I sure wonder why you find it harder to weld 4 MOSFET's to an existing servo and be done with it ;D

You're right, that would work better!
Title: Re: servo and wiper motor
Post by: Robotics12 on February 29, 2012, 08:45:17 PM
So let me just repeat some suggestions. I would not try to use a servo. I don't think that will help. You will instead need to write some software for your microcontroller, though, that implements a closed-loop control system based on the angle of your Pitman arm as feedback.

Ok, so the software side we have some other people over that area. I will let them know this approach. I will probably be apart of that with it being my area of steering also

You will need to get that angle position. We used a potentiometer fixed to the bottom of our steering gearbox with the wiper attached to the Pitman arm. You might be able to do that too.

What are you using for your second microcontroller? That's what will need to calculate the speed and direction signals for your motor controller. You will probably want to use a PID algorithm. You might be able to find one in a code library that you can use. For example, I think there is a PID library written for the Arduino.

We are using the basic arduino uno for both microcontrollers along with xbee shield and accessories to communicate wirelessly. One receives inputs from wheel/pedals - relays wirelessly to other which sends to outputs. I will look into the possible PID library.

So your system will probably look like this:

MicrocontrollerYes, this would be the one that receives signals from the MicroC that takes inputs.
-- gets wireless signal from another microcontroller that gives the desired steering angle
-- gets the current steering angle from the potentiometer on the end of the steering shaft
-- calculates the speed and direction for the motor controller to move the steering shaft from the current position to the desired position
-- sends the speed and direction signal to the motor controller

Motor controller
-- gets 12 Volt power from a power source (battery?) Yes, battery
-- gets a speed and direction signal from the microcontroller
-- sends current to the motor

Motor
-- gets current from the motor controller
-- moves the Pitman arm which steers the wheels

Potentiometer (or other position sensor)
-- senses the current steering angle
-- sends the current steering angle to the microcontroller

This outline seems pretty much like what needs to happen.
Does that seem right? Any questions on the basic approach? Anything you need guidance on?

Thank you the time and help so far. You are obviously little more advanced at this than I and all this information helps.
Title: Re: servo and wiper motor
Post by: Daanii on March 01, 2012, 02:28:24 PM
Glad to be of help.

There are lots of ways to do this (Soeren's method of doing it using the servo electronics, for example). The way you end up doing it will probably be different than mine. So it's interesting to follow what you are doing.