Raspberry Pi Pico Servo Motors via PWM

  Рет қаралды 30,058

Tinker Tech Trove

Tinker Tech Trove

Күн бұрын

Пікірлер: 43
@rungeon83
@rungeon83 3 жыл бұрын
Tim these pico tutorials are gold!! Thank you!
@tinkertechtrove2910
@tinkertechtrove2910 3 жыл бұрын
Your welcome, glad they're helpful
@4ur3n
@4ur3n 2 жыл бұрын
HUGE LIKE, I tested another code and I thought my little servo was broken, but your code worked like a charm.
@alexandergames7843
@alexandergames7843 3 жыл бұрын
*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.
@tinkertechtrove2910
@tinkertechtrove2910 3 жыл бұрын
That's good info, thanks!
@eternaldoorman5228
@eternaldoorman5228 Жыл бұрын
It's a Pi co-processor, so you were right the first time, I reckon!
@mohamedfarid7499
@mohamedfarid7499 2 жыл бұрын
thank you Mr.Tim , i use adafruit keypad hid library to stop and start the video using macro push bottom
@glennpoirier8000
@glennpoirier8000 3 жыл бұрын
Hi Tim, Great video, working through my arduino kit with my new Pico. This and your stepper video have been really useful!
@tinkertechtrove2910
@tinkertechtrove2910 3 жыл бұрын
I'm glad they have been helpful :-)
@jayk806
@jayk806 2 жыл бұрын
What a great video. I learned so much about servos and the pico. Thanks for sharing this info!!! 😁
@WintonMc
@WintonMc 2 жыл бұрын
Hi Tim, Your videos are so good. They're still relevant. Won't you be making more? It's been a year!
@TheUnofficialMaker
@TheUnofficialMaker 2 жыл бұрын
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!
@rahula3944
@rahula3944 2 жыл бұрын
really good explanation...
@EvilKimau
@EvilKimau 3 жыл бұрын
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 (^_^)
@tinkertechtrove2910
@tinkertechtrove2910 3 жыл бұрын
Thanks for the feedback, that's not a bad idea :-)
@JarleTeigland
@JarleTeigland 2 жыл бұрын
Great Video- n00b question - HOW do you interpret datasheets from the servos (into duty cycle etc) ??? Having Trouble with a servo/robot arm
@chrisl2656
@chrisl2656 3 жыл бұрын
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.
@tinkertechtrove2910
@tinkertechtrove2910 3 жыл бұрын
Oh that's very interesting, it would explain things. I'll give that a go, thanks for the suggestion!
@SoggyCashew
@SoggyCashew 3 жыл бұрын
Learned a lot thank you
@brianmoore5454
@brianmoore5454 3 жыл бұрын
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.
@davidroberts5090
@davidroberts5090 2 жыл бұрын
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?
@MicrobyteAlan
@MicrobyteAlan 3 жыл бұрын
Interesting and well presented, thanks. I sub’d 👍🏽
@elfenmagix8173
@elfenmagix8173 2 жыл бұрын
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!
@qcasares
@qcasares 3 жыл бұрын
Really clear and simple explanation. EXCELLENT!
@bosqueblanco3744
@bosqueblanco3744 2 жыл бұрын
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?
@naomisunga4799
@naomisunga4799 2 жыл бұрын
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)
@manwithgutz
@manwithgutz 3 жыл бұрын
Hi, Possible to do one for a drone brushed motor?
@rizacelik
@rizacelik 3 жыл бұрын
How can we read PWM from an RC receiver, can you make a simple example. Can you take a video.
@timwalt9190
@timwalt9190 3 жыл бұрын
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
@ravindrabhoi8944
@ravindrabhoi8944 3 жыл бұрын
yes we want it
@atinsuarez8974
@atinsuarez8974 Жыл бұрын
how many volts is your supply?
@guillermosuperboy2001
@guillermosuperboy2001 3 жыл бұрын
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
@tinkertechtrove2910
@tinkertechtrove2910 3 жыл бұрын
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
@guillermosuperboy2001
@guillermosuperboy2001 3 жыл бұрын
@@tinkertechtrove2910Thanks a lot I hadn't understood that part
@marcosdasilva7409
@marcosdasilva7409 2 жыл бұрын
SHOW 😁 🇧🇷
@Mark-ut3ml
@Mark-ut3ml 3 жыл бұрын
sir how can i turn 1 time 360degrees
@tinkertechtrove2910
@tinkertechtrove2910 3 жыл бұрын
The sg90 can only turn through 180degrees.
@Mark-ut3ml
@Mark-ut3ml 3 жыл бұрын
If mg996r sir you tried ?
@MrBeiger
@MrBeiger 3 жыл бұрын
I got the Micro Servo 9g SG90 and it can definitely spin around and not just 180 degrees.
@johntyler4222
@johntyler4222 8 ай бұрын
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.
@projo2
@projo2 3 жыл бұрын
I did a Google search and the definition audio pronounced it Peye-Co.
@rjinnh3933
@rjinnh3933 3 жыл бұрын
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.....
@TheUnofficialMaker
@TheUnofficialMaker 2 жыл бұрын
yeah, I had to look at the code on his github page.Contrast sucks too.
Raspberry Pi Pico Stepper Motors via PIO
25:17
Tinker Tech Trove
Рет қаралды 62 М.
How To Use A Servo With Raspberry Pi Pico
11:49
Core Electronics
Рет қаралды 22 М.
How Strong is Tin Foil? 💪
00:25
Brianna
Рет қаралды 70 МЛН
БУ, ИСПУГАЛСЯ?? #shorts
00:22
Паша Осадчий
Рет қаралды 2,4 МЛН
ТЮРЕМЩИК В БОКСЕ! #shorts
00:58
HARD_MMA
Рет қаралды 2,2 МЛН
Raspberry Pi Servo Motor Control
17:36
ExplainingComputers
Рет қаралды 392 М.
Servo Motoring with the Raspberry Pi Pico and CircuitPython
10:49
Prof. John Gallaugher
Рет қаралды 2,7 М.
Raspberry Pi Pico
16:16
ExplainingComputers
Рет қаралды 315 М.
Raspberry Pi Pico W LESSON 36: Control a Servo With MicroPython
36:02
Raspberry Pi Pico - Review and Getting Started
18:32
Gary Explains
Рет қаралды 77 М.
How To Use A Relay With Raspberry Pi Pico
11:59
Core Electronics
Рет қаралды 28 М.
controlling lots of servos with a Raspberry Pi Pico
13:38
pileofstuff
Рет қаралды 13 М.
Raspberry Pi Pico: Inputs & Servo Control
17:20
ExplainingComputers
Рет қаралды 134 М.
Why You Need To Put A Raspberry Pi Pico Inside Your XBOX Right Now!
17:37
Macho Nacho Productions
Рет қаралды 261 М.
PWM Outputs | Raspberry Pi Pico Workshop: Chapter 2.7
7:25
Core Electronics
Рет қаралды 2,2 М.
How Strong is Tin Foil? 💪
00:25
Brianna
Рет қаралды 70 МЛН