DC motor control

Discussion in 'Embedded Systems and Microcontrollers' started by didi, Oct 28, 2007.

  1. didi

    Thread Starter New Member

    Oct 28, 2007
    4
    0
    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.
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Do you need speed control as well? Assuming there is an A to D converter in the PIC, look at LM34 or 35's.
     
  3. didi

    Thread Starter New Member

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

    Active Member

    Oct 25, 2007
    42
    0
    hello
    for making a speed control you can use diode networks because any diode decrease 0.7 volt.
    Eplanet
     
  5. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    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.
     
  6. didi

    Thread Starter New Member

    Oct 28, 2007
    4
    0
    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
     
  7. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    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.
     
  8. Murod

    Active Member

    Dec 24, 2005
    30
    0
    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..
     
  9. didi

    Thread Starter New Member

    Oct 28, 2007
    4
    0
    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
     
  10. iceman11`

    Active Member

    May 4, 2007
    39
    0
    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
     
  11. kokodada

    New Member

    Feb 11, 2008
    1
    0
    you can used H-bridg to control the direction of your motor
     
Loading...