I require your help regarding a problem I’m encountering.
Description: i trying to make a PID corretor to control the servomotor’s speed using a raspberry . the LSS.py library does not give me much liberty to control the spped the only functions given are move and move relative … there is no function move PWM or something similar . any help ?
Hardware concerned: Raspberry, LSS servo motor
Software concerned: Python
Troubleshooting steps already taken: i made a PID to correct position at first but it did not give me the result i wanted as i want to control the speed .
@derbel199 Welcome to the RobotShop Community! Spotted your ticket and noticed you had posted here as well.
You are correct that the Python library does not include that functionality. However, the LSS communication protocol is meant to be human readable and as such, you can send serial commands to the servo via Python fairly easily provided you have the right COM port, Baud rate and command structure. You can read more about the protocol here: https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/
The command you are looking for is called the "R aw D uty-cycle M ove", or RDM action command.
There are others here who have succeeded in creating PID using this command and we’ll post links to any such threads we find below which may be of interest to you.
At your service if you have any additional questions.
can some of the tech team implement the Raw Duty-cycle Move function in python so i can add it to the lss.py library and therefor use it directly . that would be of a great help .
Understood that this would be beneficial, but the team has current priorities and needs to keep to a timeline. We will be happy to include your suggestion when considering future development / maintenance.
A “library” is not necessary to send commands to the servo - you only need to send the serial command to the servo at the correct baud rate, and to the right COM port.
Note above that there are other users who are working on similar projects, and others who, though they may not have started the thread, have commented they are also working on it as well.
hi @geraldinebc15 , the function moveRDM does not work and the error is :
invalid character in identifier . i think we should add something in the lss_const.py . the problem is in the string “RDM” i guess
i have been able to create a function that takes two parameters speed (deg per sec ) and the position (deg*10) . it workes just fine and the result is satisfying . now , comparing my function to the move function that takes as parameter just the position and sets by its own the speed and the stiffness … i noticed that the frequency of the loop in the move function is higher and that the speed has been configuered to be 15 deg per sec and -15 deg per sec (in case of moving in the opposite way of the clock move) . so to satisfy my curiosity , i would like to discover how the move function has been built internally , the PID corrector and the set of the stiffness and speed … i would appreciate if you could send me the script of the move function .
thank you