Newbie with an idea... Where to start...

Status
Not open for further replies.

archaic0

New Member
I have been googling for a day or so now trying to find a good starting point for a project that I came up with. I'm finding a lot of getting started guides, but they are all focused on one particular kind of controller and that's what I'm trying to decide on.

I know what I need to do, but don't know what controllers will be up to the task. Below is everything I need to do:

1. control 2 servo motors
2. read servo motor positions and make decisions based on it
3. produce output on 1 LCD screen for a settings menu and live status during operation.
4. control switch output. (I need it to take the place of a human pushing a button)
5. take input from 4 momentary buttons
6. save settings to non-volatile memory

I'm making a product that will rotate a platform from a start point to an end point in 2 axis using set increments and pausing at each stop to trigger a switch. Kind of an electronic sprinkler head if you will.

A friend who dabbles in robotics mentioned PIC controllers, but also Arduino stuff. His comment was that PIC is way cheaper than a BASIC stamp, but a $50 brain for this device isn't a deal breaker. Obviously if I can do it for $2 then I'll want to, but I don't want to make things harder just to save a few dollars. I want to do it right and do it easilly.

If this first one works well, then I'll be making a bunch of them and I'd like to not sink myself with more work then I need.

Thanks in advance!
 
archaic0 said:
2. read servo motor positions and make decisions based on it

That's the only thing that's any problem, because you can't read a servo position, unless you add some type of positional sensor, or modify the servo to take an output from the internal poteniometer. You tell a servo where to go, and it goes there - you know where it is because you told it - so reading it's position isn't normally a requirement.

But a PIC should do your project easily.
 
Someone I know had mentioned that you could read a position off the shaft of a servo somehow. I'll have to look into that part. Its important that I can verify the position because there may be a range of motion restriction to contend with and I need to make sure its not exceeded.
 
Last edited:
This site
**broken link removed**

Seems to state that all servos have a potentiometer built in for their own sake. Shouldn't you be able to poll this?

---
From the site:
A servo motor is an entirely different story. The servo motor is actually an assembly of four things: a normal DC motor, a gear reduction unit, a position-sensing device (usually a potentiometer -- a volume control knob), and a control circuit.

The function of the servo is to receive a control signal that represents a desired output position of the servo shaft, and apply power to its DC motor until its shaft turns to that position. It uses the position-sensing device to determine the rotational position of the shaft, so it knows which way the motor must turn to move the shaft to the commanded position. The shaft typically does not rotate freely round and round like a DC motor, but rather can only turn 200 degrees or so back and forth.
---

Later in the site though, he states that have to send the right signal to make the motor go the right direction. So I'm still confused.

If I as the developer have to decide which direction to turn the servo, then I have to have some way of reading it's current location. Or is the assumption that you will just keep track of where you sent the motor last and make the decision based on that?
 
Last edited:
archaic0 said:
Seems to state that all servos have a potentiometer built in for their own sake. Shouldn't you be able to poll this?

Didn't you read my previous post?

Nigel Goodwin said:
or modify the servo to take an output from the internal potentiometer
 
Depends on what you call a servo.

@archaic0: Is a servo an integrated servo as found in a hobby context, or are you designing a motor/sensor with separate feedback?

If it's an integrated servo, it is exactly where you asked it to be, as Nigel suggested, unless it is drawing a lot of current (and/or emitting smoke).
 
I'd like to recommend the Atom interpreter chip. The two versions are based on the 28 pin PIC 16F876A and the 40 pin 16F877A. Go to basicmicro.com to check this out. Look up their "10 Projects..." book in their downloads section. A basic 28 pin interpreter chip is $20, a module around $60, and their development kits start around $100. The chip has a serial port and a bootloader built in. Download updated code at will. Great for experimenting and development on the fly.

Their biggest selling point is their BASIC, AtomBasic, for this chip. It's FREE!! It has tremendous power, though. It has commands for all the internal peripherhals of the PICs mentioned earlier: ADC, CCP (includes PWM for servo control), hardware serial, interrupts, and handy features like 32 bit math and software serial to do things like single-wire control, SPI, microwire, I2C (slave only), and lots more. It's designed to take advantage of the builtin bootloader.

Hope this helped,
kenjj
 
hi archaic0,

Attached a basic block diagram, is this what you had in mind?

This uses a DC motor to drive a 270deg rotation potentiometer, that is +/- 135deg from a central datum on the pot.

The PIC's ADC reads the pot voltage to determine the motor shafts position.

This is only a draft drawing for explanational purposes.
 
