Results 1 to 5 of 5
  1. #1
    New Member
    Join Date
    Apr 2013
    Location
    NH, USA
    Posts
    1
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Arduino and Stepper motor Control

    Hello All,

    Thanks for a great site.
    I am starting from scratch so I would like to build a couple items.
    The first is a stepper motor altimeter from Mike Powell's book. I love the design and I think the Arduino will be able to drive it.
    My question is, how do we physically initialize the device. I am sure that the setup loop can read the value from Link2FS, but how does the stepper motor know.

    Just a newbie question.

    Thanks in advance.

    John

  2. #2
    10+ Posting Member
    Join Date
    Mar 2013
    Location
    UK
    Posts
    10
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino and Stepper motor Control

    I'm no expert with the arduino, but you can get a special 'shield' for it to be used with servos and motors. Maplin sell them in uk.

  3. #3
    500+ This must be a daytime job



    Join Date
    Oct 2009
    Location
    Juneau, AK
    Posts
    619
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino and Stepper motor Control

    You have to have something to set the motor to a known position, then it can count its way to where it needs to go. I think this was done in the book with a light sensor on one side of a perforated circular plate with a light on the other. The motor spins the plate. When the hole lines up the light triggers the sensor to tell the program where the zero point is. The controller program can then send the correct direction and number of steps to go to the desired position.

    Reid
    http://juneaucessnasim.blogspot.com
    N58243 (virtual)- Low and Slow...

  4. #4
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    May 2012
    Location
    SC, USA
    Posts
    9
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino and Stepper motor Control

    Interesting question... I guess I have sort of 'taken this issue for granted' and never really given it a lot of thought. Really easy to run down a rabbit hole when you start factoring in issues of precision... how accurate of an initial setting do you need, and for the precision of a given stepper, what level of accuracy can you achieve... hmmm... good stuff that I need to know... guess I will get starting figuring this out.... Good question !!
    Don't know a thing....
    Making slow progress at www.erj145.com

  5. #5
    150+ Forum Groupie BuzziBi's Avatar
    Join Date
    Mar 2013
    Location
    Norway
    Posts
    275
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Post Re: Arduino and Stepper motor Control

    Among the many things that lies on the work desk for the time being, I also find a project to create an altimeter.
    (But right now I'm rebuilding the trottle quadrant on my saitek)
    I can say a little about my plans so far.
    I want a clockwork (ok, it runs 12 hours).
    I will try to drive it with a stepper motor.
    To define a zero point, I'll try making something like this:
    13-06-2013 11-55-49.jpg
    A disk on the shaft of the hour pointer. An IR sensor from an old tuner and an IR Led from remote control.
    The code works and I will use it to start / stop the stepper motor.

    Code:
    #
    define IRsensorPin 9
    #define IRledPin 10
    #define D13ledPin 13 / to check if the sensor and led works 
    
    
    void IR38Write() {
      for(int i = 0; i <= 298; i++) {
        digitalWrite(IRledPin, HIGH);
        delayMicroseconds(13);
        digitalWrite(IRledPin, LOW);
        delayMicroseconds(13);
      }
    }
    void setup(){
      pinMode(IRledPin, OUTPUT);
      digitalWrite(IRledPin, LOW);
      pinMode(D13ledPin, OUTPUT);
      digitalWrite(D13ledPin, LOW);
    }
    void loop(){
      IR38Write();
      if (digitalRead(IRsensorPin)==LOW){
        digitalWrite(D13ledPin, HIGH);
      } else {
        digitalWrite(D13ledPin, LOW);
      }
      delay(100);
    }
    I had to change the value in the
    Code:
    for(int i = 0; i <= 298; i++) {
    to customize it to fit my sensor, but it works.
    I also have to find a way to manually reset the altimeter, a knob?
    The code for the altimeter, must start by running the steppermotor/clockwork CCW to find the zero point on the disk at startup, and then retrieve values ​​from Link2fs.

    Is there anyone out there who has come further than the planning of the altimeter, it would have been great with some input

    Info about IR Sencor: How to use infrared receiver sensors for collision avoidance | Let's Make Robots!
    Life was hard, but then came Windows 7.
    Now we can fly! --------
    --------