Menu

MD-01 SPID rotor ROT2PROG: rot_get_position inaccuracy

Help
2024-04-18
2024-04-19
  • ATTANASIO Barthélémy

    Hello,

    I have a problem with the use of hamlib library.
    I am coding in c++, using the functions of the rotator API to control the MD-01 from a PC in USB to a SPID rotor using SPID_Rot2Prog protocol. I have ABS sensors on the AzEl rotors.

    First, we analysed that using the rot_set_position(testRot, 0, 0); function, this introduces a software occupation during 600ms. The code is not pursuing its function before 600ms.
    It is the same thing with the rot_get_position function, but with around 300ms of software occupation. Therefore, within 1sec, I can perform only 1 get.

    Is it normal or is there a way to improve the hamlib function delay?
    Because the MD-01 is much well reactive with the ABS sensor on the display of the MD-01... So that means, the limitation is in the MD-01 and use of the library

    Second, we analysed that the rot_get_position function sends uncoherent data. There is a kind of delay between the real value displayed on the MD-01 display and the answer given by the rot_get_position function.
    For exemple, my simulation sends a position every 1 sec and perform 1 get every 1 sec during 120sec. I have to wait 30sec more to perform 30 additional get to finally have the correct value that is also indicated in the MD-01 screen.
    Is there a specific way to use the rot_get_position hamlib function in a c++ code?

    Thanks for the help,
    Regards,
    Barthélémy

     
    • Michael Black

      Michael Black - 2024-04-18
      On Thursday, April 18, 2024 at 02:11:49 PM CDT, ATTANASIO Barthélémy <barthelemyatta@users.sourceforge.net> wrote:  Please try using rotctl first so we can see some debug.
      

      Run rotctl like this to do a test that will show me the debug information I need.
      rotctl -m 903 -r com1 -s 1200 -vvvvv -Z p P 0 0 p P10 10 p >log.txt 2>&1
      Adjust com port and baud rate to suit.
      Also...which model entry are you using?

      Hello,

      I have a problem with the use of hamlib library.
      I am coding in c++, using the functions of the rotator API to control the MD-01 from a PC in USB to a SPID rotor using SPID_Rot2Prog protocol. I have ABS sensors on the AzEl rotors.

      First, we analysed that using the rot_set_position(testRot, 0, 0); function, this introduces a software occupation during 600ms. The code is not pursuing its function before 600ms.
      It is the same thing with the rot_get_position function, but with around 300ms of software occupation. Therefore, within 1sec, I can perform only 1 get.

      Is it normal or is there a way to improve the hamlib function delay?
      Because the MD-01 is much well reactive with the ABS sensor on the display of the MD-01... So that means, the limitation is in the MD-01 and use of the library

      Second, we analysed that the rot_get_position function sends uncoherent data. There is a kind of delay between the real value displayed on the MD-01 display and the answer given by the rot_get_position function.
      For exemple, my simulation sends a position every 1 sec and perform 1 get every 1 sec during 120sec. I have to wait 30sec more to perform 30 additional get to finally have the correct value that is also indicated in the MD-01 screen.
      Is there a specific way to use the rot_get_position hamlib function in a c++ code?

      Thanks for the help,
      Regards,
      Barthélémy

      MD-01 SPID rotor ROT2PROG: rot_get_position inaccuracy

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/hamlib/discussion/25919/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • ATTANASIO Barthélémy

    Hello,

    Thanks for your answer.
    What do you mean by model entry? I am using the MD-01 Controller and the SPX-06/AzEl/ABS motors and sensors.

    I ran your test and attached is the log file. Actually, I already run this kind of test. We see that the get function is sending initial information and not final one while the motors moved in the meantime.

    Regards,
    Barthélémy

     
    • Michael Black

      Michael Black - 2024-04-19

      There is a default 300ms post write delay for the SPID devices.
      You can try and reduce that and see if it still works.  If it does I can change the default.
      Add this to the rotctl line
      --set-conf=post_write_delay=0
      You can start with 0 which means no delay -- but if there are problems might need to bump it up.  
      Mike

      On Friday, April 19, 2024 at 08:08:02 AM CDT, ATTANASIO Barthélémy <barthelemyatta@users.sourceforge.net> wrote:
      

      Hello,

      Thanks for your answer.
      What do you mean by model entry? I am using the MD-01 Controller and the SPX-06/AzEl/ABS motors and sensors.

      I ran your test and attached is the log file. Actually, I already run this kind of test. We see that the get function is sending initial information and not final one while the motors moved in the meantime.

      Regards,
      Barthélémy

      Attachments:

      • log.txt (12.7 kB; text/plain)

      MD-01 SPID rotor ROT2PROG: rot_get_position inaccuracy

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/hamlib/discussion/25919/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • ATTANASIO Barthélémy

    Thanks for your answer,

    Actually, I found the error in the c++ code, for my Second problem of long delay at the end of the simulation.

    I used the wrong model declaration. I believed, there were no difference but it seems that yes, there is a difference between:
    - ROT rotator = rot_init(ROT_MODEL_SPID_MD01_ROT2PROG)
    - instead of: ROT
    rotator = rot_init(ROT_MODEL_SPID_ROT2PROG)

    Regarding my first problem and the 300ms delay with the rot_get_position function, your solution is perfect. I transformed your advise from command line to c++ function.
    - instead of --set-conf=post_write_delay=0 in the rotctl command line
    - I modified the c++ code adding that line: rotport->post_crite_delay=0;

    Therefore, the rot_set_position function is executed within 60ms and I have an answer to rot_get_position every 30ms. Of course, as you warned, this can lead to rotor command problem but I control the motor every 1sec so that problems are avoided.

    Thanks for the help, we can close the topic,
    Barthélémy

     

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.