Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 1st December 2006, 12:17 PM   (permalink)
Question Servo Controll... In reverse?

Hi,

Just one quick question, and one more difficult one...

Looking at http://www.imagesco.com/articles/picservo/03.html Is that pretty accurate as far as controlling Servo with a PIC?

Based on the 4MHz Crystal, how do I know that sleep 18 in the asm will give me a period of 18ms ?

Ok, so now that is all sorted out, and I have my PIC controlling the position automatically of the Servo. To make it easy, let's say the PIC sends the Servo from Position 0 to 180 or anywhere in between.

If I want to control this manually now?? I cut the power to the Servo, the Servo remains at what ever position the PIC left it in. Manually turning the Servo, how can I read what position the Servo is at??

Thanks,
__________________
Regards,
Chris.
savage is offline  
Reply With Quote
Old 1st December 2006, 12:23 PM   (permalink)
Default

Quote:
Originally Posted by savage
Hi,

Just one quick question, and one more difficult one...

Looking at http://www.imagesco.com/articles/picservo/03.html Is that pretty accurate as far as controlling Servo with a PIC?

Based on the 4MHz Crystal, how do I know that sleep 18 in the asm will give me a period of 18ms ?
It's not assembler, it's BASIC, and the 18mS delay will be plenty accurate enough.

Quote:

Ok, so now that is all sorted out, and I have my PIC controlling the position automatically of the Servo. To make it easy, let's say the PIC sends the Servo from Position 0 to 180 or anywhere in between.

If I want to control this manually now?? I cut the power to the Servo, the Servo remains at what ever position the PIC left it in. Manually turning the Servo, how can I read what position the Servo is at??
You don't, there's no output from a servo (except the mechanical one), when you power back up the servo will move itself to whatever position the program tells it to. You also shouldn't reply on turning the PIC off and the servo staying where it is, servo's aren't designed to do that.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Old 1st December 2006, 12:51 PM   (permalink)
Default

Wow, that was helpfull.

So with the 4Mhz crystal, how do I know that 18 is enough? How is it calculated?

And yes, I know I can't read a value from a Servo, and no, I'm not powering down the PIC, I'm powering down the Servo just like I typed the first time...

Guess I'll have to come up with something machanical to read the position...
__________________
Regards,
Chris.
savage is offline  
Reply With Quote
Old 1st December 2006, 01:10 PM   (permalink)
Default

Quote:
Originally Posted by savage
Wow, that was helpfull.

So with the 4Mhz crystal, how do I know that 18 is enough? How is it calculated?
The BASIC program should specify what the clock frequency is, and produce delays accordingly. 18 is chosen because servos run on a 20mS repetition, with the active pulse being between 1mS or 2mS - so 18 and 2 make 20mS. The 20mS isn't critical, so the 19mS for a minimum pulse doesn't matter.

Quote:

And yes, I know I can't read a value from a Servo, and no, I'm not powering down the PIC, I'm powering down the Servo just like I typed the first time...

Guess I'll have to come up with something machanical to read the position...
Why do you need to do that?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Old 1st December 2006, 01:24 PM   (permalink)
Default

4 Servos controlled by 1 Pic. All 4 Servos (mostly) will be kept in sync.

In certain conditions, 1 or more of the Servos will be switched off and needs to go to idle (position). In other circumstances, the levers attached to the Servos will have to be controlled manually, instead of automatically.

Think for example hmm.. A throttle handle.

1) You can control the throttle manually by adjusting the position of the lever (here, I need to read the position), or
2) The throttle can be automatically controlled by something else (in my case a pic), in which case I need to move the lever to the corresponding condition....

Practical example... Throttle levers on a airplane?
__________________
Regards,
Chris.
savage is offline  
Reply With Quote
Old 1st December 2006, 01:30 PM   (permalink)
Default

You wouldn't normally force a servo mechanically, it's not going to help it last very well - for your throttle example I would suggest a clutch between motor and lever, so the clutch slips if you push the throttle manually. You then need a feedback device on the throttle itself, so you don't need a servo to power it, just a motor/gearbox - the feedback device on the throttle then becomes the feedback part of a servo system - but externally, not in a single unit.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Old 1st December 2006, 02:46 PM   (permalink)
Default

A servo is controlled internally by that type of feedback system; if you open one up you'll find a potentiometer, by which it measures its own position. To read the position of the servo, probably the easiest possible way would be to simply run an extra wire into it to directly measure the potentiometer output. What nigel says is entirely true though, the servo is probably not going to last long, especially if you use one of the ones with plastic gears instead of metal gears. If you're trying to build a high-quality system, a clutch-type setup as nigel suggests is probably a much better bet, but if you're just trying to throw something together that doesn't have to last forever, measuring the servo pot is probably the easiest and cheapest solution.
__________________
EEgeek.net
evandude is offline  
Reply With Quote
Old 1st December 2006, 02:57 PM   (permalink)
Default

That has crossed my mind yes... Re my reference to 'something machanical', it was precisely refering to a external or seperate module to read the position... It should be relatively easy to do with a couple of sensors, or even a POT...

If the Servo is switched of, and you do NOT manually turn the Servo over it's min/max turn rate, surely it can't really cause damage?? Remember the enclosure for the throttles will have to automatically be able to turn 0 to 90 degrees... I'm thinking of making the enclosure so that the Servo can only turn 5 to 85 degrees (and obviously program the PIC as such as well). Thus, it will be impossible to over turn considering that you will hit the end of the enclosure 5 degrees before the over turn point of the Servo?
__________________
Regards,
Chris.
savage is offline  
Reply With Quote
Old 1st December 2006, 03:00 PM   (permalink)
Default

Hmm Evandude... Good point. I wasn't thinking about the gears...

I am talking very low RPM here for operational use... But point taken. Will have to spend some more time with the thinking cap on infront of the drawing board. Atleast I can control the Servos now
__________________
Regards,
Chris.
savage is offline  
Reply With Quote
Old 1st December 2006, 03:10 PM   (permalink)
Default

Can you tell us more why can't you do the manual lever adjustment via the PIC using up/down buttons instead of manually moving the servo unit output lever?

You may have to first disable the software servo auto adjustment loop first.
__________________
L.Chung
eblc1388 is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
555 servo controller? can get them working lompa General Electronics Chat 9 31st May 2007 06:24 AM
Converting A DC motor to ServoMotor holobean Electronic Projects Design/Ideas/Reviews 22 31st May 2006 10:00 PM
Replacing RC Servo w/ Custom PCB (Open Servo) dknguyen Electronic Projects Design/Ideas/Reviews 3 29th May 2006 02:48 AM
Help required with servo motor controller mayhem Robotics Chat 3 26th May 2006 04:21 PM
Determining lifting capacity of a servo Jerran Robotics Chat 4 24th October 2004 10:53 PM



All times are GMT. The time now is 07:28 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.