Okay, for anyone else out there that is attempting to do this with an IBT_2 motor driver, you don't need to change the program. All you need are a few additional steps in the wiring. Digital pins 5&6 need to go LPWM and RPWM respectively, switching the order of these will simply invert the direction of the servo. Both the L_EN and R_EN pins need to pulled to a HIGH state and should be attached to +5V DC. Both the L_IS and R_IS pins need to pulled to a LOW state and should be attached to ground. VCC should also be attached to +5V and GND simply goes to ground. Thank you James for the code and explanation, my dreams of a robotic riding lawnmower are finally coming true.
@adf36010 ай бұрын
For driving a motor w/out concern for position, you can just make a resistor bridge 10k resistor from power to the analog input pin, and another 10k resistor from ground to the same analog pin. Since the resistance is always in balance, you only get movement from an input and you can adjust the code to give you nice little dead band for neutral. Seriously James, this may be the most universally useful code I've ever used. I've helped so many people and done several RC projects myself and your code is the heart/soul of every project I'm involved with.
@horashia4956 жыл бұрын
This is the best type of videos you should consider making more of thia type of videos in the future ..
@MrGatlin986 жыл бұрын
I was literally thinking about using a wiper motor yesterday because I need a powerful servo for a project. Didn't know where to begin. I look on your channel today and see literally the exact video that I needed uploaded at the same time I needed it. Awesome coincidence
@jyotishmanbharali37576 жыл бұрын
These are the kind of videos you should make
@nobocks6 жыл бұрын
need a subchannel !
@yourfriend39999 ай бұрын
yeah but isis used these videos to make remote controlled suicide car bomb 😂
@tommays566 жыл бұрын
Gotta say I am and old maker and really enjoy your channel your ability to take something so complex like this is and give a simple to follow path is really a gift On high speed PLC work we use hardware based inputs that do not depend on scan time to process the task
@jamesbruton6 жыл бұрын
thanks I did a bit of PLC in college, but that was in the 90s!
@tommays566 жыл бұрын
James Bruton We our very restricted in what we can use as everything we we build can mangle the operator if it malfunctions and have to use dedicated safety relays and go through a pretty intense safety review
@tommays566 жыл бұрын
cal29seafever.blogspot.com/ Enjoy my most epic 20 month build
@apocalypseio6 жыл бұрын
Thanks for the basic description of PID. Will peek your files. I am day dreaming of a few uses for this already.
@LordGarth66 жыл бұрын
im glad to see ya putting ya code and cad up for most thigns now
@AJMansfield16 жыл бұрын
5:00 An even better way to read the pulse in is to use the TC1 input capture unit to measure the pulse length in hardware, so if you have e.g. some serial code that blocks interrupts for a few microseconds and the interrupt is called late, you still have the exact time from the input edge recorded in hardware.
@malikmark87683 жыл бұрын
I know im randomly asking but does any of you know of a tool to get back into an instagram account? I was stupid lost my password. I would appreciate any help you can give me!
@zaidenignacio55163 жыл бұрын
@Malik Mark Instablaster :)
@malikmark87683 жыл бұрын
@Zaiden Ignacio i really appreciate your reply. I found the site thru google and Im trying it out now. Takes a while so I will reply here later with my results.
@malikmark87683 жыл бұрын
@Zaiden Ignacio it did the trick and I finally got access to my account again. I'm so happy:D Thanks so much, you really help me out !
@zaidenignacio55163 жыл бұрын
@Malik Mark You are welcome :D
@MakunaRGBIC6 жыл бұрын
make sure to use unsigned for all your timing variables so that when millis/micros rolls over, the math still works correctly. And yes, (current - last >= interval) is safe and correct to use with unsigned variables and will correctly handle rollover of timing functions.
@michalrutkowski956 жыл бұрын
Great video. Just one thing to mention, usually wiper motor have "3 wires", 2 normal (+) and GND in metal housing, so you should use case and one of wire, changing wire you can change speed of rotation but for long use better is to use slower one.
@jamesbruton6 жыл бұрын
What would you do with a giant servo!?
@raphaelhoornaert70336 жыл бұрын
a ventilator to counter the heat wave
@katrina-ei1jf6 жыл бұрын
Hit people with it
@supercomputer04486 жыл бұрын
James Bruton why does it say your comment is from 4 days ago
@maxjackson91916 жыл бұрын
supercomputer2004 he first uploads the videos to patreon so he probably commented when he put it up there
@supercomputer04486 жыл бұрын
Magnus Kree ohh
@BasementCreationsChannel3 жыл бұрын
Thanks a lot for this video James, it really helped me in making my own brushless servo
@superfunnymonkey1233 жыл бұрын
What did you use as a motor driver ?
@barmetler6 жыл бұрын
That's cool And you can simply change the servo's range by changing the pully sizes
@jamesbruton6 жыл бұрын
yep
@OMNI_INFINITY Жыл бұрын
Thanks for posting the files and explaining all of that!👍🏻
@mfx16 жыл бұрын
And of course if you change your pulley ratio you could make it go a lot more than 10 turns. Also put some sanity check code on the pot analogue value so the motor can't go any further than the endstops and break it.
@JamesCoyle956 жыл бұрын
I really wish you would use #define to define some constant values... You could give each pin an actual, meaningful name and then if you need to change what pin it's attached to you can just change the one #define. You really should have one for the 255 values too as they are all related. It's a simple thing that makes your code more readable and maintainable.
@ZodiusInfuser6 жыл бұрын
Either that or static const‘s, which effectively do the same thing but preserve type information.
@ZodiusInfuser6 жыл бұрын
The underlying arduino compiler definitely supports them, but I will admit the IDE does a poor job of pointing such things out. It wasn't until I switched to using the VisualMicro plugin for VisualStudio that I realised the arduino compiler supports a large amount of C++, including templates.
@JamesCoyle956 жыл бұрын
Angry Rambo Show they aren't really complex to understand though and would actually help beginners to better understand what the code is doing as you are replacing random pin numbers and constants with a meaningful English representation. digitalRead(POTENTIOMETER); is much easier to understand than digitalRead(1) for example.
@KuraIthys6 жыл бұрын
James Coyle True, but at the same time you're adding a layer of indirection between the code and the hardware, and now you have to look in two places to determine what pin is connected to which code. Makes for more readable code, sure, but actually obfuscates the hardware/software interface. Say you plug the potentiometer into a different pin (accidentally, or on purpose). Now you'll have code that states it interacts with the potentiometer, but actually doesn't. (not even the worst case scenario). If your project is pure code, yes. Absolutely. But you are manipulating hardware and software in parallel and could change either arbitrarily and now you have a label in the middle that may or may not be meaningful, depending on the hardware design.
@JamesCoyle956 жыл бұрын
KuraIthys You only have to look at where your defines are (the top of the code) and change one value rather than having to update several uses of that pin that could be anywhere in your code. Your points don't make sense. You are defining in one place that pin 1 is the potentiometer so then you attach the pot to pin 1 on the Arduino. If you attach it to a different pin you then update your define statement to point to that new pin and all references to that pin in your program are updated to reflect that you changed which pin you're connecting it to.
@ianfarquharson37726 жыл бұрын
Always enjoy and like you vids. If you watch any vid it's the least you can do for all the time N effort the creator puts in. It's just a bonus I enjoy yours lol. TkEZ»UK
@DesignedbyWill20846 жыл бұрын
The pulseIn is only giving you +/- 1us jitter verses 4us in the "improved" code. The pulseIn has an optional 3rd value of timeout. It defaults to 1 second (hence the one second +/- 5us steps in your jitter graph) and should be set closer to the 20ms timing of the RC PWM signals. Try pwm = pulseIn(8, HIGH, 30000); Timeout is in microseconds.
@ck-fz8zy2 жыл бұрын
So useful, these motors are everywhere
@supercomputer04486 жыл бұрын
1:38am here but ain't no rest for the wicked
@lilmelon54006 жыл бұрын
Cmon you got work tommorow? Money dont grow on trees
@truetech41586 жыл бұрын
Sniper Sharp107 money is made from plant, and that grows on its own. So does the narcissism as some people keep believing that the banker who put the narcissistic statement on the those always only paper god$ that people dedicate entire lives chasing after. Some are willing to put carbon atoms into the atmosphere in the process of doing so. And sadly roughly 12 million people per year die from pollution. What else is sad, is while clobbering the planets ecosystem, they like to pretend that those 12 million went on to experience an afterlife. Creepy isn't it? #inSCIENCEwetrust
@supercomputer04486 жыл бұрын
True Tech boi it's 4:05am here I don't got the brain power to comprehend what your saying I'm gonna go eat some cereal
@truetech41586 жыл бұрын
supercomputer2004 some food for though then, perhaps after you wake up. You enjoy your Rice Crispies.
@ИгорьЧерноусов-б5ж2 жыл бұрын
Hello, help me set up the program, since in the absence of a signal at the servo input, the motor rotates
@Workshopshed6 жыл бұрын
Hey James, great to see you are also building big servos. I don't have RC controllers so I've gone digital with I2C to control the position and provide information back to the host
@firozkamarudin3 жыл бұрын
You have build the transformers ,,,,great job James !!!
@deeareus98866 жыл бұрын
nice job, i'm happy that some one still use rc remotes :o)
@patprop746 жыл бұрын
Perhaps, Same style video, only difference , use those cheap 433MHz transmit and receive rf modules sold on ebay. i'm sure many would appreciate that.
@douglarue84856 жыл бұрын
Well done! I did this 3 years ago for a Maker Faire project( RC PRS ) but didn't include PID so I will try your code. Thanks. BTW, I used an Arduino Pro Mini and an L298 with my pot connected to the shaft via laser cut gearing. I like the belt/wire setup but will be mod'ing to use contactless magnetic encoder and will probably shift to a Teensy.
@SpaghettiEnterprises6 жыл бұрын
This was phenomenal James. Very informative!!
@janfpv10066 жыл бұрын
PID Tuning is something we have to dael with verry often in the fpv drone hobby. Sometimes weather force you to lower P because of the change of air density
@nigelmdl6 жыл бұрын
love this! Hope you create more vids like this. Great now to watch it again and then read the code again.
@jamesbruton6 жыл бұрын
thanks, I will be when I know what I'm talking about ;-)
@hotrodlincoln7_1806 ай бұрын
Thanks James you got a like and subscribe from me!!! Building an autonomous lawn mower with a window motor for steering and want it to reset to neutral when I let off the input. This is exactly what I was looking for!!! Thanks
@silverhead82436 жыл бұрын
James, this is very usefull drive system for your dog robot, it is strong, fast and compact, even you can find a smaller wiper motors with the same torque. Think about it.
@R_Media_146 жыл бұрын
very good ider , you can use this power full servo bulid any robot or mecah , this amazing
@jacobcook14503 жыл бұрын
Mario Kart Home Circuit! You legend! ;)
@jimmymark82324 жыл бұрын
Good idea James, thanks 👍
@davecorr44215 жыл бұрын
Awesome Video James! Thanks for posting. I have have several WW motors from old projects, i guess i need to order some controllers and start making some new projects!
@bikingnutcase06 жыл бұрын
Brilliant! Cheers for posting that information and code, I’ve been trying to do this for a while now after seeing HomoFacien’s video on the same subject, but for me your video is much clearer and easier to follow. I suspect I shall change it to use L298 motor driver ic, so I’ll need to set direction and send PWM to the enable instead of picking which pin to send the signal to, but that shouldn’t be too hard.
@floflotantan6 жыл бұрын
I love this kind of video ! I learn so much thanks !
@HarshDethe6 жыл бұрын
Very helpful. Thankyou.
@overbuiltautomotive12995 жыл бұрын
i need 2 do this with learning as little code as possible lol love it
@rafaelsays1756 жыл бұрын
My brain is aching after that
@patprop746 жыл бұрын
you might need a giant servo in your brain to turn all the gears and cogs to help presses :P JK
@antonwinter6306 жыл бұрын
loved this vid, it expanded my knowledge
@bentsprockettech3 жыл бұрын
If not done. That's pretty funny. Thanks for sharing this with us. :)
@shubhamankush69922 жыл бұрын
can someone tell me can i use digital read instead of analog read from the potentiometer because i want to opearate the motor using digital signals coming from second arduino
@smahendra19485 жыл бұрын
This is what exactly I was looking for to build a 2 DOF platform for my grand kids.
@marccloutier3501 Жыл бұрын
this video is the missing information i was needing to continue on a project!!! but instead of mapping a remote control, I want to call 8 different position while adding effect like adding turn to reach a position !
@nielsvdmarel6 жыл бұрын
Really nice video! You could do more video's like these, arduino explaining video's. You could even grab your exisiting projects and show how they work. Like the arm of Ultron :)
@jamesbruton6 жыл бұрын
thanks, I'm intending to
@KrisadaNgamsuwan Жыл бұрын
ขอขอบคุณ
@botak3333 жыл бұрын
Hi sir, how much value of pot do u used sir?? 5k or 10k sir??
@WannabeSpaceman6 жыл бұрын
"First of all, what am I talking about!?" My life in a nutshell
4 жыл бұрын
Would this setup work with a brushless motor and ESC? :)
@Dust5996 жыл бұрын
code doesn't seem to account for millis roll over... sure it takes 49 days to rollover, but would be disastrous if it happened
@PKMartin6 жыл бұрын
So every seven weeks the servo will flip out for 20ms? I think I can live with that
@Dust5996 жыл бұрын
would probably be destructive to whatever its in
@lit20216 жыл бұрын
You could also change the gear ratio between the motor and the potentiometer to get more than 180°, or less than 180° but with better precision 😊
@customfabrications6 жыл бұрын
One could also take the circuit out of a normal rc servo, wire that into the wiper motor with a new pot, and that would prevent needing an Arduino or doing any coding. Of course you would still need the motor driver to handle the current. Just a thought.
@jamesbruton6 жыл бұрын
...and you wouldn't be able to tune the PID for he bigger motor and bigger load.
@customfabrications6 жыл бұрын
True. Good point. I am curious though to try it and see how well, or how bad, it works. So, I just ordered the motor driver on eBay (I have a few normal servos and a wiper motor already), so I’ll try it and see. When I do, I’ll post a video on my channel and show the result. It may be a few weeks cause the driver is coming from China. I’ll let you know when I post the video.
@customfabrications6 жыл бұрын
So I just posted a video showing what happens when you use the circuit from a normal servo to convert a wiper motor. Check it out and see what you think. It works, but.......
@donvukovic74406 жыл бұрын
It is so refreshing to here an English speaker that does not use Americas favorite words: Umm, Uuugh, doh
@reasonablebeing53926 жыл бұрын
Awesome video. There's going to be a run on wiper motors at the auto boneyards........
@MrPmjg5 жыл бұрын
At 13:12 if the output1 is 0 you will no write the value to pmw. OK that will no be problematic for the PID control, but still it should be correct on the code, by writing just "else" instead of "else if(output1
@radiocontrolledevents Жыл бұрын
hi James, I'm using the code linked but the first "include" line fails. Only very new to the Arduino. Is there an updated link please? thanks
@jims22404 жыл бұрын
Interesting project. I am looking to do something similar and need two turns at the output so need to use a multiturn pot or use pulleys with a ratio and standard pot. Would like to see more info on the pulley arrangement to help me build something similar. Have searched a bit and haven't found much on similar pulley system. Maybe not using the right search terms...
@automacnc867 ай бұрын
Hi, i have a similar design, but it doesn't go to exact center after left or right when i release the stick. Right and left have their different home position, do you know why would it be? There is no mechanical backlash.
@champaquaman4 жыл бұрын
Using this library is it possible to have the Pk, IK, and Dk connected to pots for out of program tuning?
@MichaelRHead-zv2zf3 жыл бұрын
would you get better control using a rotary encoder in place of a pot on the motor?
@garypreen31756 жыл бұрын
James great video but can i make a suggestion to improve things and that would be physically attach the pot to motor output shaft because if you lose the pulley/ belt when using pid to control the position, the motor could run away if it loses the feedback. Just a suggestion again great video
@jamesbruton6 жыл бұрын
yes you could do that
@22Tech4 жыл бұрын
awesome thank you! i'm trying to build a big servo to turn the steering of a go kart. would a big brushed motor do?
@nguyenduckhanh553 жыл бұрын
Hi James thank you for your video. I try to wire circuit as you but control by adruino. I use Adruino it self to power both driver and servo and the motor doesnt work. Is it because the voltage isnt enough
@JairoMeirelles5 жыл бұрын
Thank you! It worked perfect for me!!!
@brofessormex2 жыл бұрын
I saw a note under problems or issues on the GitHub to turn off output?
@jamesharris60623 жыл бұрын
Hi James could you use the new pi pico to do the same with coding ?
@NomaddUK6 жыл бұрын
Hi James. Great video as usual. Can you do a step by step tutorial of creating a cheap and small walking bipedal robot, say 6 inches high? You could use it as an ongoing tutorial by adding further functions like speech synthesis, speech recognition, AI etc. If you guys would like James to do this please like this comment so he can gauge interest.
@ErgoProxyYT6 жыл бұрын
I don't see why you can't just take his big bipedal robots and make them smaller, with cheaper parts. Also, 6 inches high would probably be more expensive than like 1 foot high, just due to the the cost of small servos vs "regular" servos.
@neilsmith11455 жыл бұрын
Great video! This would work great for a linear actuator that has a pot like the ones on servo city.
@smokegraffitiSFM3 жыл бұрын
u may know...i have a full metal 47cc rc 1/4 scale, custom made, it has an h-bridge/servo/wiper motor setup its all insulated from frame, h-bridge runs 12v steering works perfectly with engine off, when i try start it sometimes it instantly steers 1 way and volts drop and it kills signal between rx/tx till i switch rx off n bk on...is this cos i never used ur method?? or is it gas engine related (engine is hard mounted to frame) i do have an arduino here
@djmips6 жыл бұрын
Nice, any thoughts on designing a direct pot feedback as I imagine the pulley setup could slip and fall or at least lose assignment?
@KamaleshBharadwaj4 жыл бұрын
Hi James the wiper motor i am using for to-fro rotation is moving in small amounts in a direction ...why so?
@stamatiskoulouris6774 жыл бұрын
Hello, i follow your video step by step . Motor is turning right and left with the movment of the controler but the zero point is not the same every time . when there is no movment from the controler the pot is stoping a little bit left or right than the zero point. any help? thanks
@akos06115 жыл бұрын
Can i use it for multiple motors?
@jopi34643 жыл бұрын
how much capacity of this servo dinamo wiper ???
@michaeld9545 жыл бұрын
how do you adjust it to where you want can you get it to do a startup check for center maybe adding end switches
@thumpernats3 жыл бұрын
This is great, if only i could understand it.
@titanwross6 жыл бұрын
Very interesting I enjoyed that
@rondlh206 жыл бұрын
Great stuff, love it!
@marinenav82 жыл бұрын
There are blog diagram picture ?
@stevenmiddleton44302 жыл бұрын
Cool project! I’m trying to do a similar one with the same parts you have used except I want to control it with a servo tester instead of an RC controller. I tried hooking it up the same way and used the code you had on GitHub. It just spins. Could you help me figure out what I’m missing? Thanks!
@amrsamyounis6 жыл бұрын
very useful and inspiring
@AbcDef-hl2ic6 жыл бұрын
What a great tuto!
@MinecraftSubi2 ай бұрын
Ok god I love you james
@jonnupe16453 жыл бұрын
Commenting for KZbin algorithm
@Soeren_Hetzer6 жыл бұрын
Thnk you verry much that you have made this video, it will help me a lot in the future. Could you do a follow up in the future where you show how to build a endless (360°) Servo that you could use for a homebulid cnc?
@jamesbruton6 жыл бұрын
well with an encoder and an end switch - check out my openDog series
@Soeren_Hetzer6 жыл бұрын
James Bruton Thanks
@PMX6 жыл бұрын
4:24 that indentation after if (!done) return is *very confusing*...
@KX366 жыл бұрын
Nice one Jim.
@waynefilkins83944 жыл бұрын
how much torque do these motors provide? Any way to do this and get like 50 ft lb. torque but moves fast like this?
@ToddSandercock6 жыл бұрын
Doesn’t the “I” value correct the error when under load? “I” or integral increases with time gradually with steady state error until saturation or reaching the target set point. “D” is the derivative which is effectively the rate it approaches the set point, can be used to ensure its not heading towards the set point too quickly.
@MihaiCadariu6 жыл бұрын
if (!done) return; is correct, because there are no curly brackets around the one line if body. ( 5:40 ) Also because the following two lines are indented wrong (but still syntacticly correct), this can be hard to understand for a human reader. Good video, otherwise!
@herlufsrensen53563 жыл бұрын
Hey James. Are there any way to contact you ? I need to change the rc control to a steeringwheel control with a POT in the end of the steeringcolum. its all made but i'm not sure how to change the code ? Should the PWM be set for A2 input with range of 0,1023 ? Etc. Best regards Herluf
@AhmetAkifKaya4 жыл бұрын
PID is everywhere!
@JPN764 жыл бұрын
Do you think the arduino is capable of controlling 2 motors that way without any lag or jittering?
@jamesbruton4 жыл бұрын
Yes
@casper22779 ай бұрын
would the 3d printed parts work on all windshield wiper motors, or does it have to be a certain kind?
@Grey-Troll7 ай бұрын
Would (given tire size) work on any car, or does it have to be a certain kind? :) Had to say it, all in good fun. I'd love to try some 50" tires on my Honda sedan though! haha
@thatonecommentor77586 жыл бұрын
Have you ever made (or considered making) a near to complete beginner's intro to robot building? Even if you didn't go into the actual "making" of the robot, just discussing the terms and basic features? I'm rather new myself, I only just got interested a few years ago and being still fairly young (high school) would really appreciate it. Thank you for any possible consideration!
@golfmechanic17143 жыл бұрын
Great video. I am making one myself. What ohm rating POT do I need to get?
@golfmechanic17143 жыл бұрын
Just figured out. When using Arduino it does not really matter What ohm rating it is.
@azyfloof6 жыл бұрын
Love this video, James! Informative, useful to a wide audience, scalable :D You could probably fit your code on an ATtiny, spin out some custom PCBs and sell them :P
@MichaelRHead-zv2zf3 жыл бұрын
my servo can't find the center point it just bounces back and forth at the center point. any help?