control a servo motor with a PSoC card

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

cross mob
gbrochard
Level 1
Level 1
First question asked Welcome!

Hello

currently high school student in Terminal STI2D in france, i need in the frame of my classes, control a servo motor with a PSoC Card. Despite a many research in web, I can't find any information.

could you help me. Please.

 

Cordially

 

Gabin BROCHARD

0 Likes
1 Solution

gbrochard,

To summarize Wiki, to control a servo you need to generate a train of short pulses (between 1ms to 2ms long), repeating each 20ms (50Hz). When pulses length is 1ms, the servo is in 0deg position, and for 2ms pulses it rotates to 90deg position.

     The pulse train can be generated by various techniques, the simplest one would be using  PWM block in a Single Shot mode, triggered by a 50Hz clock. When PWM Compare register varies between 100 to 200 (using 100kHz PWM clock), the output pulse will change from 1ms to 2ms. 

     For more meaningful help, please provide the servo's part number. 

View solution in original post

0 Likes
3 Replies
BiBi_1928986
Level 7
Level 7
First comment on blog 500 replies posted 250 replies posted

Hello.

Have a look at this page for detailed description on how a servo works:
Servo (radio control) - Wikipedia
Hobby Servo Tutorial - learn.sparkfun.com

There are thousands of examples on the web showing how a servo works that you can adapt for your project.

Regards.

0 Likes

gbrochard,

To summarize Wiki, to control a servo you need to generate a train of short pulses (between 1ms to 2ms long), repeating each 20ms (50Hz). When pulses length is 1ms, the servo is in 0deg position, and for 2ms pulses it rotates to 90deg position.

     The pulse train can be generated by various techniques, the simplest one would be using  PWM block in a Single Shot mode, triggered by a 50Hz clock. When PWM Compare register varies between 100 to 200 (using 100kHz PWM clock), the output pulse will change from 1ms to 2ms. 

     For more meaningful help, please provide the servo's part number. 

0 Likes
WaMa_286156
Level 5
Level 5
First comment on blog 100 replies posted 50 replies posted

If you are looking at an R/C servo motor system, you send out a series of pulses at a base frequency.  If I remember correctly, the "center" frequency is 1,000 hertz.  moving higher that 1,000 hertz moves the servo one direction, lower than 1000 hertz moves the servo another direction.

Try using some PWM's.

If you are controlling a stepper motor, I have an article at https://socmaker.com/?p=940 that shows the internal PSOC5LP components to help you do that.

 

 

0 Likes