Problem to control servo motor

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 Hi everybody!!

actually i´m working to control a servo motor i read that the frecuency is 20 hz and the duty cycle is 1,1.5 and 2 ms
i´m using pwm16:

   


parameter pwm16
clock = 1,000,000
period= 49,999
duty cycle = 999-> 1ms->0°
                     1499-> 1.5ms -> 90°
                      1999 -> 2ms -> 180°

but the servo doesn´t work correctly don´t go to the correctly position and keeps vibrating and i don´t understand why,so if someone help me i´m really be glateful
i put my code if someone can check it

 

0 Likes
1 Solution
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I have some ref material I can send you, but it is 13M in size, so I need

   

your email address. Mine is danaaknight@gmail.com

   

 

   

Regards, Dana.

View solution in original post

0 Likes
7 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I have some ref material I can send you, but it is 13M in size, so I need

   

your email address. Mine is danaaknight@gmail.com

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 thanks a lot!!  my gmail is mobrfco@gmail.com

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your calculations seem to be correct, so let us see a bit more and post your project here, so that we all can have a look at.

   

To do so, in designer 5.3 ( I hope you already updated to, if not, do it right now) do

   

Build -> Clean Current Project

   

File -> Archieve Project (minimal)

   

and then upload the resulting archive here.

   

 

   

Happy Zipping

   

Bob

ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Ref material forwarded this morning.

   

 

   

Regards, Dana.

Anonymous
Not applicable

 It seems that a lot of servos works at 20mS period. Not sure if the is the case, have a look.

lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 Hi bob

   

here is my code it is simple beacause first i want control corectly the servo and then do an aplication
my servo is  a mg995, a friend prove with  an arduino and worked corectly so i decided control in psoc.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can you try to reduce the period to 19999 giving the required 20ms for the servo.

   

Another issue might be the power supply: the PSoC supply and the servo should be different sources only connected by GND.

   

 

   

Bob