Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

DC Motor Postion control help (servo)

Status
Not open for further replies.

lompa

New Member
I am looking to control the postition of a DC motor, eg stop and a specified angle (not speed control).

I understand i can use a RC servo motor for this, but as it is a project i would really like to control a basic DC motor, i have been looking on the internet and i have found that this looks really dificucult so i may have to go down the RC servo route.

I have found some info on RC servos, and i have found that they are controlled by PWM.

Basically i am wanting to have a pot that i would turn and the output of the servo would move and stay in the required postition. I would liek to do this with a PIC microprocessor, what pic chip would you recommend as i would need to use PWM i think?

also does anyone have any information on how i would go about making the pulse width output varying depending on the input pot? i do not know that much about programming pics you see.

any Schematics about how this would be encorported would be much appreciated, thank you for your time

Matthew Elliott
 
lompa said:
I am looking to control the postition of a DC motor, eg stop and a specified angle (not speed control).

I understand i can use a RC servo motor for this, but as it is a project i would really like to control a basic DC motor, i have been looking on the internet and i have found that this looks really dificucult so i may have to go down the RC servo route.

You may as well, because all you would be doing is building a servo using a DC motor - it's a LOT easier to use a ready built one.

I have found some info on RC servos, and i have found that they are controlled by PWM.

No, they are controlled by a variable width pulse, this isn't the same thing as PWM - PWM is used to control the speed of a DC motor.

Basically i am wanting to have a pot that i would turn and the output of the servo would move and stay in the required postition. I would liek to do this with a PIC microprocessor, what pic chip would you recommend as i would need to use PWM i think?

I once looked into using the PWM module in a PIC to generate servo pulses, it seemed extremely poor for the task (because PWM isn't what's required). You can do it fairly easily in software, if you search on the web there's loads of examples. The pulses should repeat every 20mS or so, but it's VERY uncritical, it's the width of the pulse which determines the position.
 
thanks for the help. the bit that im most stuck with is how the "variable width pulse" can be varied depending on the output from a control pot

i guess i would need the output from the pot to ajust the pulse time within the PIC sofware there for altering the servo position.

I have found guides on the internet to just program the PIC to move the servo in different ways, but i have found none with input control

any help much appreciated, thanks for your time


P>S would a 16F84 do the job?
 
lompa said:
thanks for the help. the bit that im most stuck with is how the "variable width pulse" can be varied depending on the output from a control pot

i guess i would need the output from the pot to ajust the pulse time within the PIC sofware there for altering the servo position.

Yes, simply read the position of the pot and alter the pulse width routine accordingly - the width of the pulses should vary from roughly 1mS to 2mS, with 1.5mS being the centre position. So your pulse width routine should always have a minimum of 1000uS, and the variable part needs to change from 0uS to 1000uS, giving the 1000-2000uS range require. If you use the 10 bit A2D converter in many PIC's this gives a value from 0-1023, which is pretty spot on for the 0-1000uS range required. All you have to do is arrange for a delay time based on 1uS per value in the A2D reading.

I have found guides on the internet to just program the PIC to move the servo in different ways, but i have found none with input control

any help much appreciated, thanks for your time


P>S would a 16F84 do the job?

Yes, but it's an obselete chip, I would suggest it's cheaper modern replacement the 16F628 - or, better still, the 16F819 which has 10 bit A2D, making your pot reading easier. To use the 16F628, or the 16F84, which don't have A2D, have a look at my joystick reading tutorial.
 
does anyone know of any availble schematics of this idea?

i am unsure how to draw up the schmatic?

i would need a POT on the input that would go to the ADC on the PIC and a servo on the output and a regualted power supply. if anyone could help me out with this i would really appreciate it as im struggling

thank you
 
lompa said:
does anyone know of any availble schematics of this idea?

i am unsure how to draw up the schmatic?

i would need a POT on the input that would go to the ADC on the PIC and a servo on the output and a regualted power supply. if anyone could help me out with this i would really appreciate it as im struggling

thank you
i think they use a special pot ( not sure) but one that could turn 360 degrees...
 
the pot is ordinary pot what is used in servos cause servo turns 63 degrees right and 63 degrees left
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top