HUGE LIKE, I tested another code and I thought my little servo was broken, but your code worked like a charm.
@alexandergames78433 жыл бұрын
*Helpful information:* The reason you had to use expanded duty cycle values is that the sg90 servos are actually 120-degree servos. Most Chinese documentation is wrong. They do have a max rotation of 200 degrees but it requires a bigger range of duty cycles than what the documentation states. If you run the servos at 900us -2100us duty cycle you will get the 120 degrees. To measure this you can use the shell in Thonny to set the duty cycle to duty_ns(900000) and mark the location and then set the duty cycle to duty_ns(2100000). This will result in the 120degree rotation that the servo is actually meant for. I have found that for most of these servos a duty cycle of 600us and 2500us will result in the 180 degrees that we want.
@tinkertechtrove29103 жыл бұрын
That's good info, thanks!
@eternaldoorman5228 Жыл бұрын
It's a Pi co-processor, so you were right the first time, I reckon!
@mohamedfarid74992 жыл бұрын
thank you Mr.Tim , i use adafruit keypad hid library to stop and start the video using macro push bottom
@glennpoirier80003 жыл бұрын
Hi Tim, Great video, working through my arduino kit with my new Pico. This and your stepper video have been really useful!
@tinkertechtrove29103 жыл бұрын
I'm glad they have been helpful :-)
@jayk8062 жыл бұрын
What a great video. I learned so much about servos and the pico. Thanks for sharing this info!!! 😁
@WintonMc2 жыл бұрын
Hi Tim, Your videos are so good. They're still relevant. Won't you be making more? It's been a year!
@TheUnofficialMaker2 жыл бұрын
why did you use for _ in instead of: for i in range ? Also, why did you limit to 1024? Also would of been nice to see the code running the servo!
@rahula39442 жыл бұрын
really good explanation...
@EvilKimau3 жыл бұрын
I really need to make a catalogue or something to figure out all the random parts I have in my electronics kits. Would be nice to have the part numbers or store links in the description (^_^)
@tinkertechtrove29103 жыл бұрын
Thanks for the feedback, that's not a bad idea :-)
@JarleTeigland2 жыл бұрын
Great Video- n00b question - HOW do you interpret datasheets from the servos (into duty cycle etc) ??? Having Trouble with a servo/robot arm
@chrisl26563 жыл бұрын
It’s normal for a servo to want a pulse of between 1ms (0 degrees) and 2ms (180 degrees), which would equate to PWM duty cycles corresponding to what your data sheet recommended. 50Hz = 20ms. 1/20 = 5%, 2/20 = 10%. I think the fact that you had to significantly expand this range is because your sweep is much faster than the servo can physically track. Try an alternating 5% for 5 seconds, 10% for 5 seconds and I expect you’ll see the range of motion is very close to the full 180 degrees.
@tinkertechtrove29103 жыл бұрын
Oh that's very interesting, it would explain things. I'll give that a go, thanks for the suggestion!
@SoggyCashew3 жыл бұрын
Learned a lot thank you
@brianmoore54543 жыл бұрын
Tinker...a very interesting coding. How can I modify the code so that, at switch on, the Horn moves to Zero Position, then requests the user to tell it (via a text message in the shell area) to what angle it should move, and at what speed.. I am a newbie at MicroPython so having to just play with the various variables. At the moment the code just makes the horn thrash back and to.
@davidroberts50902 жыл бұрын
Duty_u16 has a range of 0-65534, doesn’t it? Maybe that’s why you had to jiggle your calculated values for full range movement as you were using 65025?
@MicrobyteAlan3 жыл бұрын
Interesting and well presented, thanks. I sub’d 👍🏽
@elfenmagix81732 жыл бұрын
Great video BUT... 1) The SG90 (and the MG90) has a swing of about 210 and not 180. But 0 to 180 is used so that the arm is not pulled back when it goes past 180 degrees. 2) "High Torque?" It is called the SG90 because 90grams of the max allowed force the servo should run on. Anything more the plastic gears start to get chewed up. Now, the MG90 is a metal gear version of the SG90. Though the gears are metal in the MG90, does not mean one can go past 90grams though it can handle 4x the force, you can still break it. The SG90 and the MG90 are the same shape and size though the SG90 uses plastic gears and the MG90 uses metal gears. Otherwise great video!
@qcasares3 жыл бұрын
Really clear and simple explanation. EXCELLENT!
@bosqueblanco37442 жыл бұрын
this is one of the first videos i watched to get an understanding of using servos with my micro controller - revisiting it now as i have upgraded to mg90s servos for a robot project and mainly i wanted a clarification to the importance of that last line of code: "pwm.duty_u16(duty)" i thought it corresponded to what pin was in use but i see this is incorrect - can someone explain?
@naomisunga47992 жыл бұрын
Hello, can I ask if we can code a pid control in the servo motor using raspberry pi pico? (sadly, without the use of arduino)
@manwithgutz3 жыл бұрын
Hi, Possible to do one for a drone brushed motor?
@rizacelik3 жыл бұрын
How can we read PWM from an RC receiver, can you make a simple example. Can you take a video.
@timwalt91903 жыл бұрын
since now the pico is supported on the arduino ide, can you do a tutorial how how to program the pico and servos with pwm using arduino ide
@ravindrabhoi89443 жыл бұрын
yes we want it
@atinsuarez8974 Жыл бұрын
how many volts is your supply?
@guillermosuperboy20013 жыл бұрын
hi could you explain me why " direction = -direction " in the if and elif, what does it mean and how does it work? thanks you very much
@tinkertechtrove29103 жыл бұрын
Sure, if direction is 1 then -direction sets it to -1. If direction is -1 then -direction sets it to -(-1) which it 1. So its just a quicker way to say "if direction == 1: direction = -1; elif direction == -1: direction = 1". This value, 1 or -1, is then added to the servo position control to make it 1 bigger or 1 smaller as needed. Hope that helps
@guillermosuperboy20013 жыл бұрын
@@tinkertechtrove2910Thanks a lot I hadn't understood that part
@marcosdasilva74092 жыл бұрын
SHOW 😁 🇧🇷
@Mark-ut3ml3 жыл бұрын
sir how can i turn 1 time 360degrees
@tinkertechtrove29103 жыл бұрын
The sg90 can only turn through 180degrees.
@Mark-ut3ml3 жыл бұрын
If mg996r sir you tried ?
@MrBeiger3 жыл бұрын
I got the Micro Servo 9g SG90 and it can definitely spin around and not just 180 degrees.
@johntyler42228 ай бұрын
Every single video on this subject ends up making the servo run backwards and forwards but nobody takes it any further and shows how to move to a certain point if some input occurs and another point if something else happens. It’s only half a story.
@projo23 жыл бұрын
I did a Google search and the definition audio pronounced it Peye-Co.
@rjinnh39333 жыл бұрын
Sorry OldMan but if you had Zoomed_In on the CodeScreen I'd have given you a Thumb'sUp instead of a Thumb'sDown. You need to BrushUp on your YT_VideoSkills.....
@TheUnofficialMaker2 жыл бұрын
yeah, I had to look at the code on his github page.Contrast sucks too.