Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between the installed arduino library and the github library. #2

Open
GabrielDGP opened this issue Feb 14, 2021 · 4 comments

Comments

@GabrielDGP
Copy link

GabrielDGP commented Feb 14, 2021

Hello I installed your library through the Arduino library manager and noticed that the one I downloaded over there is different from the one in this github.
I wonder what is the latest version.
In general
Thank you for this library.

@cesarvandevelde
Copy link
Owner

They should be the same; the library manager downloads directly from Github. The commits that were added after the tagged release had to do with documentation, demos and library manifest. The library itself has not changed since.

@GabrielDGP
Copy link
Author

strange to be different when I installed it.
Thanks very much for the reply.

but well I'll get from github.

I'm thinking of trying to use the PWM offset from the RAM register to directly drive the motor torque, but from the manual I was left with some doubts that you might know the answer to.
On page 24 it says that the valid range of PWM offset values ​​is -129 ~ 127, and that it is only one bit.

However, on page 27, it says that the maximum value is 1023.
and when it is 0 the motor is stopped.

I was confused by this value, because it doesn't seem to be able to put 1023 and with just 8 bits I would need 10 bits and in the case I can only write 1 byte. In addition to not seeming to put -1023 to change the direction of rotation. However, -128 ~ 127 seems to be able to change the direction of torque, but it seems that it is not possible to apply maximum torque, unless this value is added to an existing value, perhaps to leave the dead zone.

And in the case of another doubt, to read the current torque applied to the motor, it would be possible to read it through the RAM register PWM, it could work as a force sensor maybe and see if the value that I applied of torque makes on the offset PWM regulator makes any sense.

Well, I don't know if you know how to answer this question or if you have any opinion if it will work.
but I'm going to test it here and maybe find out.
I hope it works.
If it works it might be something interesting to put in your library.

@cesarvandevelde
Copy link
Owner

It's been a while since I used these servos, so I had to look up the details in the datasheet.

The PWM offset register is intended to compensate for a constant external force, e.g. gravity. The position PID loop is used to calculate a raw PWM value, the PWM offset register is added on top of that to get the final motor PWM. That's why the PWM offset register is smaller than the PWM register.

As for using the servo as a force sensor: you could use the saturator to give the servo a springy response. For small disturbances, the force would be proportional to the difference between the goal position and the actual position. Might take some fiddling to get something usable though...

@GabrielDGP
Copy link
Author

Got it.
Thank you very much for the reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants