Society of Robots - Robot Forum

Software => Software => Topic started by: robonerd137 on July 03, 2013, 10:51:47 AM

Title: DC Motor
Post by: robonerd137 on July 03, 2013, 10:51:47 AM
I am trying to control the speed of a DC motor with a micro controller. Can someone reply with some resources?
Title: Re: DC Motor
Post by: nanotechopolis_gr on July 03, 2013, 03:23:48 PM
you can use PMW !
the functions are:
1)PWM1_Init(constant long frequency) initialize the frequency parameter
2)PWM1_Set_Duty(unsigned short duty_ratio) to set the cycle , the value can be 0...255
3)PWM1_Start() for starting the PMW output
4)PWM1_Stop() for stoping the PMW  output

you can also google it! check this http://www.electrosome.com/dc-motor-speed-control-pic-pwm/ (http://www.electrosome.com/dc-motor-speed-control-pic-pwm/) for further details
Title: Re: DC Motor
Post by: robonerd137 on July 03, 2013, 04:05:17 PM
thanks so much! this will really help with my project
Title: Re: DC Motor
Post by: newInRobotics on July 04, 2013, 02:25:57 AM
I am trying to control the speed of a DC motor with a micro controller. Can someone reply with some resources?
You didn't tell us what microcontroller You are using.
Title: Re: DC Motor
Post by: waltr on July 04, 2013, 07:50:52 AM
I am trying to control the speed of a DC motor with a micro controller. Can someone reply with some resources?
You didn't tell us what microcontroller You are using.
Or what programming language.

Or which motor and its specs: Voltage, Current draw.
And if the motor draws more than a few 10's of mA then you need a driver circuit.
Do you the motor to run in both directions (CW & CCW)? or just one direction?
This will determine if a simple transistor switch or a full H-bride is required.