Remote Dc Drive Programm

Embed Size (px)

Citation preview

  • 8/10/2019 Remote Dc Drive Programm

    1/4

    Home | IR Remotes | RF Remotes | Industrial Automation | Embedded Systems | Robotics | Project Kits | FAQs | Download

    DCMotor control

    using C++

    DCmotor control

    using VC++

    Stepper motor

    control using VC++

    Industrial DCMotor

    Control panel

    industrial stepper

    motor control panel

    remote control for AC

    Drive

    Traffic control

    system

    Wireless DC Motor

    controller

    Wireless Stepper

    motor controller

    remote controlled DC

    drive

    Software program for remote control DC drive

    Entire program can be well explained by explaining all the functions used in this program.

    Start function is a continuous function that will rotate motor in either direction with set speed. Actually it

    generates PWM to vary the speed of motor. It will set the direction of motor and then generate PWM on either

    P3.6 or P3.7

    Intra functionis an interrupt enabled function that will receive data byte available on P1. Whenever interrupt

    arrives it will be automatically called and after some delay it will get the byte available on P1

    chngdir willchange the direction of motor every time. It increments a count every time and checks even or odd.

    If its ev en sets CW direction and vice versa

    incspeedincrease speed by one step. Actually it increases pulse width time by 1 ms. Total time is 10 ms and we

    are varying the width of pulse from 1ms to 9ms. So speed of motor varies in 8 step. That is indicated on 8 LEDbar graph. Dec speed is similar to this but it will decreases pulse width by 1 ms

    Shift upfunction is similar to rotate the content of port P2 left, once. It sends one more zero every time on P2

    pins from P2.7 to P2.0 so bar graph is raised once. shiftdown function does the reverse thing. It will send one

    more 1 on P2 pins from P2.0 to P2.7. So bargraph is reduced by once.

    Delay function is a variable delay that varies the delay from 1 ms to the count you load into the function. T0

    generates basic delay of 1ms and then this basic delay in a loop is repeated for number of times (like 2,3,4....) to

    generate delay of 2ms, 3ms, 4 ms and likewise

    Kodalyis fix delay and it is just used to settle down the data byte available on P1 from ST3049.

    Here is complete program in C language written and compiled in KEIL (IDE)

    #include

    unsigned char a;

    bdata unsigned char byte=0x0F, databyt=0x00;

    unsigned int d1=5,d2=5,c=0,f=0;

    sbit b0 = byte^0;

    sbit b1 = byte^1;

    sbit b2 = byte^2;

    sbit b3 = byte^3;

    sbit b4 = byte^4;

    sbit b5 = byte^5;

    sbit b6 = byte^6;

    http://multyremotes.com/wireless-dc-motor-control.htmhttp://multyremotes.com/traffic-control-system.htmhttp://multyremotes.com/remote-control-ac-drive.htmhttp://multyremotes.com/control-panel-for-stepper-motor.htmhttp://multyremotes.com/dc-motor-control-panel.htmhttp://multyremotes.com/stepper-motor-control-in-VC.htmhttp://multyremotes.com/DC-motor-control-in-VC.htmhttp://multyremotes.com/dc-motor-control-in-C.htmhttp://multyremotes.com/remote-controlled-dc-drive.htmhttp://multyremotes.com/wireless-stepper-motor-control.htmhttp://multyremotes.com/wireless-dc-motor-control.htmhttp://multyremotes.com/traffic-control-system.htmhttp://multyremotes.com/remote-control-ac-drive.htmhttp://multyremotes.com/control-panel-for-stepper-motor.htmhttp://multyremotes.com/dc-motor-control-panel.htmhttp://multyremotes.com/stepper-motor-control-in-VC.htmhttp://multyremotes.com/DC-motor-control-in-VC.htmhttp://multyremotes.com/dc-motor-control-in-C.htmhttp://multyremotes.com/downloads.htmhttp://multyremotes.com/faqs.htmhttp://multyremotes.com/project-kits.htmhttp://multyremotes.com/robotics.htmhttp://multyremotes.com/embedded-systems.htmhttp://multyremotes.com/industrial-automation.htmhttp://multyremotes.com/RFRemote.htmhttp://multyremotes.com/irremote.htmhttp://multyremotes.com/home.htm
  • 8/10/2019 Remote Dc Drive Programm

    2/4

    sbit b7 = byte^7;

    sbit led1=P3^0;

    sbit led2=P3^1;

    sbit led3=P3^4;

    sbit led4=P3^5;

    sbit op1=P3^6;

    sbit op2=P3^7;

    void keyde ly()

    {

    int x,y;

    for(x=0;x

  • 8/10/2019 Remote Dc Drive Programm

    3/4

    {

    d1++;

    d2--;

    shiftup();

    P2=byte;

    }

    }

    void decspeed()

    {

    if(d2

  • 8/10/2019 Remote Dc Drive Programm

    4/4

    keydely();

    databyt=P1;

    }

    void main()

    {

    int tmp=0;

    TMOD = 0x01;

    P3=0x04;

    P2=byte;

    led2=1;

    led3=1;

    IE=0x81;

    back: while(databyt==0x00);

    check: switch(databyt)

    {

    case 0xD2:

    tmp++;

    if((tmp%2)==1)

    {

    f=1;

    databyt=0x00;

    start();

    }

    else

    {

    f=0;

    led2=1;

    led1=0;

    databyt=0x00;

    op1=0;

    op2=0;

    }

    break;

    case 0xD6:

    incspeed();

    databyt=0x00;

    start();

    break;

    case 0xD7:

    decspeed();

    databyt=0x00;

    start();

    break;

    case 0xD3:

    chngdir();

    databyt=0x00;

    start();

    break;

    }

    if(f==0)goto back;

    else goto check;

    }

    All the projects are designed and developed by sight owner and they are thoroughly tested by him. Copyrights Ashutosh Bhatt 2010. All rights reserved.