Servo PWM resolution?
It looks like the PWM resolution is low.
So, sending S0 is equivalent to S1, S2, S3, S4 and S5. Only S6 makes servo move a little, but the next movement will be only at S11 (S6 is the same as S7, S8, S9, S10). And so on.
The other problem, S90 is the highest position you can send to the servo (everything higher than 90 is equivalent to S90).
It means, there are only around 16 or 17 positions that the servo can theoretically take, which is absolutely not enough for me, because I've attached a pencil in a different way (see the picture).
Any chance to improve the resolution?
Just had to go and try that as I hadn't noticed it I only need pen up or down S0 and S22 work for me but your right. you could have a look at this https://github.com/robottini/grbl-servo I am not sure if Eleksmaker have any plans to release the source code for their firmware it would be nice if they did so we could learn from it and experiment.
Maybe they are using exactly the one you mentioned (the machine always welcome me with "Grbl 0.9i ['$' for help]"
Actually, the newest grbl 1.1 has laser PWM, which (I believe) can be used for servo as well by changing the frequency.
For the source code, they might consider releasing it as required by the GPL license of the grbl that it's based on.
@hidoba Just compiled GRBL Servo to give it a try and yes it works exactly the same.
I changed the two lines to get it to move 180 as it says
define RC_SERVO_SHORT 15 // Timer ticks for 0.6ms pulse duration (9 for 0.6ms)
define RC_SERVO_LONG 32 // Timer ticks for 2.5 ms pulse duration (39 for 2.5ms)
and now it will move S3,S6,S9 ect to about S90 at 180 degrees.
Not sure if that will help with what you have planned but you could give it a try.
@zax can you help with getting a better resolution from the servo?
I don't think you can, the PWM is 8-bit so 0-255. If you want the servo to have 180 degree rotation it will only have 0.7 degree per value change and probably not very accurate so say 2 or 3 pulses to see a change that's 2 degrees per step.
0.7 degree per step would be perfect (because now I have steps of around 5.5 degrees).
This post is deleted!
@mrmister I found the following in the Q and A.
"But if you release the modified version to the public in some way, the GPL requires you to make the modified source code available to the program's users, under the GPL."
It would be nice for them to release it so people like Hidoba that have got a special project in mind could have a play around and adjust it to there needs.