Menu

BasicDRV8825Test problem

Magnus L
2016-02-15
2016-02-20
  • Magnus L

    Magnus L - 2016-02-15

    Hi!

    I'm new to Arduino, but have managed to build this focuser, using the full option (DRV8825 and HW203), and would now like to test it. I downloaded the BasicDRV8825Test program, but is seems to run only one step, then reverse, rather than 200 steps (full revolution). I don't have a LED so I cannot see the output text, but I'm been experimeting with the delay times to be able to hear where in the loop it is.

    For instance, when I set the delay time to be 2000, 500, 500, 500 respectively, in the loop section, I would expect 200 steps in clockwise, then 2 secs pause, then 200 steps counterclockwise - right? What I have is one (1) step in one direction, 2 secs of pause, then in step in the other direction, a short (0.5 sec) pause, and then two more quick steps with 0,5 sec between then, so back to the "one step 2 sec pause".

    So it doesn't look like it takes a full turn.

    Now, is this a misunderstanding on my part (newbie), a software problem, or an indication that my build is faulty?

    Magnus

     
  • brownrb

    brownrb - 2016-02-15

    Using the test program as you descibed, you can see the output using the serial monitor window of the Arduino IDE.
    Once you have downloaded the program, you then open the serial monitor window and you will see the results as the program works through each step (ensure the baud rate of the serial monitor is 9600)
    What you should see is
    Clockwise 200 steps - Full steps
    Wait 2s
    Anti-Clockwise 200 steps - Full steps
    Wait 2s
    Clockwise 200 steps - Half steps
    Wait 2s
    Anti-Clockwise 200 steps - Half steps
    Wait 2s

    For a standard NEMA17 stepper, it is rated at 200 steps per revolution. So you would expect it to go one full revolution, pause, one full revolution the other way, pause, 1/2 a revolution one way, pause then 1/2 a revolution the other way.

    If the stepper is not turning properly, there are possible causes
    1. You are not using 12V
    2. The stepper motor wires are connected wrong
    3. The reference voltage of the DRV8825 is not set properly (this must be set according to that described in the manual pdf)

    Are you using 12V connected to the controller?
    What stepper motor are you using?
    What hardware build are you using?
    What is the arduino firmware file (ino) you are using?
    What was the reference voltage on the pot of the DRV8825 set to?

    Cheers
    Robert

     
  • brownrb

    brownrb - 2016-02-15

    If you have the HW203 build, please use this test program

     
  • Magnus L

    Magnus L - 2016-02-20

    Hi!

    Great, thanks. I'm back at it now. I've adjusted the trim-pot to 0,173 V. And I tried the program you attached, but it gives me compilation errors:

    Arduino:1.6.7 (Linux), Kort:"Arduino Nano, ATmega328"

    /home/magnus/Dropbox/focuser_projekt/BasicDRV8825Test/BasicDRV8825HW203Test.ino:9:0: warning: "myM2" redefined [enabled by default]
    #define myM2 5 // microstepping lines
    ^
    /home/magnus/Dropbox/focuser_projekt/BasicDRV8825Test/BasicDRV8825Test.ino:11:0: note: this is the location of the previous definition
    #define myM2 7
    ^
    /home/magnus/Dropbox/focuser_projekt/BasicDRV8825Test/BasicDRV8825HW203Test.ino:11:0: warning: "myM0" redefined [enabled by default]
    #define myM0 7
    ^
    /home/magnus/Dropbox/focuser_projekt/BasicDRV8825Test/BasicDRV8825Test.ino:9:0: note: this is the location of the previous definition
    #define myM0 5 // microstepping lines
    ^
    BasicDRV8825HW203Test:17: error: redefinition of 'int boardstate'
    int boardstate;
    ^
    BasicDRV8825Test:17: error: 'int boardstate' previously declared here
    int boardstate;
    ^
    BasicDRV8825HW203Test:24: error: redefinition of 'int stepontime'
    int stepontime = 5;
    ^
    BasicDRV8825Test:24: error: 'int stepontime' previously defined here
    int stepontime = 10; // changed 20141230 - seems better when 1/4 and 1/8 stepping
    ^
    BasicDRV8825HW203Test:26: error: redefinition of 'int motorSpeedSlow'
    int motorSpeedSlow = 15;
    ^
    BasicDRV8825Test:26: error: 'int motorSpeedSlow' previously defined here
    int motorSpeedSlow = 40; // for 1000 half steps = about 56s
    ^
    BasicDRV8825HW203Test:27: error: redefinition of 'int motorSpeedMed'
    int motorSpeedMed = 8;
    ^
    BasicDRV8825Test:27: error: 'int motorSpeedMed' previously defined here
    int motorSpeedMed = 18; // for 1000 half steps = about 36s
    ^
    BasicDRV8825HW203Test:28: error: redefinition of 'int motorSpeedFast'
    int motorSpeedFast = 2;
    ^
    BasicDRV8825Test:28: error: 'int motorSpeedFast' previously defined here
    int motorSpeedFast = 2; // for 1000 half steps = about 18s
    ^
    BasicDRV8825HW203Test:29: error: redefinition of 'int motorSpeed'
    int motorSpeed = motorSpeedMed;
    ^
    BasicDRV8825Test:29: error: 'int motorSpeed' previously declared here
    int motorSpeed = motorSpeedMed; // changed 20141230 - seems better when 1/4 and 1/8 stepping
    ^
    /home/magnus/Dropbox/focuser_projekt/BasicDRV8825Test/BasicDRV8825HW203Test.ino: In function 'void enableoutput()':
    BasicDRV8825HW203Test:32: error: redefinition of 'void enableoutput()'
    void enableoutput() {
    ^
    BasicDRV8825Test:32: error: 'void enableoutput()' previously defined here
    void enableoutput() {
    ^
    /home/magnus/Dropbox/focuser_projekt/BasicDRV8825Test/BasicDRV8825HW203Test.ino: In function 'void anticlockwise()':
    BasicDRV8825HW203Test:37: error: redefinition of 'void anticlockwise()'
    void anticlockwise() {
    ^
    BasicDRV8825Test:37: error: 'void anticlockwise()' previously defined here
    void anticlockwise() {
    ^
    /home/magnus/Dropbox/focuser_projekt/BasicDRV8825Test/BasicDRV8825HW203Test.ino: In function 'void clockwise()':
    BasicDRV8825HW203Test:45: error: redefinition of 'void clockwise()'
    void clockwise() {
    ^
    BasicDRV8825Test:45: error: 'void clockwise()' previously defined here
    void clockwise() {
    ^
    /home/magnus/Dropbox/focuser_projekt/BasicDRV8825Test/BasicDRV8825HW203Test.ino: In function 'void setstepmode(int)':
    BasicDRV8825HW203Test:53: error: redefinition of 'void setstepmode(int)'
    void setstepmode( int stepmode ) {
    ^
    BasicDRV8825Test:53: error: 'void setstepmode(int)' previously defined here
    void setstepmode( int stepmode ) {
    ^
    /home/magnus/Dropbox/focuser_projekt/BasicDRV8825Test/BasicDRV8825HW203Test.ino: In function 'void setup()':
    BasicDRV8825HW203Test:89: error: redefinition of 'void setup()'
    void setup() {
    ^
    BasicDRV8825Test:89: error: 'void setup()' previously defined here
    void setup() {
    ^
    /home/magnus/Dropbox/focuser_projekt/BasicDRV8825Test/BasicDRV8825HW203Test.ino: In function 'void loop()':
    BasicDRV8825HW203Test:109: error: redefinition of 'void loop()'
    void loop() {
    ^
    BasicDRV8825Test:109: error: 'void loop()' previously defined here
    void loop() {
    ^
    exit status 1
    redefinition of 'int boardstate'

    This report would have more information with
    "Show verbose output during compilation"
    enabled in File > Preferences.

    What to do with this?

    Magnus

     
  • Magnus L

    Magnus L - 2016-02-20

    Hi again!

    On second thoughts, the above compilation problems are not so important anymore, unless others experience the same. I now am able to run the windows application and control the focuser nicely, so everything seems to work.

    Next question is then: how do I connect to it with Indi? (I normally run Linux and Indi)

    Magnus

     
  • brownrb

    brownrb - 2016-02-20

    Hi Magnus
    Arduino IDE 1.6.7 seems to causing a lot of headaches here for more than one user.

    I previously used 1.6.4 for all development.

    I installed 1.6.7 and immediately started getting all sorts of errors at compilation time, on code that I know works fine and has never had an issue.

    I have reverted back to 1.6.4 (after unistalling 1.6.7 and deleting all libraries and user libraires , then copied all the libraries I use back in the documents/Arduino/libraries folder) and all the errors go away.

    About Indi.
    Indi supplies drivers for the Moonlite focuser range. So you need a driver that is moonlite compatible,
    This means
    - you have to use myFocuserPro version 1 ascom drivers, arduino firmware, and windows app

    All you then do is connect as if its a moonlite device. Dont expect a whole lot of other features that is part of myFocuserPro - the moonlit driver only supports basic commands but you can connect and control the focuer in/out, halt, move, get temperature. ie, basic stuff you can do with any focuser.

    myFocuserPro version1 is found here.
    https://sourceforge.net/projects/arduinofocuscontrollerpro/

    you can use the same hardware you have now.

    There is a video by Jullian Mullins on using myFocuserPro1 under a Mac.
    https://www.youtube.com/watch?v=ZwHTn6jpqvQ

     

Log in to post a comment.