Arduino Tutorial 35: Understanding How to Use a Stepper Motor

  Рет қаралды 307,069

Paul McWhorter

Paul McWhorter

Күн бұрын

Пікірлер: 1 000
@thomasmiller3398
@thomasmiller3398 2 жыл бұрын
Currently in my second year of aerospace engineering at university and have never touched an Arduino or C++ before and was given a project requiring the use of multiple stepper motors, sensors, buttons and LEDS and I cannot stress enough how much these videos have helped me. Thank you so much for making such high quality free material! I know there will be others like me in similar situations and your videos will have saved them as much as me.
@zvone908
@zvone908 Жыл бұрын
Hi, I'm thinking about studying aerospace engineering after high school. Can you recommend any books worth reading, or give any advice other than that? Thanks in advance :)
@Seftdelmer
@Seftdelmer 3 жыл бұрын
For those that are doing this with the kit, please note that the supplied 9V battery may not be sufficient to drive the stepper motor (via the driver). When I first tried with the supplied battery, the stepper motor made a noise but didn't turn. I then swapped the supplied battery with a new one, and the stepper motor turned. Thanks to Paul for these excellent videos.
@sebastiannunez4878
@sebastiannunez4878 2 жыл бұрын
was the new battery any different?
@AlexDavis-ch1ro
@AlexDavis-ch1ro Жыл бұрын
Yep, me too. Mine came with a Piscell 9V: obviously not up to the task. Energiser did the trick!
@Lucky-ek8tv
@Lucky-ek8tv Жыл бұрын
same
@Thejbelow
@Thejbelow Жыл бұрын
Even with a brand new battery it's weak. Can't beat a power supply
@roncarrier4205
@roncarrier4205 3 ай бұрын
Mine worked for a bit and I checked the battery with my most excellent multimeter. The voltage turned out to be a little bit over 6 V! So I’m surprised it worked at all.
@peterknoll8906
@peterknoll8906 10 ай бұрын
I know it's an old video. I don't know if you read the comments here. I did the homework as you said, without having seen your solution to that. I did a attach.Interrupt and with it i called a function "reverse", ive made. In this function, i reversed direction. My quick and dirty way of spinning infinitely in the main loop, was to start of with "while (true)" It's at least a very short code, by having the same outcome. I've did a INPUT_PULLUP command on the pinmode. That works great. Thank you Sir, for your educational videos. Ive learnt a lot from you!
@SimulatedDigitalReality
@SimulatedDigitalReality 11 күн бұрын
I learn something new from this comment. Thank you for sharing your technique! the INPUT_PULLUP was definitely helpful
@mxcollin95
@mxcollin95 5 жыл бұрын
This channel is a gold mine! I’ll definitely be working through your arduino and RasPi series!!! Wish I would’ve had a teacher like you when I was in high school. 👍
@sameeras6566
@sameeras6566 4 жыл бұрын
SOOO TRUU BRO!!
@saeidkasraeian190
@saeidkasraeian190 3 жыл бұрын
Exactly 👌
@JonPeroutka
@JonPeroutka 2 жыл бұрын
You, sir, are the Bob Ross of engineering. Thank you for your great tutorials.
@mau19885
@mau19885 6 ай бұрын
so on point! stealing this since I tell so many people about him :)
@bjornakeSwe
@bjornakeSwe 3 жыл бұрын
I'm a retired swede of 71. I've been an engineer for 50 years. My first experiece with computers was my Commodore 128 and Basic. I do remember the com speed of 9600 and sometimes even 2400. After that it has mostly been hardware. I discovered the Arduino and got interested. I stumbled on your videos and was hooked. After watching a number of them I realised I had to get the Super Duper Kit. So it is ordered but not yet received. So far i've watched your videos to the end, but programming them in my head, so when I get my kit I think I must start from scratch and do it irl. I've also noted that you have videos about RasPi and Python, so I don't need to be bored for a long time. I have a number of ideas that can be solved with the Arduino and some coding instead of a bunch of CMOS/TTL IC's. Like so many others in these comments i wish I had a teacher like you at school.
@gusmon83
@gusmon83 2 жыл бұрын
That last bit there put into the void loop threw my brain a curveball. Finally figured out it was "buttonValOld=buttonValNew;" as the last line of the void loop. Paul, I've been bingeing these lessons and crushed 35 in three days. You've done an incredible job, here. I knew nothing but was able to follow until you said "pause" AND THEN able to program this in my own way, unfortunately vastly different and of course with different results than you were able to provide here. Things happened, but it was still on delay and made a full rotation and then reversed. Invaluable lessons. THANK YOU!
@bm5211
@bm5211 4 жыл бұрын
Thank you so much for these wonderful tutorials! As an ecology student, I have never in my life touched anything to do with electronics or mechanics before watching your Arduino series. But now, 35 episodes later, I am amazed to say I can still follow along with everything. :) Every time you introduce a new part I get so many ideas for hobby projects! I genuinely never thought I would be able to understand anything to do with wires and circuits, but your explanations have made the impossible possible. Thanks again, you're the best!
@misterdecaro
@misterdecaro 2 жыл бұрын
Before watching this, I just want to say that I wasn't sure if I was going to 'bother' going back to watch you first series, your 'lessons' on Adruino. But now I can say that I will definitely go and watch them also! I was looking for something specific and I found it in one of the lessons and, I have watched a couple of others too! At any rate, to my fellow followers/subscribers/learners, the first set of lessons Paul offered is definitely worth your time and effort. Thank you Mr. McWhorter!
@TheSelfUnemployed
@TheSelfUnemployed 2 жыл бұрын
Unable to complete the homework on my own but grateful for the lesson! Thank you Paul!
@sampleexamplemusic
@sampleexamplemusic 4 жыл бұрын
GIDDY UP. ok this dude rules. going back to the beginning and watching all of these because he's an awesome teacher!
@ancienttechnologiespinball1690
@ancienttechnologiespinball1690 11 ай бұрын
Hello Paul. I'm an Electric Mechanical pinball technician from Toronto, Canada. I built a pinball machine using parts from the '70s, but for mass production i need to use Solid State Electrictronics. That's why I'm here. Yes, i watch every video to the end, more than once. I take screen shots of coding and try not to look at the pictures later, but normally need to because I'm still learning the language. Same with the math. I failed math in high school and happy to learn it now. The wiring comes naturally to me. i've always been good with electricity and mechanical thing. I find no part of videos boring . Thank you for making them. My board broke down this morning, so while I'm waiting for a new one, I'm gonna start watching again from episode 1 and see if i can call the shots before you make them.
@ericroque5813
@ericroque5813 9 ай бұрын
For those who had trouble doing this, take note of the right sequence of pin declaration which is 8, 10, 9, 11 as this is the right sequence for half step. I put the pin number in ascending order thinking it was just as simple as naming the pin number as I plug it in the arduino board. But no, the right order mattered. Took me a while to figure this out.
@jaymzhowlett3984
@jaymzhowlett3984 6 ай бұрын
Thank you friend 🥳
@keyboardlearning7552
@keyboardlearning7552 2 жыл бұрын
I'm a retired electrical engineer, following your videos for the fun of making a device follow the projects. I made this work, in a similar manner to how you taught us to toggle with the buttons. That was more elegant than my last attempt. (Sorry I haven't waited to get to the end of the video to get the magic word.)
@rogthedodge99
@rogthedodge99 4 жыл бұрын
I did it using lesson 28 as a base. My motor only reversed when it had reached 1 revolution because I'd left the number of steps at 2048. My stepper direction was based on the button val. I now realise you can step 1 at a time, and in the same direction until told otherwise. Thanks Paul. It really is worth trying things yourself first, even if it's not quite right.
@MatlasX
@MatlasX 4 жыл бұрын
This is definitely one of the lessons where you could have probably spent a bit more time explaining how the stepper motor works in this particular case. Pins 8, 9, 10 and 11 were used, but really not sure what they do.
@misterdecaro
@misterdecaro 2 жыл бұрын
I agree, I'd like to know more details about why those specific pins and why the order of pins 9 and 10 are swapped in the Stepper setup call.
@jafaralturfy5053
@jafaralturfy5053 2 жыл бұрын
The stepper motor has 4 coils each coil is connected to 5v through these pins.
@syedsajjadali4220
@syedsajjadali4220 2 жыл бұрын
@@jafaralturfy5053 thanks mate
@chadmorreale
@chadmorreale 2 жыл бұрын
@@misterdecaro I believe this is just due to the ribbon cable and wanting to put them in order physically on the connectors.
@davidransier
@davidransier Жыл бұрын
OK, not so sure this comment will be helpful, but here goes. I read the Documents included with the Elegoo kit and it says the four pins are a four-bit code to the stepper. That says to me that they should be in order. I confirmed this by reading the Stepper.h file (found in Github). However, when I put the in numerical order the motor only spins one direction, regardless of the Step value. When I SWAP PINS 9 7 10, the direction swaps correctly when I push the button. Bottom line, we need more info from Paul M!
@tretty07
@tretty07 4 жыл бұрын
Racked my brains for a couple of hours trying this one, I got it to change direction but only after each full turn, excellent lesson, learning something new each time.
@3dpprofessor
@3dpprofessor 3 жыл бұрын
Sorry, super late reply, but decrease the amount of steps between each check. Heck, you can have it check after every 1 step.
@SimulatedDigitalReality
@SimulatedDigitalReality 11 күн бұрын
I was able to do this by my own, you're that good of a teacher. Thank you! I also actually had to use 2 9v batteries because I spent a bit too long in trying to figure it out on my own and didn't realize that the motor eats up voltages way too fast! When my stepper wasn't turning, I thought it was broken or defective, but then I checked the voltage and it went from 9.1V to 7.5V! Buying a multimeter like what you have said in your previous video was really worth it!
@donaldtroll7537
@donaldtroll7537 4 жыл бұрын
The battery from the kit died within a few minutes and made me think I unplugged something. Plugged in a new battery and everything worked. Another great video, Paul.
@kenmeyer100
@kenmeyer100 3 жыл бұрын
same here. Luckily I found the culprit with a voltmeter
@chrisortilla6111
@chrisortilla6111 Жыл бұрын
I have just been copying you as you go because, I've picked up the lessons again after some time away. Trying to let my brain get refreshed! Thanks for another great tutorial.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Excellent!
@sandeepjadhav3565
@sandeepjadhav3565 4 жыл бұрын
I am following you since lesson 1, and i would like to say I was able to do homework on my own. thanks to you.
@ghaniyyahmbello4393
@ghaniyyahmbello4393 Жыл бұрын
Mr Paul, your tutorials are really interesting and educative, breaking down every little detail. Thumbs up for the good job.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Glad you like them!
@CarolinaDGF
@CarolinaDGF 3 жыл бұрын
Thanks to all the instruction leading up to this video, I was able to do it on my own. You are a great teacher, Paul. The only thing I struggled with was getting the first part to work at all. As soon as I would plug in the stepper controller, the light would go out on my power supply. Turns out the battery in the kit did not have enough power. Glad I ordered a 9V Arduino wall wart when I ordered my kit. Plugged it in and all was well. (All was well after spending several minutes checking my wiring before pulling out my volt meter to see what the battery was not putting out enough power....)
@arjodas
@arjodas 3 жыл бұрын
thanks man I think I have the same issue lol
@pointer333
@pointer333 2 жыл бұрын
I'm glad I found this comment so I didn't have to pull out my meter lol! Had a rechargeable lithium 9V laying around from my pro sound work and everything is working now! Man, the brand new provided battery lasted about 30 seconds hahah!
@stevenog
@stevenog 2 жыл бұрын
Same problem here, no name batts are notorious for being junk. The updated link leads to a larger kit (The Most Complete Starter Kit) which includes many more parts (twice the price) including the wall wart.
@stefstaf
@stefstaf 4 жыл бұрын
These are invaluable lessons and thank you Mr. McWhorter for taking the time (and the pain) to make them for our benefit. The synchronus presentation of the code, the printout and the experiment makes these lessons the best you can find in the subject. I had a little difficulty understanding the stepper commands that came out of nowhere but then I realized that these commands are hidden in the accompanying libraries. If you intend to devote one of your wonderful lessons in explaining Arduino librabries and how they "generate" the new commands we would be for ever grateful sir.
@dash8944
@dash8944 4 жыл бұрын
If any of you are having issues getting the stepper motor to rotate, try swapping batteries - the one that came with the kit didn't work for me. My motor was vibrating but not rotating (the LED lights were not coming on either). Hope you find this friendly advice helpful. (Thanks Paul for your amazing videos btw)
@sedcdf
@sedcdf 4 жыл бұрын
Thanks, i need to switch batteries then
@sedcdf
@sedcdf 4 жыл бұрын
it worked thanks.
@frankbonsignore.RochesterNY
@frankbonsignore.RochesterNY Жыл бұрын
Thank you for suggesting this.
@damoffat
@damoffat 3 жыл бұрын
I managed it, looked back on the old button toggle code to help remember what I did back then. My only problem was leaving the number of steps at 2048, and the delay of 500ms - it almost never read the button. Then I cut it down to 10 steps and shorter delay and it worked better. My code inside the if statement was direction=-direction. Thanks for another great lesson. It's been a while, but I've been having fun with the other stuff I can do!
@27prajjwalprasad43
@27prajjwalprasad43 4 жыл бұрын
I did it on my own but in a muuuuuch more complex way. I was shocked to see that you made it work in just 5-6 lines of code!!!
@sreerajguptays3531
@sreerajguptays3531 3 жыл бұрын
Hi could you please send me your work to wrekjohn@gmail.com
@gunnarwaldschmidt7640
@gunnarwaldschmidt7640 Жыл бұрын
Pay very close attention, I spend 2 hours figuring out how important the numbering on the stepsPerRevolution definition is, if you use 8,9,10,11 instead of 8,10,9,11 your motor will only run in one direction ;-) Afterwards tried the homework, but failed. Thank you Paul for you time, you are a gem to this world. You opened my mind to so many new options!
@andrewbeshay6052
@andrewbeshay6052 Жыл бұрын
THANK YOU! I've been trying to figure this out for an hour
@ckat609
@ckat609 Жыл бұрын
Thank you, good sir! I guess I must be dyslexic
@karelenmarritkruyswijk393
@karelenmarritkruyswijk393 5 жыл бұрын
Who wouldn't get exited for electonics looking at these video's... Thank you. Thinking about using the stepper motor for domotica opening and closing curtains depending on time of the day if possible.
@TheRaptor1967
@TheRaptor1967 4 жыл бұрын
could use in conjunction with the light sensor. Auto Open curtains in the morning, close in the evening. Good security gadget for when your away? Would need to pick values carefully, would give the game away if they kept closing when a large cloud obstructed the light. :)
@vandanasrivastava2028
@vandanasrivastava2028 4 жыл бұрын
I am from class 6 and during this outbreak I have learned how to code and use an arduino board. Thankyou sir for teaching like this.
@Panvil
@Panvil 4 жыл бұрын
I did it on my own, but made it way too complex. Thanks for the great lesson Paul. Much love.
@emiliomartineziii2980
@emiliomartineziii2980 2 жыл бұрын
For anyone who is having trouble try using a 12V supply instead of the 9V battery. When I did it with just the battery from the kit, it didn't work, but when I took two double A batteries, put them in series with the 9v battery from the kit, and then used the total 12V supply, it worked!
@Brewsterblock
@Brewsterblock 10 ай бұрын
Hey Emelio. Having the same problem even with a new 9v. Where is the 12 v input? Or did you feed 12 thru the 9v?
@satisfactoyz
@satisfactoyz 3 жыл бұрын
I wasn't able to figure it out, sad to say. I made it switch, but only after each command cycle finished. I didn't realize you could get continuous movement by multiplying by 1 and -1. Anyway .... it was an eye opener. Thanks again, Paul.
@RobVollmar
@RobVollmar Жыл бұрын
I was able to do the "homework" on my own. This time through the series, I've been meticulous about saving old programs. Every time we have an assignment that references something we've done before (like the toggle button in this assignment), I open the older program and try and figure out how to adapt it for the new use case. Occasionally, I'll actually have to go back to the lesson where it was discussed (for example if I don't remember how to set up the circuit) but thus far, the code is usually enough to jog my memory. Several programmers I have talked to have told me that knowing how to adapt existing code is almost as valuable as writing that code the first time and I took it to heart.
@miketurley9277
@miketurley9277 3 жыл бұрын
Hello Paul, I appreciate your lessons. You have inspired me to learn this stuff in sequence not just dig around for what I am looking for. The kit definitely makes this easier than digging through my junk. I hate digging! I wanted to share a bit of my own knowledge with you. Although there may have been another comment or possibly just messing with some of the electronics newbies but either way ROHS isn't the MFR (I beleive this device is from Kiatronics). of the motor it is a qualification for hazardous materials used in the manufacturing process of stuff, usually electronic components. ROHS compliance was a standard that started in the late 90s-early 2000s. I hated the PB free solder, it just doesn't flow like the old stuff...
@Michael_Harrigan
@Michael_Harrigan 3 жыл бұрын
I wish that all KZbinrs had your ability to understand a student’s perspective and have the ability to thoroughly teach every step in the process.
@christopherchance4860
@christopherchance4860 4 жыл бұрын
Where were you when I was in High School? Thank you for your enduring hard work, I have learned so much from you and your tutorials
@filipegameiro4344
@filipegameiro4344 Жыл бұрын
I was able to do it. And I really want to thank you for your work, it's the first time I can do something only with lessons given on youtube.
@gitarlos
@gitarlos 5 жыл бұрын
the elgo driver does not work some times unless you switch IN1 with IN4 .
@shatann
@shatann 4 жыл бұрын
That's right! How'd you figure that out?
@thomaseardley2900
@thomaseardley2900 4 жыл бұрын
thank you bro you saved me hours of trouble shooting
@godwincornelius6285
@godwincornelius6285 4 жыл бұрын
Wow what a life saver..... I wish Paul would have mentioned that... Thanks a lot by the way.... Because the stepper motor was misbehaving
@leonhardeuler8457
@leonhardeuler8457 4 жыл бұрын
Well it didn't work too
@leonhardeuler8457
@leonhardeuler8457 4 жыл бұрын
Don't do this it may damage ur driver Mine didn't work too and I used ur method and it worked but when I changed the code to stepsperrevolution/2 it didn't work Instead of doing that change ur battery my problem was battery
@christianorlandoibarragarc3904
@christianorlandoibarragarc3904 4 ай бұрын
Took me 2 minutes to do the assignment, I notice that being an experienced developer helps a lot even though I am totally new in the electronics part.
@jefejc
@jefejc 3 жыл бұрын
These lessons are making me think hard but that's good for my old age
@wayneandersen7596
@wayneandersen7596 4 жыл бұрын
I did it. I only had a couple of differences. I did 10 steps per loop and I changed direction on button release instead of button push. Thanks for doing this series!
@lordstelanthin
@lordstelanthin 4 жыл бұрын
I did this one on my own, but wow did I overcomplicate it.
@giorgimikeladze4739
@giorgimikeladze4739 3 жыл бұрын
i did this and i undercomplicatet it
@giorgimikeladze4739
@giorgimikeladze4739 3 жыл бұрын
you dont even need buttonval old
@erikburman530
@erikburman530 2 жыл бұрын
I'm so glad I stuck with this and figured it out on my own. I went through so many wrong turns but when I finally realized how to make it work the solution was so simple I had to do a facepalm! Very rewarding! And now, on to session 36.
@michaelcostello6991
@michaelcostello6991 4 жыл бұрын
My battery died almost immediately. Lucky you warned us so we didnt panic and measured the voltage to confirm.
@jimmyjimmereeno3341
@jimmyjimmereeno3341 4 жыл бұрын
Same here. The low-cost battery that comes with the kit lasted less than 5 minutes. I was afraid that the motor or driver board had fried.
@christianvanderniet
@christianvanderniet 3 жыл бұрын
@@jimmyjimmereeno3341 yup i had the same exact thing the battery went out so i hooked up a extarnal power suply that can go to the net
@gghutton
@gghutton 5 жыл бұрын
I spent 3 hours trying to figure this out on Saturday. I knew I wanted to change directions with multiplication with a '-1'. I also went back to #34 to see how the button was set up. I also added a RED and YELLOW LED lights to show which direction the motor was spinning. So I did come back here to follow step by step.
@MahBor
@MahBor 4 жыл бұрын
When the stepper motor starts moving, some components on my breadboard power supply module start heating up to the point where they burn my fingers if I touch them. Is this normal? I'm really worried and don't wanna burn my module so I've stopped using the stepper motor.
@khaledalaryani776
@khaledalaryani776 3 жыл бұрын
You are probably running more current in the components that you should be doing and that is why it’s heating up
@adriennehuntress2987
@adriennehuntress2987 3 жыл бұрын
I had the same experience as several on this video- the 9V battery that came with my kit died very quickly. BUT I didn't realize that since I heard/felt the stepper motor sort of kind of doing something, and went too quickly to the conclusion that my stepper motor was 'bad'. Glad I saw others posting that changing out the 9V worked. Did the trick for me!
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Nice troubleshooting. Always suspect bad connections and batteries before anything else. Seems the components themselves are rarely the culprit. Thanks for the comment.
@KisorcererAMP
@KisorcererAMP 4 жыл бұрын
For the life of me, I could not understand this one. I've rewatched the toggle video multiple times and it seems that when a project involves toggles I struggle.
@garysenier2440
@garysenier2440 4 жыл бұрын
me too
@favesongslist
@favesongslist 4 жыл бұрын
You could try using two buttons for now to prove the stepper motor sketch, one for clockwise and one for anticlockwise, and then go back to the earlier tutorial for making a toggle work.
@favesongslist
@favesongslist 4 жыл бұрын
​@@garysenier2440 the trick to understanding the toggle function is that you are detecting the button change from 0 (not pressed) to 1 (pressed) over time. So step1: read the button, if 0 then lastPress=FALSE step2: read the button again and if lastpress==FALSE and the Button is 1 change lastPress=TRUE; to Make sure the toggle only happens once per press. change the Toggle state, if it was 0 make it 1, or if it was 1 make it 0. Instead of using an int it may help to use a boolean (can be either 0 or 1) bool toggleState=0; int lastPress; int buttonVal; buttonVal=digitalRead(buttonPin); IF (buttonVal==0){ // Checks if button not pressed lastPress=0; // this makes sure the toggle next press } ELSE { // Do this when button is pressed IF (lastPress==0 ) { // Check for only once per button press lastPress=1; // stops repeating while button still pressed toggleState=!toggleState; digitalWrite(LEDpin, toggleState); } }
@karamyounis15
@karamyounis15 4 жыл бұрын
Hey, idk if you still need help with this but I'll try to give it a shot. The original "if" statement reads "if(oldButtonValue==1&&newButtonValue==0){" ; the "oldButtonValue" is defined by you, in this case it's a 1, the "newButtonValue" is defined by this command "newButtonValue=digitalRead(buttonPin);". Now, the "if" statement is not true (the arduino will not run the commands underneath the "if" statement) until both parameters (oldButtonValue and newButtonValue) are met. Since oldButtonValue is defined by you, it is true from the start, and since newButtonValue is defined by the press of the button, the "if" statement will only work when "0" is read, or when the button is pressed; at this point, everything you put in the "{ }" will run. I hope I made some sense.
@didifady1641
@didifady1641 4 жыл бұрын
Paul keeps saying that we should have learned these things a long time ago, but I'm learning as a 10 year old! I gotta say Paul, you really have mastered teaching all ages. This set of tutorials are easy to understand, but so, so useful. Thanks. I finally found something useful to do during COVID-19.
@didifady1641
@didifady1641 4 жыл бұрын
The only thing that I'm having trouble with is the math, but that is understandable too! UwU
@paulmcwhorter
@paulmcwhorter 4 жыл бұрын
That's great!
@didifady1641
@didifady1641 4 жыл бұрын
Thanks so much for the tutorials!
@pranavshool
@pranavshool 4 жыл бұрын
Yeah, I did it by using different logic!
@chrisgosling5408
@chrisgosling5408 2 жыл бұрын
One those projects where there are three things to get working and you can always get any two at one time. I was running first time with two but it took another three hours to get all three.. I was delighted to get the result. Writing code is always about thinking differently and learning at the same time. We are down to 4K likes so I guess this is the hard core that will persist. Good to know that there are that many people out there who will go the extra mile rather than skip reading and looking for quick fixes. With development I have found that in designing the current project you always need to think about how this will lead into its successor. Taking short cuts that will eventually become long cuts as you box yourself into a corner!
@SarkarMotion
@SarkarMotion 5 жыл бұрын
"Stepping" up the difficulty I see! This lesson was a "stepping" stone, one might say. Oops! Sorry, looks like I "overstepped" my limits here. 😶😍
@comradepeter87
@comradepeter87 4 жыл бұрын
You, sir, have earned my respect.
@ramraja7796
@ramraja7796 4 жыл бұрын
MotiOnTech , You have taken a step in a right direction but now you must step back.
@minab45
@minab45 4 жыл бұрын
You should be removed from this channel, that'll servo right.
@jimivie
@jimivie 4 жыл бұрын
you need to step off with all these puns!
@codingvio7383
@codingvio7383 4 жыл бұрын
No you didn't, you are just getting started
@adamcurtice3584
@adamcurtice3584 2 жыл бұрын
This is the first assignment that I was unable to complete. I did not occur to be to multiply by -1 to solve this. While I was trying to analyze what was going on by using the Println command nothing would print until a full rotation was completed. Then all I got was 2048. I kept drawing a blank on how to Solve the problem. I guess I should work on these earlier in the day. Thanks for the simple solution. Keep up the good work.
@Ninethepoet
@Ninethepoet 4 жыл бұрын
21:52 this is everyones reaction when their first line of code works! P A S S I O N!!!
@i_thesnoman5198
@i_thesnoman5198 4 жыл бұрын
dang thats some passion!
@JohnB-r6c
@JohnB-r6c Жыл бұрын
Was able to almost complete homework. My stepper would not change directions until completion of the revolution cycle. Great Lesson again Sir.
@ralphmarks2727
@ralphmarks2727 2 жыл бұрын
many times through before I realized my push button only works on one side, and my power/ground rails only work halfway across either side. plus a fist full of coding mistakes, several times through, you held my hand the whole way. I thank you so much.
@MarcReeveNewson
@MarcReeveNewson 3 жыл бұрын
Another easy one. Took the downtime to explore whether the Arduino can be doing anything else while moving the motor. So I'm seeing the value of multi-tasking.
@pudgepatenaude3481
@pudgepatenaude3481 3 жыл бұрын
So glad I read the comments. My motor would only spin one direction until I switched pins 2 and 3 on the motor controller.
@connorduffy4138
@connorduffy4138 3 жыл бұрын
I'm working thorugh these tutorials in 2021. An absolutely fantastic resource, thank you! When creating the Stepper I accidentally set the pin sequence as 8,9,10,11 - not 8,10,9,11 as it should have been. This resulted in the motor buzzing but not turning. It took a long time to work out why! If another viewer is haveing similar issues, it's perhaps something to check.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Great job!
@painfullgaming8667
@painfullgaming8667 2 жыл бұрын
im having the same problem as you but your solution does not seem to work for me. When you say set the pin sequence you mean the order in which you plugged the pins in the arduino or you mean the way the pin are listed in the code?
@painfullgaming8667
@painfullgaming8667 2 жыл бұрын
found out what the problem was....the batery was just not having an output of 5v so thats why the controller would not power up :0
@sebastiannunez4878
@sebastiannunez4878 2 жыл бұрын
@@painfullgaming8667 i have the same problem.. for some reason when I run an empty program the output voltage of th battery is 5V. However, when I run the program of the step motor it goes down to ~2V and therefore I don't see any movement; just a buzz.
@geralddrake4617
@geralddrake4617 4 жыл бұрын
Had a little trouble with getting the stepper motor commands correct. Failed the homework assignment but gave it a good try. Steeper motors are so important for good projects. Thanks for sharing your knowledge for FREE on these videos.
@samuelAkpan-d1x
@samuelAkpan-d1x Ай бұрын
Great work by Senior Paul McWhorter. You made me fall in love with hardware😇
@chrisgosling5408
@chrisgosling5408 2 жыл бұрын
More great Advice from Paul is to always set the serial up for debugging, this helpd me to get the case statements in the right loop.
@aaronmilliman7685
@aaronmilliman7685 2 жыл бұрын
Ever have all the confidence in the world and fall flat on your face :) I didn't get the homework and am thinking about binge watching all videos from scratch to fill in any gaps I have in my brain housing group. Excellent video.
@souljr.
@souljr. 9 ай бұрын
Took me a while of troubleshooting/looking back at notes (like 30-45mins) but I finally got the program working to a fairly smooth point. I'm sure there's a much better way than what I've done, but I'm just happy to have gotten the homework done without listening ahead! Figuring out where exactly to put the delay( ) command in my program was the tricky part. I decided to use do...while loops to make the motor keep going until the button is pressed then change direction. Probably one of the main reasons I was having issues with the proper delay time location within the blocks.
@agonslay9173
@agonslay9173 Жыл бұрын
I am disapointed in myself I tryed the homework for 1h and i still couldn't get it , when i saw how easy it was i laught so much i woke up mu parents It is probably becouse i had a few mounths stop from the tutorials becouse i don't have the same kit and i had to buy some components. I am so happy that i can continue my journey whith the tutorials
@marvingvx1
@marvingvx1 3 жыл бұрын
You accuse some of us of watching without doing the homework? The way I learn is watching through the series to absorb the concepts. After 35 video's watched and 33 to go I will watch through the second time with the hands on approach. Thank you for your contributions. :-) BTW My knowledge and skills with Fusion 360 have become more advanced thanks to your Fusion series
@paulrockwell9914
@paulrockwell9914 3 жыл бұрын
I too found my 9V battery running out of juice while watching the video. In fact I had just noticed my motor has stopped working, checked the battery with my handy dandy multimeter and switched over to the AC adapter at almost the same time you noticed your battery was exhausted. Nice lesson - and I was able to complete it as “homework” when the video was paused.
@steveholt8991
@steveholt8991 6 ай бұрын
This series is still relevant today. I've learned so much going back to the basics. Thank you very much Paul.
@malcolmsnow4799
@malcolmsnow4799 2 жыл бұрын
Love it - Due to the gear reduction system inside the little stepper motor, the actual steps per rev works out to be 32/9*22/11*26/9*31/10*32 = 2037.8864197530864197530864197530864197530864197531 I'm having fun and watching all of your videos --- Thanks Mal
@Mrerrol13
@Mrerrol13 3 жыл бұрын
I finally got it! I used the switch, "the old-fashioned way", with the resistor (I forgot the new system), but at the end it worked. I had problems with the change of direction; first because I had it at full turn and then because I discovered that printing the values on the screen slowed down the program so much that it didn't detect the press on the switch. It was too much work because of my clumsiness, but I finally managed to do it in a similar way as you did, Paul. Thanks so much!!!
@BRIANCLEMENT28
@BRIANCLEMENT28 3 жыл бұрын
Got the joystick to control the stepper in the y and the servo in x. then I put a red toggled LED on the end of the servo. should have used the Green LED cuz this was s special occasion. You Rock Mr.M
@חייםלב-ז7ו
@חייםלב-ז7ו Жыл бұрын
i did it in a diffrent way, but my method works only with a short click. that was a great lesson, thank you very much!
@tonytungate4540
@tonytungate4540 3 жыл бұрын
I did the homework, worked out quite complicated on the first attempt, but then went back and reviewed lesson 27. Much cleaner code on the 2nd go. This one made me think alot!! definatly taught me to think it through before diving in, and work out a flow diagram.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Excellent!
@micahhoffman7818
@micahhoffman7818 2 жыл бұрын
I don't usually comment but I feel like I have to this time. I was pulling my hair out trying to figure out why my homework wasn't working. Everything seemed fine but the stepper wasn't turning no matter what I tried. After about an hour I finally realized that I forgot to plug the psu into the battery 🤣. I now have everything working. Thanks Paul!
@karansunar4458
@karansunar4458 4 жыл бұрын
you are the best teacher i ever seen my life...
@muhammadrafiqulislamkhan6994
@muhammadrafiqulislamkhan6994 2 жыл бұрын
Difficult but you make it more easier to us. Teacher your every project comes me new and different. I am trying to whole thing but it not easy to me. That is why I can not able to write your homework project alone. I need times to understand fully. Till then I must copy you. But I assure you, after copying you one day I make myself your task alone. Now, it is really difficult for me to understand fully. To the end I just say, I clap today just as a child see surprize from someone like magician. I also laugh to see your final step at the end of the project. You are such a great magician to me. Thanks for everything.
@MatsSjoq
@MatsSjoq 2 жыл бұрын
Thanks Paul. I've followed every lesson to the end. Done all home work. I'm writing extensive comments in all my programs so that I can understand what I've been doing. Also used the Reference under Help, which has been very helpful. Unfortunately the battery with the kit was lousy. The stepper motor stopped working after a minute. Luckily you mentioned you hade to switch batteries. Now it works again.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
The battery is useless. Lasts about 10 seconds.
@donthomas9669
@donthomas9669 4 жыл бұрын
I got it on my OWN!!! My confidence is growing!! Thank you so much Paul, you are an excellent teacher, and the best part of my day is coming home and doing these arduino tutorials with you, I look forward to them all day long. I used an if else statement, with a button value variable and a digitalRead command making the button HIGH with a digitalWrite command.I didnt even use buttonValNew or buttonValOld, I just used button val and I used If(buttonvalue==0) then the stepper commands, then else (buttonvalue==1) then the negative stepper commands.
@bobpattenden
@bobpattenden Жыл бұрын
This is my favourite lesson so far, so much of what has been taught over the past few lessons, all came together and made perfect sense.
@rachelglover4733
@rachelglover4733 4 жыл бұрын
For those it may help my motor was wired a little differently and after some trial and error needed IN1 to Pin 11, IN2 to Pin 8, IN3 to pin 10 and IN4 to pin 9. Thanks for the lessons Paul - learning a lot!!
@destinyokwong2099
@destinyokwong2099 Ай бұрын
I did it myself sir I used a very similar method sir Thanks to your lessons Steps = -steps But I prefer the way you did it.
@preetamsingh147
@preetamsingh147 4 жыл бұрын
I had attempted to do it by myself, but my solution was partly correct. And yours is perfect, so yes I did copy you, but after putting in my efforts in the solution. THANK YOU!
@Jim-mn7yq
@Jim-mn7yq 4 жыл бұрын
Yes, I was able to get it working. But I almost immediately ran into hardware issues. I got the initial stepper motor to turn, but shortly after that the green led on the power supply started to dim and ultimately all lights on the driver went out. Turns out the battery in the kit was almost doa on delivery. As a result, I discovered what Paul mentioned, ie, these motors gobble up a lot of amps and can drain a battery quickly. Also the power supply doesn't seem to operate well with much below 8.5 to 8 volts. Once I got that figured out, it wasn't too bad. The hack on the pin was pretty obvious, and for those of us who've followed along, the toggle code was almost identical. All in all, a very challenging tutorial. And one I'm sure many of us learned from, including expanding our troubleshooting abilities.
@christopheraguilar44
@christopheraguilar44 4 жыл бұрын
I was soooo worried my motor didn't work BUT I followed the troubleshooting steps you showed us in all your previous videos and it turned out it I was given a dud for a battery in my shipment! Thanks for the very beneficial videos you put out ive learned so much during quarantine!
@katherineclarke4435
@katherineclarke4435 4 жыл бұрын
I didn't manage to do it all on my own. I wrote it out in English not code and I knew there was something that needed to be multiplied by -1, just couldn't work out what!! Good project, thanks!
@grelca
@grelca 2 жыл бұрын
since i am following these tutorials using micropython instead of c++, this one was kind of an adventure for me! i almost gave up and just switched to c++ for this lesson but in the end i prevailed! i ended up learning a bit about how these motors work (or at least how to control them electronically) and writing my own motor controller class after i wasn't able to find any that behaved exactly how i wanted. i think my controller class is kind of specific to the uln2003 motor driver, but that's ok it also took me far longer than it should have to realize that i needed to change my loop behavior from full rotations to one step at a time in order to incorporate the button press being at any time!
@jld1501
@jld1501 2 жыл бұрын
I went through this about 6 times with no luck. I rewatched several times to be sure I had everything entered correctly, still nothing. I went to your website and copied your code into a new sketch, uploaded and it worked perfectly. I went back to my original sketch and checked line by line. Absolutely identical. I have no idea what is going on.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
To make progress as a programmer, you have to fundamentally understand this. If it is not working, you made a mistake. If your code was identical to mine, then you would be getting an identical result. To find an error, you first have to admit you have an error. It might be an error in code, or it might be an error connecting your hardware up. The error is there, now go find it.
@jld1501
@jld1501 2 жыл бұрын
@@paulmcwhorter I'm going to make a copy of my original sketch and delete line by line and paste in code that I know works. This will at least tell me where the problem is at so I can go back to my original file and see what was wrong.
@jld1501
@jld1501 2 жыл бұрын
@@paulmcwhorter I found the problem and I'm shocked no one else had the same issue. At 8:55 in the video you explain that the stepper drive pin IN1 goes to Arduino Pin 8, IN2 to pin 9, IN3 to pin 10, and IN4 to pin 11 but the sequence of pins in the code were 8, 10, 9, 11, and of course I had them in sequential order. 8, 9, 10, 11. The 9 and 10 swapping places was so hard to find and just about caused me to lose my mind.
@DirkSimilon1
@DirkSimilon1 3 жыл бұрын
It's amazing for me, totally newbie in the art of electronics, that sofar I can follow and understand everything our beloved teacher says and explains, and more. He even made it possible for me to really be happy about the working of circuits. Through you Magic comes True, Paul. But the Stepper-lesson was a hard one. Nothing worked - I controlled all wires, buttons,....no movement of the motor, no lights on the driver. I measured a correct current on the breadboard and the controller though. I read en reread the code and made changes according to reactions of other students, I replaced the battery and even made a direct connection to the arduino-5Vpin. I even filled my cup of coffee with ice-tea. ..Nothing happened. Almost on the point of loosing all my hope, i wondered what those 2 unused pins on the motordriver did. I found out that they were meant for an on/off switch! ....and unconnected..??? so...I connected them and BOOM BOOM BOOM BOOM BOOM BOOOM boooooooM!!!!!!!!!!!! Never give up, you guys and girls ps shouldn't those pins not be covered by a little cap or something like that - or was i so unlucky to miss that in my Elegoo Super Starter Kit?
@hedgewicksattempts
@hedgewicksattempts 2 жыл бұрын
Spent quite a while on this one. Threw in a potentiometer to set the motor speed 1-10 as well just to do the math. It's kinda working but I can only change the rotational direction when the switch is toggled during the delay time. I accept my failure and shall watch and learn now!
@AlexDavis-ch1ro
@AlexDavis-ch1ro Жыл бұрын
I paused, and was able to make it work, although the method I used was temperamental and wouldn't always change direction. I tried to change the variable using a (-1) multiplier and used your easy button hack, but I forgot about the (&&) command in the 'if' statement. Thank you for your teachings; every evening I'm able to learn something new, and it gives me something to ponder during the day, and how I can use it in future projects. Much love!
@scardoso95
@scardoso95 3 жыл бұрын
Think about giving a thumbs he says. Too late, already done. Thanks so much. I did it on my own with the exception that I did not set the steps to one which made it less responsive. It's obvious now but not when I did it on my own. I think they call it learning. So happy!
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Thanks for sharing!
@carlgrigg
@carlgrigg 2 жыл бұрын
I did my homework honest but the dog ate it! Enjoying making things move, thank you again sir.
@skmplanet9591
@skmplanet9591 3 жыл бұрын
Stepper motor is included in electrical engineering curriculum, but this beautiful piece is mostly neglected. Thanks a lot for this tutorial.
@tanvirahmed8586
@tanvirahmed8586 3 жыл бұрын
I tried to do this on my own but, I failed. At least now I know how to do this perfectly. Thanks, Mr. Paul.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
You can do it!
@flyboypat
@flyboypat 2 жыл бұрын
ordered my kit finally, with your link. I have a different kit that doesn't have all the same components. This is a great series. Thanks for taking your time Paul.
@weversonbarbieri8986
@weversonbarbieri8986 3 жыл бұрын
I studied at the university about arduino, but just now I am really learning. Thanks Paul, quite relaxed arduino lessons!!!!
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Glad to help!
@dwightphillips2185
@dwightphillips2185 2 жыл бұрын
I did Tutorial 35, and did it differently than you did. I liked your coding much better. Thanks for a great series.
@ethanwright501
@ethanwright501 3 жыл бұрын
I did it but I kept the steps per revolution, and multiplied that by -1. And I messed up the which pin the button needed to be connected to, so I ended up going back to basics and using a resistor. Your way makes a lot more sense.
@muhammadrafiqulislamkhan6994
@muhammadrafiqulislamkhan6994 2 жыл бұрын
Magic. I am learning from you. Hope I can able to do my own whithout taking any help from you but now I can not do without your support. Thank you.
Arduino Tutorial 30: Understanding and Using Servos in Projects
18:05
Paul McWhorter
Рет қаралды 253 М.
«Жат бауыр» телехикаясы І 26-бөлім
52:18
Qazaqstan TV / Қазақстан Ұлттық Арнасы
Рет қаралды 434 М.
진짜✅ 아님 가짜❌???
0:21
승비니 Seungbini
Рет қаралды 10 МЛН
How Stepper Motors Work - Electric motor
14:01
The Engineering Mindset
Рет қаралды 1,1 МЛН
Stepper Motors with Arduino - Controlling Bipolar & Unipolar stepper motors
50:22
How does a Stepper Motor work?
5:53
Sabins Civil Engineering
Рет қаралды 4,9 МЛН
Arduino Tutorial 37: Understanding How to Control DC Motors in Projects
31:25
I tried the Cheapest Arduino Alternative (that Nobody heard of)
13:31
Beginners Guide To Using Large Stepper Motors: #087
19:49
Jeremy Fielding
Рет қаралды 305 М.
Stepper Motors and Arduino - The Ultimate Guide
29:57
How To Mechatronics
Рет қаралды 1,3 МЛН