Menu

2.3.9.4 Disconnects from Focuser when going home or position 0

2018-03-08
2018-03-31
<< < 1 2 3 > >> (Page 2 of 3)
  • Chris Plonski

    Chris Plonski - 2018-03-24

    OK, I have upgraded the Arduino firmware, ascom driver and windows app to the versions you have posted in this thread. Now, the MaxBaclash and in/out backlash numbers remain at the points I set them after a connect or disconnect/reconnect. However, in makes no difference how high I set the in or out backlash compensation numbers...it ALWAYS is about 50 counts shy of where it should be when it changes direction...this seems to imply I need to have the in and out number set to about 50 in order to get repeatable positioning. Unfortunately, even setting the backlash in/out points as high as 400 still produces the same exact 50 count under-correction when changing direction. It behaves as though backlash is having no real effect.

    Also, do you have a myFocuser2ASCOM1Setup252 since I have 2 focusers? and also a windows mini flavor?

     

    Last edit: Chris Plonski 2018-03-24
  • brownrb

    brownrb - 2018-03-24

    Hi Chris
    I will get a chance to look at this later today.
    I have yet to had a chance to look at the 2nd ascom driver and min app changes but will get around to that.
    Regards
    Robert

     
  • brownrb

    brownrb - 2018-03-24

    Please try these
    1. ASCOM has initial focus pos and maxsteps fixed on extra settings page
    2. Firmware has some changes

    The way that backlash works is this
    1. When a request to move is recieved, the code checks if the direction is changed
    2. If the direction has changed, the focuser immediately move by the backlash amount
    3. Then the move (total requested steps) is done.
    4. So backlash is always applied first before the move

    To verify backlash make the following change in the code at line 992
    // rangecheck target
    Before this ine insert the following
    delay(2000);

    This means there will be a 2 second delay after the backlash is applied and before the move is done.
    Now reprogram the controller. Do not use ASCOM or WindowsApp for the next step

    Open a serial port monitor window in the IDE (9600bps, no CR, no LF)
    Send the following command
    :77200#

    this sets the in backlash to 200
    Now send the following command
    :731#

    this sets the in backlash to enabled
    Now send the following command
    :315000#

    This sets the current position to 5000

    Now send the following command
    :055200#

    This sends the focuser out by 200 steps (gnore any pauses)
    Now we find out - the moment of truth
    Send the command
    :054000#

    You SHOULD see the focuser move IN by 200 steps, pause for 2 seconds, then step 1200 steps IN (5200-4000 = 1200)

    Let me know what you discover

     

    Last edit: brownrb 2018-03-24
  • Chris Plonski

    Chris Plonski - 2018-03-24

    Here's what I find after running all the preceeding steps:
    sent :055200#
    nothing happens for 2 seconds...then moves out by 200
    sent :054000#
    nothing happens for 2 seconds, then it moves in by 1200

     

    Last edit: Chris Plonski 2018-03-24
  • Chris Plonski

    Chris Plonski - 2018-03-24
     

    Last edit: Chris Plonski 2018-03-24
  • brownrb

    brownrb - 2018-03-25

    Hi Chris
    Thanks, that did help a lot.
    Attached is 268 firmware, which has revised code for backlash. I have removed the 2s delay so you should just see I continous movement (backlash followed by move). You can reinsert delay just to check if you want but delay should be removed before testing with ASCOM or windows app.

    Regards
    Robert

     
  • Chris Plonski

    Chris Plonski - 2018-03-25

    First, thank you for the speedy response...this is awesome support for a great project!

    However, this new code produces the same exact results...I even put the pause back in and re-ran the same procedure outlined above and still no movement during the backlash period before the pause :(

     
  • Chris Plonski

    Chris Plonski - 2018-03-25

    Also, this version is causing serial port timeouts and locking up either the windows or ascom apps.

     
    • brownrb

      brownrb - 2018-03-25

      Do not use ascom or windows with this. We are trying to determine what is wrong with backlash so only use the serial IDE monitor for testing.

       
  • brownrb

    brownrb - 2018-03-25

    Hi Chris
    You are not using Reverse Direction ON are you?

    If you send
    :77200#
    then send
    :78#
    It should return with 6200# (where 200 is the backlash steps in)

    If you send
    :731#
    then send
    :74#
    it should return 41# where 1 represents the Backlash IN is enabled

    Try the attached - it is the same version number but has different code
    Line 100 I have enabled DEBUG
    I have checked the code. I have checked the actual focuser operation also and can confirm that the correct amount of backlash is being applied in my focuser controller.

    After programming the controller with this firmware, open up the ide serial port monitor
    Send
    :77200#

    Send
    :731#

    Send
    :315000#

    Send
    :055200#
    It will say applying backlash, move 200 backlash steps, pause for 2s, then apply the move 200 steps out

    Send
    :054000#
    It will say applying backlash, move 200 backlash steps, pause for 2s, then apply the move of 1200 steps in

     
  • Chris Plonski

    Chris Plonski - 2018-03-25

    Yes, I am using reverse.

    I applied the commands and the debig information was totally correct, however the backlash command never moved the motor! Not sure why this is happening.

     
  • brownrb

    brownrb - 2018-03-25

    :730# returns None Disable backlash IN (going to lower focuser position)
    :731# returns None Enable backlash IN
    :74# returns 4x# Get backlash IN enabled status
    :750# returns None Disable backlash OUT (going to higher focuser position)
    :751# returns None Enable backlash OUT
    :76# returns 5x# Get backlash OUT enabled status
    :77xx# returns None Set backlash steps IN
    :78# returns 6xx# Get number of backlash steps IN
    :79xx# returns None Set backlash steps OUT
    :80# returns 7xx# Get number of backlash steps OUT
    :81# returns 8xxx# Get number of backlashmaximum steps

    check that your out backlash is also set.

     

    Last edit: brownrb 2018-03-25
  • brownrb

    brownrb - 2018-03-25

    When you use reverse direction ON, everything is reversed.
    For testing as per above turn it off. Otherwise In means OUT and OUT means IN and you have to use different commands than those I showed above to set the other backlash parameters...

     
  • Chris Plonski

    Chris Plonski - 2018-03-25

    I tried to turn off the reverse first.

    Not sure that the responses are what are expected.

    Here is the output of all the commands you list here. I put 77200 in place of the 77xx and 79200 in place of the 79xx:
    replystr = 730
    len = 3
    mycmd = 73
    param = 0
    cmdval = 73
    replystr = 731
    len = 4
    mycmd = 7
    param = 31
    cmdval = 7
    replystr = 74
    len = 3
    mycmd = 7
    param = 4
    cmdval = 7
    replystr = 750
    len = 4
    mycmd = 7
    param = 50
    cmdval = 7
    replystr = 751
    len = 3
    mycmd = 75
    param = 1
    cmdval = 75
    replystr = 76
    len = 2
    mycmd = 76
    param =
    cmdval = 76
    51#replystr = 77200
    len = 5
    mycmd = 77
    param = 200
    cmdval = 77
    replystr = 78
    len = 2
    mycmd = 78
    param =
    cmdval = 78
    6200#replystr = 79200
    len = 5
    mycmd = 79
    param = 200
    cmdval = 79
    replystr = 80
    len = 3
    mycmd = 8
    param = 0
    cmdval = 8
    M1024#replystr = 81
    len = 2
    mycmd = 81
    param =
    cmdval = 81

    Then I ran the series to test the backlash, but this time there was no movement at all:
    replystr = 77200
    len = 5
    mycmd = 77
    param = 200
    cmdval = 77
    replystr = 731
    len = 3
    mycmd = 73
    param = 1
    cmdval = 73
    replystr = 315000
    len = 6
    mycmd = 31
    param = 5000
    cmdval = 31
    replystr = 055200
    len = 6
    mycmd = 05
    param = 5200
    cmdval = 5
    Current Pos = 1024
    New Pos = 5200
    Previous direction = 1
    New Direction=1
    2s delay before move
    Move to position 1024
    replystr = 054000
    len = 6
    mycmd = 05
    param = 4000
    cmdval = 5
    Current Pos = 1024
    New Pos = 4000
    Previous direction = 1
    New Direction=1
    2s delay before move
    Move to position 1024

     
  • brownrb

    brownrb - 2018-03-25

    Hi Chris
    Previous direction = 1
    New Direction=1
    If these are the same 0,0 or 1,1 then no backlash, If 0,1 or 1,0 then backlash is applied.

    So lets do the following sequence.

    Do not use ascom or windows with this. We are trying to determine what is wrong with backlash so only use the serial IDE monitor for testing.

    Use the lastest v268 that I posted here earlier in this thread. After programming the controller open up serial port monitor

    Send
    :77200#
    then send
    :79400#
    This sets IN backlash to 200 and OUT to 400

    Send
    :731#
    and then send
    :751#
    This enables backlash IN and backlash OUT

    Send
    :315000#
    This sets current position to 5000

    Send
    :140#
    to turn off reverse direction

    Send
    :055200#
    It may or may nor apply basklash for the first move (maybe - do not worry if not), pause for 2s, then apply the move 200 steps out

    Send
    :054000#
    We are changing direction now. This is IN,last move was out. This tests IN backlash. It will say applying backlash, move 200 backlash steps, pause for 2s, then apply the move of 1200 steps in

    Send
    :053500#
    We have NOT changed direction. We are still moving in. So there is no backlash. So it will pause 2s, then move 500 steps

    Send
    :054500#
    We are changing direction now. Last move was IN, this move is OUT. This tests OUT backlash. It will say applying backlash, move 400 backlash steps, pause for 2s, then apply the move of 1000 steps OUT

    Send
    :055000#
    We have NOT changed direction. We are still moving out. So there is no backlash. So it will pause 2s, then move 500 steps

    Please confirm it this is what it is doing.

    Regards
    Robert

     
  • Chris Plonski

    Chris Plonski - 2018-03-26

    Robert,
    It did everything exactly as you described, however the backlash movements DID NOT apply even though the debug shows it did. It's as if it's totally ignoring the code in the void clockwise() and void (anticlockwise) subroutines. The actual movements do execute though, just not the backlash.

    Here is the debug, though the actual movements for the backlash did not occur as the debug implies:
    myfocuser.fposition = 7200
    replystr = 77200
    len = 5
    mycmd = 77
    param = 200
    cmdval = 77
    replystr = 79400
    len = 5
    mycmd = 79
    param = 400
    cmdval = 79
    replystr = 731
    len = 3
    mycmd = 73
    param = 1
    cmdval = 73
    replystr = 751
    len = 3
    mycmd = 75
    param = 1
    cmdval = 75
    replystr = 315000
    len = 6
    mycmd = 31
    param = 5000
    cmdval = 31
    replystr = 140
    len = 3
    mycmd = 14
    param = 0
    cmdval = 14
    replystr = 055200
    len = 6
    mycmd = 05
    param = 5200
    cmdval = 5
    Current Pos = 5000
    New Pos = 5200
    Previous direction = 0
    New Direction=1
    Applying backlash: 400 steps OUT
    2s delay before move
    Move to position 5200
    replystr = 054000
    len = 6
    mycmd = 05
    param = 4000
    cmdval = 5
    Current Pos = 5200
    New Pos = 4000
    Previous direction = 1
    New Direction=0
    Applying backlash: 200 steps IN
    2s delay before move
    Move to position 4000
    replystr = 053500
    len = 6
    mycmd = 05
    param = 3500
    cmdval = 5
    Current Pos = 4000
    New Pos = 3500
    Previous direction = 0
    New Direction=0
    2s delay before move
    Move to position 3500
    replystr = 054500
    len = 6
    mycmd = 05
    param = 4500
    cmdval = 5
    Current Pos = 3500
    New Pos = 4500
    Previous direction = 0
    New Direction=1
    Applying backlash: 400 steps OUT
    2s delay before move
    Move to position 4500
    replystr = 055000
    len = 6
    mycmd = 05
    param = 5000
    cmdval = 5
    Current Pos = 4500
    New Pos = 5000
    Previous direction = 1
    New Direction=1
    2s delay before move
    Move to position 5000

     
  • brownrb

    brownrb - 2018-03-26

    Hi Chris
    I have made more changes to the firmware. As I was editing this message I had a thought...

    Please download and use this firmware (same version number) that is part of this reply. Please repeat the same tests as before

    Send
    :77200#
    then send
    :79400#
    This sets IN backlash to 200 and OUT to 400

    Send
    :731#
    and then send
    :751#
    This enables backlash IN and backlash OUT

    Send
    :315000#
    This sets current position to 5000

    Send
    :140#
    to turn off reverse direction

    Send
    :055200#
    It may or may nor apply basklash for the first move (maybe - do not worry if not), pause for 2s, then apply the move 200 steps out

    Send
    :054000#
    We are changing direction now. This is IN,last move was out. This tests IN backlash. It will say applying backlash, move 200 backlash steps, pause for 2s, then apply the move of 1200 steps in

    Send
    :053500#
    We have NOT changed direction. We are still moving in. So there is no backlash. So it will pause 2s, then move 500 steps

    Send
    :054500#
    We are changing direction now. Last move was IN, this move is OUT. This tests OUT backlash. It will say applying backlash, move 400 backlash steps, pause for 2s, then apply the move of 1000 steps OUT

    Send
    :055000#
    We have NOT changed direction. We are still moving out. So there is no backlash. So it will pause 2s, then move 500 steps

    Please confirm it this is what it is doing.

     

    Last edit: brownrb 2018-03-26
  • Chris Plonski

    Chris Plonski - 2018-03-26

    Yeah, Yeah!! It works, It Works! Thanks so much for all your effort!

     
  • Chris Plonski

    Chris Plonski - 2018-03-26

    Please let me know when you have v myFocuser2ASCOM1Setup253 available. This code works so nicely now!

     
  • brownrb

    brownrb - 2018-03-27

    I have not had time to test these yet

     

    Last edit: brownrb 2018-03-27
  • Chris Plonski

    Chris Plonski - 2018-03-27

    Thanks Robert...so far these look like they work properly!

     
  • James Sorenson

    James Sorenson - 2018-03-28

    I have been trying to dial in my backlash settings and the same issue that has been disscused here popped up. , I should have looked here sooner to discover this helpful thread. I tried to use Firmware v268 but could not for the life of me get it to connect to my arduno from the app after I uploaded it. Not sure why, baud speed and port number settings were correct. I reverted to firmware v266 and everything started working again, also looks like the backlash IN and OUT backlash values update in the controller correctly in that version. But I havent done the indepth verification discussed above yet.

     

    Last edit: James Sorenson 2018-03-28
  • brownrb

    brownrb - 2018-03-28

    I am about to put the dropbox link on the myArduinoDIY yahoo group for the firmware 268 for testing.
    Be aware that you need to use the latest windows app and ascom driver.

    The easiest way to test first if having issues is use the Arduino IDE serial port monitor.
    if you send :03# it should report the firmware and :00# reports the focuser position. This way, it it works in the serial monitor and not the app then its an app issue. If it does not work at all then its a firmware issue or something wrong with the computer.

    All previous versions - the backlash code is broken in firmware and does not work correctly in all scenarios.

    Regards

     

    Last edit: brownrb 2018-03-29
  • James Sorenson

    James Sorenson - 2018-03-31

    I followed your advice, I had the MyfocuserProMini 2.3.3.6 version installed but not the new version of the ascom driver (myFocuser2ASCOM1Setup253). I installed that both on my telescope computer and my desktop and on both computers the newest windows app both 2.3.3.6. I then reuploaded the 268 firmware to the controller, and went to the serial port monitor. Here is the output given by both of those serial commands.

    myfocuser.fposition = 5000
    replystr = 03
    len = 2
    mycmd = 03
    param =
    cmdval = 3
    F268#replystr = 00
    len = 2
    mycmd = 00
    param =
    cmdval = 0
    P5000#

    So there is a connection.
    But when I close the IDE connection and open up the focuser app and try to connect, here is the log

    3/30/2018 6:22:20 PM: Connect(): =START=========================================================
    3/30/2018 6:22:20 PM: ======CONNECT START TIME
    3/30/2018 6:22:20 PM: Windows Application Version Number: myFocuserPro2Mini ©RBrown 2014-2018: 2.3.3.6
    3/30/2018 6:22:20 PM: Connect: Com Port Selected = COM4
    3/30/2018 6:22:20 PM: Connect: comportbaudrate: 9600
    3/30/2018 6:22:20 PM: Connect: Setting readtimeout to 5000
    3/30/2018 6:22:20 PM: Connect: Attempting to Open COMPORT COM4
    3/30/2018 6:22:20 PM: Connect: Check if serial port opened
    3/30/2018 6:22:20 PM: Connect: Comport=isOpen
    3/30/2018 6:22:20 PM: Connect: Serial port COM4 opened.
    3/30/2018 6:22:22 PM: Calling CommandString(:02#)
    3/30/2018 6:22:22 PM: CommandString(): =START=========================================================
    3/30/2018 6:22:22 PM: CommandString: :02#
    3/30/2018 6:22:22 PM: CommandString(): =END===========================================================
    3/30/2018 6:22:22 PM: Back from CommandString
    3/30/2018 6:22:22 PM: ReceiveString(): =START=========================================================
    3/30/2018 6:22:22 PM: ReceiveString(): =END===========================================================
    3/30/2018 6:22:27 PM: ConnectBtn_Click: error - no response/timeout
    3/30/2018 6:22:27 PM: Disconnect(): =START=========================================================
    3/30/2018 6:22:27 PM: DisconnectBtn_Click: error - serial port not open
    3/30/2018 6:22:27 PM: disableall(): =START=========================================================
    3/30/2018 6:22:27 PM: disableall(): =END===========================================================
    3/30/2018 6:22:27 PM: DisconnectBtn_Click: Disconnecting
    3/30/2018 6:22:27 PM: Disconnect(): =END===========================================================

    I'll add I get the same thing on two computers when I try to connect with firmware 268.

     

    Last edit: James Sorenson 2018-03-31
  • brownrb

    brownrb - 2018-03-31

    Hi James
    You disabled the DEBUG in the firmware and reprogrammed the controller?

    " I then reuploaded the 268 firmware to the controller, and went to the serial port monitor. Here is the output given by both of those serial commands"

    The output you show indicates that DEBUG is enabled.

    "So there is a connection. But when I close the IDE connection and open up the focuser app and try to connect, here is the log"

    But you need to disable DEBUG options first, reprogram the controller and then try the windows app

    The debug needs to look like this in the firmware in order to work with the app
    // do not change
    //#define DEBUG 1
    //#define DEBUGHPSW 1

    otherwise the app things the debug text is the reply to get firmware version and will time out.

    Regards
    Robert

     
<< < 1 2 3 > >> (Page 2 of 3)

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.