Menu

Rotator step configuration issue

Alessio
2022-12-27
2023-03-06
1 2 > >> (Page 1 of 2)
  • Alessio

    Alessio - 2022-12-27

    Hi, I built my rotator with DRV8825 driver board and Nema17 motor (1.8° step angle), a 14 teeth pulley on motor and a 110 teeth pulley on focuser (ratio is 110/14=7.9). This gives me a number of steps for a complete rotation equals to 1571 steps. In the file myrotatorconfig.h I changed the value of RotatorMaxSteps=1571. However, when I command through Win application a complete rotation of 360°, focuser rotate significantly less of 360°. Where am I wrong?
    Thank you.

     
    • brownrb

      brownrb - 2023-01-22

      Hi Alessio
      a 110 teeth pulley on focuser?
      Can you please send me a photo of your setup.

      regards
      Robert

       
  • brownrb

    brownrb - 2022-12-27

    Hi
    From memory, I don't think I included any maths to work out what 1 rotation is in terms of motor steps? So I am not sure that the calculation is correct. It is always best to use a reduction gearing that equates to an integer.

    I undertand that in the myrotatorconfig.h file for the rotator you would have declared
    long int RotatorMaxSteps = 1571;
    In the past I just set a mark, stepped the motor keeping track of the steps, until it rotated back to the mark and that gave me the maxsteps.

    I will add a better interface to the windows application, so you can change things.

    Regards
    Robert

     
  • brownrb

    brownrb - 2022-12-27

    Please try this updated Windows App that has a motor control tab so you can determine
    maxsteps (1 revolution)

    Any feedback most welcome
    Regards
    Robert

     
  • Alessio

    Alessio - 2022-12-27

    Hi, thanks for yur reply. I am using the new Win App, I can move the motor from the Main tab, but no motion from Motor Control tab (just the message: moving motor, please wait)

     
  • brownrb

    brownrb - 2022-12-28

    Oh, that is no good. I will see what is going on,

    Regards
    Robert

     
  • tcpip

    tcpip - 2023-01-20

    Sounds like the same problem I'm having. Using the latest app and determine the number of steps (1200) same as calculated. After enter this number in myrotatorconfig.h and sending a move command, the movement is less than expected.

     
  • brownrb

    brownrb - 2023-01-21

    Hi
    I have uploaded Firmware 115
    https://sourceforge.net/projects/arduino-myrotator/files/Firmware/myRotator-Firmware-115.zip/download

    Windows Application 1018
    https://sourceforge.net/projects/arduino-myrotator/files/Windows%20App/myRotator_1_0_1_8.zip/download

    PDF (see pages 18, 21) 211
    https://sourceforge.net/projects/arduino-myrotator/files/Documentation/myRotator-211.pdf/download

    There are new settings in myrotatorconfig.h

    // --------------------------------------------------------------------
    // MOTOR SPEED DELAY
    // This value is used to change the speed of the motor
    // --------------------------------------------------------------------
    #define MOTORDELAY  3000
    
    // --------------------------------------------------------------------
    // MOTOR STEPS PER REVOLUTION
    // This value is used to define 1 revolution of the stepper motor
    // --------------------------------------------------------------------
    #ifdef  DRV8825
    #define STEPSPERREVOLUTION 200      // nema motor 1.8 degree, 200 steps
    //#define STEPSPERREVOLUTION 400      // nema motor 0.9 degree, 400 steps
    #endif
    #ifdef  ULN2003
    #define STEPSPERREVOLUTION  2048
    #endif
    

    which need to be set correctly.

    Windows app, motor control tab, has buttons Get, -1R and +1R
    1R = one revolution of stepper motor

    Note
    I have altered in firmware
    New calls to support +1R, -1R and Get
    Rewritten the delay between motor steps.

    I think what was happening in 114 or less is that the motor was missing steps.
    That is why I added the +1R and -1R so you can test the rotation. I have been backwards and forwards 1R for a while and the motor has repositioned at the end of the move to thae same spot every time.

    Regards
    Robert

     
  • tcpip

    tcpip - 2023-01-21

    Thanks Robert for the quick response. Gonna try it now.

     
  • tcpip

    tcpip - 2023-01-21

    Still the same problem. The motor isn't missing steps. +1R and -1R rotates the stepper 1 rotation. When I move the motor 1200 steps (long ROTATORMAXSTEPS = 1200;) by using the motor control in the app, The rotator rotates exactly 360 degrees. But when I use the main tab and for example move 90 deg. it only moves 80 deg.

     
  • brownrb

    brownrb - 2023-01-22

    But when I use the main tab and for example move 90 deg. it only moves 80 deg.

    Right, finally I understand and get what is happening.

    Will post a corrected firmware later today.

     
  • brownrb

    brownrb - 2023-01-22

    After having a look at the firmware
    A question?

    In the PDF
    CONFIG ROTATOR MAXIMUM STEPS
    This defines the maximum number of steps the motor can take. This is based on the start position, and how many steps to rotate 1 full turn of the telescope body (or less depending on how the rotator ring is made).

    RotatorMaxSteps must be changed to a value that represents your setting of the focuser ring moving 360 degrees.

    *You will need to determine how many steps the motor must take in order to rotate the focuser tube one full revolution. *

    Was max steps found using the motor control tab? by starting at a step count of 0, then using the step buttons to move the rotator so one full rotation of the focuser, then the step count value used to set MaxSteps?

    There is a rounding error introduced. If the max steps number is small, like 5000 for example, then dividing that by 360 gives steps per degree of 13.88
    The stepper motor cannot move 13.88 steps, only 13 steps or 14 steps, meaning that a rounding error is compounded with each motor step

    The firmware tries to include this rounding error in the calculation of the new angle to move to, by calculating first the degrees to move, then multiplying it by the steps per degree (which is a float). That number of steps is then rounded to an integer, but should be within 1 step of where it needs to end up to move to the desired angle.

    StepsPerDegree is a float, and derived from MaxSteps then divided by 360. This is why the MaxSteps value needs to be set correctly and not some larger value (or smaller value).

    Please let me know if this is the case re MaxSteps

    Regards
    Robert

     

    Last edit: brownrb 2023-01-22
  • tcpip

    tcpip - 2023-01-22

    My configuration:
    Driver: DRV8825
    Steps per revolution: 200
    Gear ratio: 20:120
    Calculated steps for 360 degree rotation: (120:60)200=1200
    Calculated step/degree: 1200:360= 3.33

    When using the "FINDING MAX STEPS" procedure in the PDF I end up exactly with 1200 steps

    myrotatorconfig.h
    define DRV8825 1
    long ROTATORMAXSTEPS = 1200;
    ifdef DRV8825
    define STEPSPERREVOLUTION 200

    Hope this helps, regards,
    Irving

     
  • brownrb

    brownrb - 2023-01-22

    Hi Irving
    Thanks for the feedback. I am pretty surprised that you have such a low maxsteps value, any change of sending a pic to show the setup? Is it a geared setup?

    For my own 80mm, running a belt system, I am up around 73000 motor steps per 1 rotation. using a planetary geared Nema motor, from memory a PG27.

    The lower the number of steps the less the accuracy. The higher number of steps the better, because the cummulative error becomes less of a factor.

    You have a steps per degree of 3.3 meaning that its effect is much more than mine (around 202 steps per degree). Which would explain why when you request 90 degrees it only goes about 77 degrees. (if you are loosing .3 degrees per step then that adds up real quick). Small moves will be worse than longer degree moves, because it is easier to compensate for a long move than a short degree move,

    Microstepping the motor would be one solutions but you loose torque, but it was 1/4 steps and still able to rotate that is what I would do, otherwise a pg27 geared NEMA to boost the steps.

    I am making some changes to both the Windows app and Firmware,

     
  • tcpip

    tcpip - 2023-01-22

    Rotator is ouside in the dome at the moment but here is a drawing and the test bench I use for trouble shooting

     

    Last edit: tcpip 2023-01-22
  • tcpip

    tcpip - 2023-01-22

    Torque isn't an issue. I've changed it to 1/32.
    long ROTATORMAXSTEPS = 38400;
    Now it's only moving ~ 30 degrees instead of 90
    EDIT: Solved, I had to change the STEPSPERREVOLUTION to 6400 and now it working correctly :)

    When GET the max steps in the app I get: 14000
    When I enter 38400 en SET, when I GET: -30736
    When I enter 38400 again en SET, when I GET: -27136

     

    Last edit: tcpip 2023-01-22
  • tcpip

    tcpip - 2023-01-22

    The problem with GET and SET max steps remains

     
  • brownrb

    brownrb - 2023-01-23

    The next update will fix those issues.
    I had fogotten to copy the correct code I was testing back into the main files.

    Please email me at my g ma il address (found in pdf or firmware or ascom driver?
    That way I can give you the latest code and application etc

    regards
    Robert

     
  • Alessio

    Alessio - 2023-02-01

    Hi Robert, thanks a lot for this upgrade! It solves all the issues with my configuration!
    I notice that even when Coil Power box is checked, it is easy to move by hand the motor, and this did not happen with previous firmware. Can you advice please?

     

    Last edit: Alessio 2023-02-01
    • brownrb

      brownrb - 2023-02-03

      I will take a look and get back to you on this

      In firmware 117 line 429 please change

      if (myRotator.CoilPwr == 1) {
      

      to this

      if (myRotator.CoilPwr == 0) {
      

      then reprogram the firmware again. Let me know what happens please,

      regards
      Robert

       

      Last edit: brownrb 2023-02-03
  • laluna1969

    laluna1969 - 2023-02-02

    Hello.
    Magnificent project. I have the same problem as my partner Alessio. My motor, with whatever firmware I use, never gets to block the motor, I can move it by hand with no problem. I have changed both the Arduino nano and the drv8825 and still the same problems. I have tried with the sketch of its focuser and in this case it does block the motor. Can you help me to solve the problem? Thanks.

     
  • brownrb

    brownrb - 2023-02-03

    Hi
    I am not sure what you mean by "block the motor".
    You are using firmware 117?
    You are using Windows App myRotator_1_0_1_9?

    Regards
    Robert

     
  • laluna1969

    laluna1969 - 2023-02-03

    Hello.
    I am using your arduino sketch myRotator 117 and your app myrotator 1.0.1.9. The problem is that when the motor rotates to any position, the coils have no power, and my camera and filter wheel begin to move under their own weight. I have used the sketch and app of your myfocuser to check if the coils were left with power, and indeed it is so. As much as I look at the sketch of my rotator I can't find where to modify so that the coils have power.
    I need your help.
    Excuse me for my English
    Regards
    Toño

     

    Last edit: laluna1969 2023-02-03
    • brownrb

      brownrb - 2023-02-03

      In firmware 117 line 429 please change

      if (myRotator.CoilPwr == 1) {

      to this

      if (myRotator.CoilPwr == 0) {

      then reprogram the firmware again. Let me know what happens please,

       
  • laluna1969

    laluna1969 - 2023-03-04

    Good morning.
    I have made the changes you suggested and now everything works perfectly.
    I have not been able to answer before, I live in Tenerife, Canary Islands, and at this time it is Carnival here. I've been pretty busy and haven't been able to try your prompts until now.
    I have another question. I have connected the home sensor and uncommented the line #define HOME 3 , but when compiling I get this message ´searchhomeflag´was not declared in this scope.
    Do you know what could be due to?
    Thanks again for your instructions.
    Tone

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.