Last edited:
Another wrench in the plan for servos may be my required number of stops along the arc path. Is it plausable to find a servo with say 200 positions along a 200 degree arc? I may need stops that precise and often.

If not, then I'm down to a basic DC motor with something like ericgibbs suggested. I'd need a pretty strong and accurate dc motor, with a slow working speed, but high torque. And a potentiometer with a very precise and very sensitive output. Such that I can determine exactly where along a 200 degree arc it is rotated to with a 1 degree accuracy.

Is this all sounding possible or are my requirements too strict?
 
As long as your ADC is accurate enough and the pot is linear enough I don't see how that would be a problem.
 
Well maybe I'm being too picky about being able to confirm the position of the servo.

If I tell a servo to go to position 10, then just how reliable is it that it will make it to position 10? And if for some reason it does not make it (physical blockage) then how would I know?
 

It all depends what you mean by 'servo', generally it's considered to be a radio control type servo - I would expect their resolution to be fairly low, but you can fly an aeroplane or helicopter with them, or drive a car or boat.

If it doesn't make it, you wouldn't know - apart from the output not moving to where you told it, and the fact that the servo would be stalled and probably overheat and burn out. But even cheap R/C servos are amazingly strong devices!.

There's nothing to stop you making your own servo's, and it's already been explained - and you could add whatever features you wanted.

What exactly are you trying to do?.
 
Well the plan is basically a camera platform that would pan and tilt a camera around and take pictures once at a position.

The plan is to use 2 servos, one horizontal and one vertical. Theoretically, the mount may recieve a command to move to position 10 horizontal, position 1 vertical, and take a picture. Then move to position 140 horizontal, position 20 vertical, and take a picture.

The positions of the servo will have been previously mapped to the subject being photographed so it will be important that position 10 always results in the camera seeing the same area. The user will only be asked to push a button that is marked "parking space 1" and the camera will be required to always move to that precise position.

What kind of terminology should I be looking for with servos? I'm after one servo with at least a 180 degree arc of movement and 180 positions (so 1 degree resolution). And the second would only need to be about a 90 degree arc of movement and 90 positions.
 
Radio control servos only give a fairly limited degree of movement.

You might check here
**broken link removed**
for prices and specs.

I don't really see as your camera system has any potential problems with it not moving when told?. I would suggest getting a couple of cheap RC servos and playing with them!.
 
I plan to experiment a lot. I'm trying to educate myself as much as possible though so I can try to start as close as possible to final parts.

A quick look at that site and I found the Hitec HS55. In it's specs though, I can't tell what it's range of motion is or what it's resolution is.

OPERATING ANGLE:40 /ONE SIDE PULSE TRAVELING 400usec
DIRECTION:CLOCK WISE/PULSE TRAVELING 1500 TO 1900usec

Do these two things somehow tell me that?
 

hi,
I think you should get clear in your mind what a servo is, are you confusing servo-mechanism with servo, which can be a dc motor or stepper motor.

Your posts suggest that you are talking about a stepper motor with a potentiometer connected to the stepper motor output shaft, the pot sending back to a controller a voltage proportional to the motor shafts position.

Is this what you mean?
 
You're right, I'm not entirely sure what I need or what things are. I'm learning though, thanks to you guys.

I was told by someone that a stepper motor draws more power than a servo and would need an additional controller as many microcontrollers come with PWM ready for servos, but not stepper motors.

I need to make sure I get something that will fit my purpose though, regardless of anything else.

What are the pros and cons between a servo and stepper motor? And what factors would push the decision between the two one way or the other?
 

The PWM from a microcontroller isn't really very suitable for driving a servo, but it's trivial to do in software. Likewise it's trivial to drive a stepper motor in software.

I need to make sure I get something that will fit my purpose though, regardless of anything else.

What are the pros and cons between a servo and stepper motor? And what factors would push the decision between the two one way or the other?

A servo gives absolute postitioning (like go to 25 degrees), a stepper only gives relative positioning (like go 21 steps left) - you've no way of knowing where a stepper is, unless you add some kind of postitional feedback.

On the other hand, a stepper can rotate right round, a servo only has a limited range of movement.
 
As for the servo, just use the smaller control arms (assuming you are using a linkage and not direct drive) so that at 100% throw, the servo cannot mechanically go too far. You will get more torque that way also. This is what I do for my r/c aircraft all the time. It also reduced the torque applied to the servo from the controlled surface, which helps prevent stripping the servo if you bump the control surface(or crash...)
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…