Servo library
Re: Servo library
The Servo library only gives 10 usec resolution.
If you use something like this:
https://github.com/dhylands/upy-example ... py#L10-L13
then you can get 1 usec resolution (at 50 Hz or 100 Hz).
If you use something like this:
https://github.com/dhylands/upy-example ... py#L10-L13
then you can get 1 usec resolution (at 50 Hz or 100 Hz).
Re: Servo library
Of course that will only work with a single servo, and only on the specific board you are using. Also, servos have a dead band (to avoid oscillations), so they won't react to small changes in the duty cycle length anyways.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Servo library
In which case the designer of their control system should be shot A dead band really shouldn't be necessary!deshipu wrote:...servos have a dead band (to avoid oscillations)...
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Servo library
What can I say, those are cheap servos, this has been a traditional solution in the "industry" for decades, and they can't really say what load/inertia they will have to handle (to tune the PID properly). Smart servos are probably better designed, but they use a completely different protocol, usually based on half-duplex UART.
Re: Servo library
Hi!
I have 2 questions:
Can you control a 360 degrees servo with this driver?
And, could we control 2 or more servos with an ESP-12 for instance?
Thanks!
Sent from my iPhone using Tapatalk
I have 2 questions:
Can you control a 360 degrees servo with this driver?
And, could we control 2 or more servos with an ESP-12 for instance?
Thanks!
Sent from my iPhone using Tapatalk
Re: Servo library
You can control any servo that takes a standard servo PWM signal. Continuous rotation servos usually do.mflmartin wrote: Can you control a 360 degrees servo with this driver?
Since the MicroPython's PWM class works with 8 of the GPIO pins, you can control up to 8 servos. Technically it would be possible to control up to ten, if you re-used the serial pins, but the PWM class doesn't work with those currently.mflmartin wrote: And, could we control 2 or more servos with an ESP-12 for instance?
Servo library
Thanks!
And, from your experience, if I wanted to know the position of a continuous servo motor or dc motor, what would you use? A homing switch with a hall effect magnet for instance?
I want to make an analog clock, but I want to be able to know where the handle are (or where their start position is). What do you think?
Thanks!
And, from your experience, if I wanted to know the position of a continuous servo motor or dc motor, what would you use? A homing switch with a hall effect magnet for instance?
I want to make an analog clock, but I want to be able to know where the handle are (or where their start position is). What do you think?
Thanks!
Re: Servo library
You would use encoders of some kind, but I really don't have much experience with this, so can't recommend anything. At this point you might consider using a stepper motor or even a normal DC motor, as the servos don't really give you much, since you need to do your own PID control loop with your own encoder anyways.
Re: Servo library
I see. Thanks for the guidelines, and, of course, the driver!! .deshipu wrote:You would use encoders of some kind, but I really don't have much experience with this, so can't recommend anything. At this point you might consider using a stepper motor or even a normal DC motor, as the servos don't really give you much, since you need to do your own PID control loop with your own encoder anyways.
Sent from my iPhone using Tapatalk
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Servo library
An easy way might be to use a standard 180 degree servo and gear it up 2:1. The only snag is that at (say) 11.59 the clock's hand would sweep through 354 degrees backwards to get to 12.00.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.