DC motor control

Thread Starter

didi

Joined Oct 28, 2007
4
i want to develop a system to control a DC motor in forward and reverse directions using PIC16F84A. Also how i can add temperature sensor inputs to this system.
 

Thread Starter

didi

Joined Oct 28, 2007
4
thanks alot
ya i need to control the speed also, i did not know from where to start so i need your help.
 

beenthere

Joined Apr 20, 2004
15,819
Check earlier postings on this site about doing PWM - pulse width modulation. Go to National Semiconductor's site and get the spec sheet for LM34 or 35 (one is scaled in C, the other in F.
 

Thread Starter

didi

Joined Oct 28, 2007
4
1- the temperature sensor i want to use is to monitor the temperature of the DC motor.

2- how can i write a code for the microcontroller, it is my first trial.

so please could u help me how to start, the projet up to now is just an idea
 

beenthere

Joined Apr 20, 2004
15,819
Before you start to write the code, perhaps selecting a microcontroller would be in order. Check the several threads on this site as to which is a good choice. If one seems to interest you, look at the company's web site, especially their applications library. Chances are good there will be examples of both temperature logging and DC motor control.
 

Murod

Joined Dec 24, 2005
30
To control the speed of a dc motor, you need a speed sensor too. read the actual speed, if lower/higher than required then increase/decrease the driving power of the motor. That's the basic, but actually there are many control methods, and the most widely used is PID (Proportional, Differential, and Integral).
-------------------------
http://www.softhardzone.com : high quality free ware, electronic hardware design trick, software programming tips, and many more..
 

Thread Starter

didi

Joined Oct 28, 2007
4
thank u all
for this project i selected dsPic30F2010, although it is my first time to deal with, i went throuh microchip web site to find some examples but i failed,so know the question is how to proceed with the code :

1- i found difficulties to use the PWM function and how to call it in the main program to accelerate or decelerate the motor.
i am using the C30 compiler so my code is in C++

2- i have tried to write a small code to illuminate an LED.

any suggestions will be appreciated
 

iceman11`

Joined May 4, 2007
39
hey...the best way in my opinion is to use fast PWM mode of a micro with respect to an external voltage reference for direction - eg a pot. so if the pot is 0.1-2.4V then spin proportionally in a direction, and if the pot is 2.5 - 5V then spin proportionally in the other direction....that is the pot controls the value to be stored in the timer used for PWM generation...higher pot value means when the ADC converts it , the timer will have a higher mark to period ratio etc
 
Top