Menu

Home button Bug ?

2024-05-30
2024-07-06
  • jean duffas

    jean duffas - 2024-05-30

    Hello,

    I noticed something strange :
    When using the home sensor,
    It the motor run a very short way then stop, but the "is moving" stay on true.
    the motor sould continue running until the sensor is detected.
    but if I disconnect from USB then reconnect, the Home button works once, but at the second attemp (after moving to another value) it to the same.

    any idea?
    Is it a bug?

    Thank you.

    Jean

     

    Last edit: jean duffas 2024-05-30
  • jean duffas

    jean duffas - 2024-05-30

    And the "Find Home onb connect" in N.I.N.A. does nothing.

     
  • brownrb

    brownrb - 2024-05-30

    Hi Jean

    First the obvious
    Using Firmware myRotator-Firmware-2024-06?
    Using ASCOM driver myRotator_2_4_0_5?
    Using Windows app myRotatorASCOMDriver-2024-04?

    If you are using older versions then you must first upgrade to these versions, otherwise every thing below is a waste of time.

    Do you have a Home Sensor fitted?
    What type is the Home Sensor? Photo? Link?
    What revision number for the Library TimerOne?
    Have you run the test program in the tests folder: TestHome
    Have you used the Windows app to verify state of Home Sensor?

    When not using Home sensor, does the rotator rotate from position to position correctly when using Windows Application, eg; Set position as 10 degrees then send move to 45 degrees?

    The PDF has numerous hints
    pg 40-42, To find the Home Sensor enable state in firmware,

    For the following, which have been set
    MOTOR-SHAFT-360 pg51
    STEPSPERROTATOR 360 pg51
    STEPSIZE pg51
    HOME SENSOR VALUE pg52

    All of those MUST be set correctly before the rotator is ready for use. If not then you will not get correct actions using the rotator

    1,
    When using the home sensor, It the motor run a very short way then stop, but the "is moving" stay on true. the motor should continue running until the sensor is detected.

    I do not know what you are using to control the rotator. My answers would be better if I had a bit more info such as using ascom driver vxyx or Windows application etc.
    Are you using the Windows app?

    What caused the the motor to stop? The motor should continue to move till Position angle reaches 0.

    There is a mention in the PDF that "warning" pressing Halt invalidates everything if Halt occurs during a move to Home or during any move.

    I cannot think of anything in the firmware code that causes the motor to stop when moving home. Check the version number of the TimerOne library in Arduino IDE.

    It is probable that Find Home in the ASCOM driver setup form has issues with NINA and other applications, because Find Home can take a long time depending where the rotator is before find home happens. NINA could timeout. I dont change the rotator when powering down the mount etc. On the next boot up the rotator has not moved so there is no need to home it before use.

    Other position angle moves do not use the Home Sensor.
    Consider a move from 275 degrees to 20 degrees. The rotator moves like 276, 277, and so on to 360 (which is 0), then 1, 2, 3, 4 all the way to 20,
    If the Home Sensor was part of this move then the move would have stopped at 0. So for position angles that cross over to the other side always do not use the home sensor.
    eg.
    181 to 359 moving to 0-180 will not use Home Sensor and 0 to 180 moving to 181-359 will not use the Home sensor.

    The only time it is active is really at connection time, when the user can force a Move Home (find 0) before using the rotator.

    2,
    If u can provide me with the myrotator ascom log file when using NINA and find home then I can see what is going on,

    Do you mean for Find Home on the ASCOM Setup dialog form? That is in the myRotator ascom driver, BUT IS NOT part of an ascom driver because there is no find in ASCOM.

    Apologies with the long message. I dont know or guess what you setup is, so I wanted to give you some tips that could fix your issue. When I get the log files and your responses I can them look at those and determine the next steps if these do not resolve your issue

    regards
    Robert

     
  • jean duffas

    jean duffas - 2024-05-30

    Hello,

    Thank you for your long answer, and sorry about my bad english.
    so, here are some procisions :
    I use the last firmware ans windows app : witch is myrotator 24-05 and firmware 2024 6.
    the PCB is DRV8825 PCB.
    the sensor is the A3144.
    Timer One is version 1.1.1
    I can't find "TestHome" program...
    The state of the sensor in app is correct, when magnet is near it, it's "true" otherwise it's "false"
    When not using home sensor, everything works perfect.

    I have set nothing from arduino prog file, but everything from the app... is it a problem?
    My setting are 1600 (motor shaft)
    9600 (rotator 360)
    I set the stel mode to 1/4

    I got a NEMA 14.

    I tried ascom to with NINA, and checked "home at connect" witch doen nothing.

    I will send you logs in my next message, thank's a lot for your time!

     
  • jean duffas

    jean duffas - 2024-05-30

    here is the app log

     
  • brownrb

    brownrb - 2024-05-31

    Hi

    I have looked briefly at the log file,
    what is your setting for the Motor Speed Delay? on the Windows app, motor control tab
    you indicated that the motor moved a little then stopped

    Test home is in a folder when you unzip the firmware zip file: No need to run this now.

    Can you please try the following
    Load the Arduino IDE and load the firmware
    Open the Serial Port Monitor
    Configure for speed 9600, no line endings = see attched
    type the command
    :05#
    then click the Send
    The motor should rotate 360 degrees
    type the command
    :06#
    The motor should rotate 360 degrees in the other direction

    Type the command
    :0330#
    The motor should move the "rotator" to 10 degrees angle.

    The purpose is to give me a little more insight so I know what can be ruled out.

    Regards
    Robert

     
  • jean duffas

    jean duffas - 2024-05-31

    Hello,

    Do I ha to only load in IDE the normal firmware?
    Iv've done it, here are the results:

    The :05# and :06# rotate the motor 360 degrees OK, but slowly.
    the :0330# command worked once, OK, but fast.
    I tried again thoses 3 commands, the :0330# did not worked anymore, even if I quit IDE and disconnect the arduino.
    Message appearing are ", CCW" and ", CW"

    Thank you.

     
    • brownrb

      brownrb - 2024-06-01

      Hi

      The :05# and :06# rotate the motor 360 degrees OK, but slowly.
      the :0330# command worked once, OK, but fast.
      I tried again thoses 3 commands, the :0330# did not worked anymore, even if I quit IDE and disconnect the arduino.
      Message appearing are ", CCW" and ", CW"
      

      The 05 and 06 worked, speed is not important.
      The 0330 moved rotator to absolute position angle 30

      Then you repeated the commands
      but this time the 0330 resulted in no motor movement. that is expected
      Here us why
      The 05 and 06 are setup type commands that just move the position and DO not update tje position.
      So the first 0330 moved to position angle 30. The second 0330 did not move because the rotator was alread at position angle 30 which happened as a result of the first one, so there was no need to move.

       
  • jean duffas

    jean duffas - 2024-05-31

    The motor speed delay is 5000.

    I tried on the app again, and I can give you precisions :
    The "Find home on connect" worked on the app.
    but after that, if I go to "rotator", move to 10 (for exemple) then click on "home" , the motor doesn't come back at home.
    If I try it again, (move to 20 witch works well) then press home again, a got a small move (one or two steps) then nothing, and the "Is moving" indication stays on "True".
    Impossible now to make a move (still thinks it's moving).
    I have to unplug and reconnect the arduino to make it work again.
    In that case, it doesn't come back to the home position and the angle says "0".

    I hope my description is clearer this time :-)

    Jean

     
  • brownrb

    brownrb - 2024-06-01

    Hi Jean
    Please zip up the firmware files u are using to program the controller. I do not mean the source files that you downloaded, I mean the ones you changed and loaded into the Arduino IDE to program the controller with.

    Looks like
    1, motor can move ok - 05 and 06
    2. a degree move 0330 worked fine
    3. as yet home position not tested.

    Do you have a multi-meter that tests voltage?

    There are a couple of other things you can do whilst I wait for the files

    1. Run the ClearEEPROM program and reprogram the Arduino Nano - the program writes to the Serial port. When finished you can reload the firmware
    2. Check you Home Sensor Switch wiring, and that its connected correctly

    Do not fit 10K pull-down resistor R3 to PCB

    You purchased a sensor that is just a single chip, not a module board?
    You did fit a 0.1uf (100nf) capacitor across + and gnd pins of the home sensor?
    Middle pin of sensor wired to ground?
    The sensors small surface (front face with writing) faces towards the magnet with the larger area away from the magnet?

    THIS IS A MANUAL TEST: DO NOT USE WINDOWS APP OR ASCOM DRIVER TO DO THIS

    Please run the attached version of TestHome, download and extract then program the Arduino nano with this program, When run, it sends messages to the serial port. So after it runs you need to open the Serial port monitor (speed 9600) and then press the little reset button on the Arduino chip to reset and run this program, Do not close the Arduino program, it needs to be connected with USB to the controller)

    So after positioning the sensor about 5-10 away and u are ready to start the test,
    Press S
    You now have 20 seconds. Move the rotator by hand slowly towards the magnet. If everything is Ok then the maganet will be detected and present a message. At that point stop moving the rotator by hand. Look to see where the sensor is now in relation to the magnet. Is it close or over the magnet or is the sensor still a little way away .

    If not found and you end up with the sensorr on the other side (having moved past the magnet then the sensor cannot be working,

    Do the test a couple of times to determine where the home sensor shows it has detected the magnet. Take a shot on your phone so we can know where that is.

    Regards
    Robert

     

    Last edit: brownrb 2024-06-01
  • jean duffas

    jean duffas - 2024-06-02

    Hello,

    I will respond to your message in two installments,

    Here is my first response:

    I have a multimeter.

    I don't see an R3 resistor, so I didn't put one,
    Only R1 (4.7K) is in place.

    The sensor is only one chip, I added the 100nF capacitor between - and +.
    The central pin is well connected to the -.
    The small surface of the sensor is well directed towards the magnet.

    I will soon do the tests with the other firmware, but it seams that the magnet is well detected, I see it in the Windows application, that when I click on home sensor "value", the status changes to "True" when the The magnet is very close or under to the sensor.
    When I press the Home button (the first time I do it, because the second time crashes the arduino),
    the magnet never goes beyond the sensor, but stops just before, close to it (very close to the sensor but not just below it).
    So it seems to work normally when you first press Home.

    In my next message, I will send you the firmware files, ...although I have not modified anything, I have sent them as downloaded.
    I made the changes to the settings from the Windows application.

    I will also send you the home firmware test results.

    That said, as is, the rotator is functional, because I actually don't need to reset Home more than once per session.

    Anyway thank’s a lot you for your help.

    Sincerely,

    Jean Dufas

     
  • brownrb

    brownrb - 2024-06-04

    Hi Jean

    The central pin is well connected to the -.

    Is that a typo error? You mean D0 on J5

    Thanks for the information, because it does help to eliminate things.

    And you are correct about R3. That is my mistake.

    I have observed with the log that there is an issue detected. The issue is that after a Move home, it seems that the move starts but on the second read of ismoving the controller is returning 0 meaning it has stopped. That stop however occurs well before the move is meant to complete. I have seen this in firmware prior to 2024-06. A fix was applied in 2024_00 onwards to address this issue and subsequent releases (listed below for info only)

    BUT
    I will take another look into the updated go home code again.

    Regards
    Robert

    24-00 17-Jan-2024
    Fix Move to degree sometimes stopping short of destination angle

    24-01 28-Jan-2024
    Add dedicated timer for moving home by steps
    Fix for HomeSensor timer code

    24-04 07-Feb-2024
    Fix error in checking step_count in timer_homesteps (driver_board.cpp)
    Fix error in Home Position Sensor debounce not working (driver_board.cpp)
    Fix Read Home Sensor, returning wrong state

    24-06 08-Feb-2024
    Rewrite Move Motor Timer and replace loop code in STATE_MOVING
    Rewrite STATE_MOVING to handle Halt_alert

     
  • jean duffas

    jean duffas - 2024-06-08

    Hello,

    I mean, the center pin of 3144 is connected on the G.
    I will wait that you have a look at your code again.
    no hurry ;-)
    Thank's a lot.

    Jean

     
  • brownrb

    brownrb - 2024-06-10

    ok

     
  • jean duffas

    jean duffas - 2024-06-10

    Yes that's it :-)

     
  • brownrb

    brownrb - 2024-07-06

    Hi Jean
    I have a revised version that addresses your issue. If you would like to test that, please send me an email to my gmail address. (pg 1 of user guide)

    regards
    Robert

     

Log in to post a comment.