Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help with precisely controlling Servo motor.

Status
Not open for further replies.

pareshmhetre

Junior Member level 1
Joined
Jul 10, 2010
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Pune, India
Activity points
1,382
I am working on creating a mount for CCTV cameras, that can rotate 360 degree along X-axis and 90 degree along Y-axis.

I want this mount to consist of two servo motors for each axis. These will be driven by a Microcontroller, through serial comm.

My application is very specific to the Angle of the movement, and needs high precision. I need help to drive the servo motors, accurately via the Microcontroller.

In short, I want to feed in an Angle from my computer to the device, which should in turn give the exact change in angle of the camera view.

Currently working with 8051, is there any other controller recommended to be used with a servo motor?

Or, if 8051 how would that be done?
 

take a value in a variable and den convert the degree into PWM and it will do the rest of the rotation
 

could plz elaborate with converting degree to pwm?

With PWM, I assume the motor speed will be controlled. If not what will be the relation between PWM and the Angel provided?
 

Hi

Use STM32F101 instead of 8051 he have match better PWM timers and lot of demo code for showing you how to use it.

All the best

Bobi

The microcontroller specialist
 

a stepper motor could easily do the job.

Why use PWM for such a simple project ??
 

thanks

@bobcat1 i hav hands on experience on 8051 family only. is it feasible to switch directly to STM32F101..?
But i didn't got how to handle the encoder signal.....?

@arbj i want to move camera very smoothly. Due to the step angle movement i m avoiding stepper motor..
 

you can pretty much do it with any mcu. it is easier with a mcu that has pwm capabilities but that's not a must.

the dumbest approach is to count cycles. you need to first find the spec for your servo motor, like how long the cycle has to be and how long the pulse has to be.

what's remaining would be to generate desired pulse width for a given number of cycles.

something like this:

Code:
set output to 1;
for (cycle_count=0; cycle_count<MAX_COUNT; cycle_count++) {
  if (cycle_count == CYCLE_WIDTH) set output to 0;
}

you can put more "if" there if you want more channels.
 
i want to move camera very smoothly. Due to the step angle movement i m avoiding stepper motor

Smooth movement can be achieved using a stepper motor and a good driver
 

@pareshmhetre

PWM would be quite easy to implement on 8051 also receiving uC will need to work on only 2 things ie 1.receiving data for PWM & 2.doing PWM...

PWM is usually implemented for speed control...so it can decide how smoothly/rapidly ur camera will rorate...& the rotation can be implemented using switch (Keyboard in this case)...

The speed of rotation would be fixed but the rotation would be controlled by keyboard....(For the keypressed the camera will rotate & stop on keyrelease)

I guess this would be a substitute for rotation by angle....I had the same idea of camera control...will work on it...

Regards..

Sidy.
 

thnks @sidy50
I am currently concentrating on servo motor control.


actual concept of the project is like:
User has to enter Angle values in Degrees from the PC. (Movements of X-axis and Y-axis)

Thnks for suggesting key control. I wil definitely use it for testing of motor control
 

Thank you all for helping me through the PWM concept.

Can anyone suggest me a 5V Servo motor along wid a datasheet?

Help appreciated! :)
 

hello,
can anyone suggest the company and motor (part no) ?
I spent too much time on product surfing but didn't find suitable one..
thanks.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top