Results 1 to 17 of 17

Thread: Help: How to control DC Motor using VB Expres 2005

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    9

    Re: Help: How to control DC Motor using VB Expres 2005

    im using ldr to sense the revolution of the motor per minute or per second, pls help im a beginner and still don't know how to program well.

    my program is not working


    dim x as integer
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    Label1.Text = Inp(889)
    X = X + 1

    End Sub

    End Sub

  2. #2

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    9

    Re: Help: How to control DC Motor using VB Expres 2005

    to be more easier for us both, and not to be unfair for others like what you have said a while ago, lets make the code easier. lets say i have a button tool.
    by clicking the button how will i compute and display the no of times i clicked it per minute?
    Last edited by shounenbat; Aug 30th, 2007 at 12:50 PM.

  3. #3
    Fanatic Member Andy_P's Avatar
    Join Date
    May 2005
    Location
    Dunstable, England
    Posts
    669

    Re: Help: How to control DC Motor using VB Expres 2005

    There are a couple of ways you could work out RPM:

    1. Count pulses and test the count after a set period of time, eg. 1 second.
    2. Detect how much time passes between pulses.

    I would suggest that option number 1 will be easier.

    Take your input and increment a counter with each pulse you get.

    On each timer tick, read the counter value and multiply it by 60. This will give you RPM assuming a tick frequency of 1 second, and also assuming you have one pulse per revolution of your motor. After you have calculated a result for that tick, reset your counter variable.

    Really though, that's mostly just basic maths.

    How you read in the input from the sensor, I have no idea, but I assume you already know that, or it forms part of the study material for you project.

    As has been mentioned, I don't think anyone will write out a whole load of code for you, but that should give you a nudge in the right direction.
    Using Windows XP Home sp3
    Mucking around with C# 2008 Express
    while ( this.deadHorse ) { flog( ); }


  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    9

    Re: Help: How to control DC Motor using VB Expres 2005

    tanx Andy_P i'll try to work on it.

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    9

    Re: Help: How to control DC Motor using VB Expres 2005

    Public X As Integer
    Public y As Integer

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

    Timer1.Interval = 1000

    X = (X + 1)

    Label1.Text = X ' this show the timer tick every sec

    label2.text=inp(889) 'signal coming from my ldr




    you have said that the count of my signal should be multiplied by 60, then should i declare an integer to show the rpm??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width