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.

Servo motor

Status
Not open for further replies.
hi Hesham,
I have realised you uses the word 'turn' for the digital servo motor.

A servo will only 'turn' , that is rotate, less than an angle of 300 degress or so, its not a stepper motor.

Build the 555 circuit shown in the link and test/learn from the servo control before you consider using the 16F818 PIC.

I already build it!!

Nothing happen nothing rotate.

First about my project: my instructor or advisor decided that we just need to go as far as we can because he say if we never have a deadline you will never keep pulling things.
He is not interested about the result of the competition. He is interested how far we go. How much we learn!

Second about 555 timer, I build servo driver for my ds8911 servo but nothing happen here are several question i need to ask.
Q1> How you know for P1 where is 1 2 or 3?? or 1 and 3 doesn't really matter? just the middle one matter :)

Q2> I am sure that i need higher frequency rating. The one I am using now is 50Hz. I think i need to come up with a new design for 555 to run my servo motor. As the tutorial mentioned at the end there are new bread of servo motor which are know as digital servo motor. These motor need higher frequency to operate. I operate my servo motor using function generator at 300Hz. But 300Hz is just a guess. Because time is critical now, I will go with 300Hz.
If you know how I can set the period using PIC16F818 it will be great.

For fun I just bought a PIC 16F877 it so big hehe :) 40 legs
 
Last edited:
Why not learn to use MPLABs built in simulator. Try to generate a 1.5ms wide pulse with a 20ms period. The stopwatch function is quite handy.
 
Thanks blue for replying,

I connect the wires again and Ya its working now. But its shaking (jittering) in the desire place. I am not sure what wrong.

When I used function generator to operator it. It operates, but the problem is I am confused which parameter I am suppose to change duty cycle or period? Look at the diagram to understand more.

When I kept the duty cycle at 50% it operates from 0 to 120 by changing the period from 1.6ms till 4.3ms.

But when i kept the duty cycle at 20% it change from 0 to 120degree by changing the period from 4.1ms till 10.9ms.

I am confused which paramerter to change duty cycle or period. Both work, but which one is better?

When the frequency is 500Hz i can change duty cycle from 21%-62% to have that interval.

Q2> I am using pulse in function generator and its working fine when I use square wave it going crazy or jittering. You know how I can produce pulse using PIC? Any ideas?

Thanks in advance
 

Attachments

  • untitled.JPG
    untitled.JPG
    7.5 KB · Views: 393
Last edited:
Stop fussing with the function generator and guessing at values. Servos have specific parameters if you want them to function.
Here's my advice
Write code for whatever PIC you plan on using in assembler that will output a 1.5ms pulse every 20ms to port RA0 and run it using the MPLAB simulator. Stop playing with stupid values you think might work and start following specifications. You are proceeding at a snails pace because you simply don't seem to follow advice.
 
Last edited:
I agree with Bill about the stop fussing aspect and have a little experience with running model servos at more than 50 Hz.

At frequencies a lot higher than 50 Hz, you have no idea what the servo is "seeing." For example, 500 Hz is 2 ms per cycle, which is what the servo expects to see as its control pulse, not frame rate.

As for the shaking, when I ran a different brand servo (Hitec) above 150 Hz or so, I still had control of movement, but lots of buzzing and shaking.

John
 
I build this servo motor circuit
**broken link removed**
When I read the signal using Oscillascope it was reading Fine AMP +5V OnTime 1.8ms for 2.2V Analog input.
When I connect my servo it started shaking around? Any ideas why it keep shaking?
 
What's your frame rate? Did you read my post about digital servos and 555 drivers (October 28).

The shaking may be because your frame rate is too fast or just a characteristic of the circuit you are using.

John
 
Ya the frame rate is 23ms.

Any idea why it's shaking.

What's your frame rate? Did you read my post about digital servos and 555 drivers (October 28).

Can't find your post?
 
Last edited:
If your frame rate is 23mS then either your power supply is glitching or your on time is varying. Or, your servo is knackered.

Mike.
 
"power supply is glitching"
You mean I use another power supply?

your servo is knackered
I don't think it's tired. I just using a new one :) I have plenty of samples here 18 pieces
 
Last edited:
I wrote these codes in PIC16F84a
Code:
    list      p=16F84A             ; list directive to define processor
    #include <p16F84a.inc>         ; processor specific variable definitions

    __CONFIG   _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC

org 0x0
	cblock 0x0c	
	d1,d2,d3
	endc

		bsf		STATUS,RP0
		movlw	b'00000'
		movwf	TRISA
		bcf		STATUS,RP0
		
START	movlw	b'11111'
		movwf	PORTA
		call 	Delay2msec
		movlw	00h
		movwf	PORTA
		call 	Delay18msec
		goto	START

Delay18msec
			;17993 cycles
	movlw	0x0E
	movwf	d1
	movlw	0x0F
	movwf	d2
Delay18msec_0
	decfsz	d1, f
	goto	$+2
	decfsz	d2, f
	goto	Delay18msec_0

			;3 cycles
	goto	$+1
	nop

			;4 cycles (including call)
	return

Delay2msec
			;1993 cycles
	movlw	0x8E
	movwf	d1
	movlw	0x02
	movwf	d2
Delay2msec_0
	decfsz	d1, f
	goto	$+2
	decfsz	d2, f
	goto	Delay2msec_0

			;3 cycles
	goto	$+1
	nop

			;4 cycles (including call)
	return


	END
The motor goes to the desire angle :) but it shake every 0.5second and stop shaking for 1second then shake for 1/2second and doing it again and again :( Anyone know why?
 
I finish my testing and I know the working range of my servo motor its between 0.8ms and 2.1ms the angle don't know still need to get it soon :).

About shaking i will do as you said bill.

You think the control wire consume alot of current? More than the PIC can handle ? Or I am thinking too much?

Thanks in advance
 
Hello again,

I did the oscilloscope test it fine :) I can see nice square wave.
I am using the same power supply for the servo and the PIC you think that has to do something with it?

BUT the skaking is still there :(

Thanks in advance
 
Last edited:
THanks everyone for replying,

Q1> I have PIC16F877, HOw many servo motor can be controlled using it?
Q2> I need to send same command to 3 servo motor at the same time, do i hook up the RB0 to 3 servo motor?
 
A skilled programmer could drive as many servos as there are output pins.

One Output pin per servo

Stop worrying about servos till you unterstand the PIC and MPLAB better.
 
Last edited:
I am trying to design a power supply for my servo motor.
Number of servo = 18
Servo specification
Torque: 347 oz/in @ 4.8V, 403 oz/in @ 6V
Speed: .19 sec/60° @ 4.8V, .15 sec/60° @ 6V
Current rating i heard it is 2.5A at max not sure ....

Any idea how my power supply should be or ratting ?
 
Not sure exactly to what that current rating refers. Is it per servo? Those are pretty hefty servos in modeler's terms. I would not be surprised at the current rating per servo. Then you have to consider what the loaded and stalled currents are.

For example, in a simple model with typical servos (6) I use a switching supply capable of several amps, because during critical phases (like putting flaps at 90% on a fast landing approach), current drains can be quite high. I have been told more than a amp per servo, and these are just 40 in/oz servos.

Thus, can you get current drain under load and at stalled? How many servos will be loaded or stalled at the same time? How critical/damaging will it be if the supply shuts down due to overload at some point?

John
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top