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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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 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.
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
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.
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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/
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
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
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:
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/
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