Это видео недоступно.
Сожалеем об этом.
Controlling a Stepper Motor with a Remote Control and Arduino
HTML-код
- Опубликовано: 17 авг 2024
- In this example, I demonstrate how to use Arduino and remote control to control the speed of a stepper motor.
👉Subscribe for more robotics and engineering tips:
/ @theboredrobotllc
Share this video with a friend:
• Controlling a Stepper ...
Parts needed for this example:
Arduino Nano - amzn.to/3WO3JkJ
Stepper motor - amzn.to/3kReLZ4
A4988 Stepper motor driver - amzn.to/3Hi1FMa
JST connectors - amzn.to/3HDYRua
11.1V lithium polymer battery - amzn.to/3JxZjLA
XT60 to barrel connector - amzn.to/3jhbmCu
100µF capacitor - amzn.to/3WNQP64
Disclaimer: This video contains affiliate links, meaning that if you make a purchase from one of the product links, I'll receive a small commission.
In this video and on your blog you show schematics and a PCB for two modules to control two motors but the Arduino code provided is only for one, I understand enough to see its only for one but don't have the knowledge to modify it myself for two and would likely just break the code, could you provide the code for the two modules please?
I want to use this to control zoom and focus on a motorised lens for a HD FPV system on a Rc plane!
My suggestions is to use the AccelStepper library. See video below. The code from this video you're commenting on can get a bit clunky when you start adding more motors.
ruclips.net/video/QRCvC5xhJCw/видео.html&lc=UgzrPGWk_RqfpmJ7d-d4AaABAg
If you add an additional channel from you remote control, then you can have it correspond with the additional motor.
@@TheBoredRobotLLC I got your email, yes it was me!
I had no idea you had messaged me here, for some reason youtube turned off all notifications for comment reply's so I didn't know.
Had a look at the linked video and that looks better, especially the position control which might be better for lens control than moving a motor then needing to return the control to 0 to halt it in that position but the video only talks about using Pots for control and not using Rc PWM.
I want to use the Pots on my transmitter so I can use either continuous movement or position control as I would not be using Sticks.
I am very comfortable with wiring but coding is not something I have been able to absorb and my limit is being able to inspect code and sometimes duplicate existing parameters for more of the same, 95% of attempts to modify further than that results in broken code :(
How would I go about using the Accelstepper example but with RC pwm input instead of standard pots please?
If you're able to read signals from the remote control, you can map that to another variable that would directly drive the variable that is responsible for the movement of the stepper motor.
Hi ! I am working on a project and i have everything that i need for this exact setup but the stepper motor driver i use is an BT6600. Is this possible to use this setup or do i need to use a different driver?
Fundamentally this motor driver should work the same. You just need to confirm the pin assignments.
@@TheBoredRobotLLC thanks for the help !
@@TheBoredRobotLLC The system works effectively with my driver. I also noted that in your configuration, one microcontroller can be utilized for two drivers. Could you please clarify if the code differs alot in this setup? I have been trying to implement this but have encountered challenges.
hello my friend, how are you going to help me? I need a program like yours, but I'm going to use the Wotiom WD56 driver
That driver works pretty similarly to the one in the video. You'll just have to adjust wiring and make sure your DIP switches are in the correct configuration.
@@TheBoredRobotLLC Hello, everything is fine, the program worked, but how can I make it run faster?
@@maurodrone793 Make sure the DIP switches are set to full step mode. Then reduce the pulse length to as small as possible to increase the speed.
Hello! I'm new to microcontrollers and i was wondering if the CNC Shield used for the arduino can be powered by a LiPo battery instead of a power supply unit?
I think it should be fine. You should have something to let you know if the voltage drops too low on the battery. You also need to make sure the battery voltage is appropriate to run the motor controllers.
Please share the code
github.com/TheBoredRobot/RUclips-Code
Hi Im needing a setup like this for a project however I need the stepper to rotate to a certain angle then back again with a high/low rc switch. How much different would the code have to be to achieve this? Thanks
I don't think it would be too much different. The difference is that you'll need to keep track of the steps to get to a specific angle. I have another video that covers this: ruclips.net/video/QRCvC5xhJCw/видео.htmlsi=KyVg_lC3tNivcTqr
hi, my friend, i tried to use Radiolink controller and R1DS but still not working. what are your suggestion?
It's pretty hard to answer that without more information. My first step would to check the signal with the pulsein() command and see if you get anything.
Brilliant! Thanks! 👍😊
I'm glad you liked the video!
is this gonna work with different motor driver such as (CNC 2DM860H Digital Two Phase Stepper Motor Driver)??
Yes, this should work with these types of drivers, as long as you set up your pin assignments correctly.
ı am usinf fly sky FS-İ6x
can ı used ıt wıth the same circiut and code
Yes, this should work, if you have a receiver that uses the I-Bus protocol.
@@TheBoredRobotLLC ı don’t know about that but ı will take a look at it thanks 🙏
Thank you very much for this great video. i have it running now using nano and nema23 but for some reason the motor runs very slowly and stalls at like 1700 or 1100ms pwm. this nano works flawlessly with this motor and grbl fw/gcode but with your code the motor stalls. i don't know yet why. i am using a digital servo tester. might test with a receiver but before i take it out from my plane i want to understand what is going on.
Could you try using a library instead? A lot of times it's much cleaner than what I demonstrated in this particular video. Here's a more recent video I did on stepper motors:
ruclips.net/video/QRCvC5xhJCw/видео.html&lc=Ugxyodf6jKO0uOF9O6t4AaABAg
@@TheBoredRobotLLC Thank you. How hard would it be for you to fuse the RC PWM code with a single stepper using the AccelStepper library? I am a noob and learning as i go. i was searching the entire web back and forth for such a code to no avail. I am puzzled as for why this simple code is not in the accelstepper library examples - it should be. I am twaeking your RC code but no matter what my settings are, i managed to speed up the motor but not more than mapping PWM to 30:1 ration max and that is not even 1/4th the speed i am after. i learned that nano/uno can go up to like 4000 steps/sec but i am not getting close to that. my GRBL code running on this same nano runs the motor just great but i wish to try out PWM instead of GCODE. thank you so much for reading and answering my posts. much obliged.
@@ObserverChat My initial approach would be to take the example from the AccelStepper video and replace the variable from the potentiometer signal with the value you record from the RC receiver.
excellent video! How any steppers could you control this way? As many pins as the arduino has I suppose? Can this be used to control 3 - 5 steppers with level of speed control you have? If so, please teach us!! I'm desperate haha! I've been researching like crazy but this stuff takes time to really figure out. Many thanks, and keep up the fantastic work!
As soon as you go beyond 2 motors, you'll quickly run out of pins on the Uno. You'll have to use something like the Mega to get more pins. For 3-5 motors, that is certainly possible, but I haven't gotten a chance to test it out yet. I would most likely use a stepper library to make things easier.
@@TheBoredRobotLLC i have a similar issue where i need to control 3 steppers. Its a 1:6 scale forklift project. Could you make a tutorial for 3+ steppers please? 😅😅
Hi, is this working with elrs transmitters ?
I believe this protocol may be unique to this brand or transmitter/receiver. I haven't taken a look into other models though.
I started getting an interest in microcontrollers last year and pretty much stayed in the beginner kit area since then. 6 months ago I got the desire to build a rover type vehicle. Since I'm in the fabrication field designing and building the vehicle is fairly simple. I had no idea the complexity of using a microcontroller to control the motors. I could've simplified life by buying a driver that didn't require a microcontroller but what fun would that be? I feel like I've been studying for final exams for a couple months. Codes I've come across wouldn't work including github. Most drivers I've seen have En, Speed and Dir. Mine has Speed and Dir. I thought that was the problem but what you said in your last video could be why I'm not getting any feedback from my outputs. Every code I've seen puts the reciever signal pins to 10 and 11. Sounds like those should be pin 2 and 3. I'll move my pins and edit code to see. I think my code is a bigger issue but I may be able to check it today. I started my own from scratch but it's based off what I've learned from others and sounds like I've been in a blind leading blind scenario
I teach a course at a university where the students build a rover. Generally speaking, if this is you're first go at it, a brushed DC motor (direct drive or with a gearbox) might be easier start with. Stepper motors are generally used for applications where high precision and holding torque is needed.
@TheBoredRobotLLC I started off with hoverboard motors. I finally got a code to drive a motor fwd and back. All I had to do was build the steering for another motor but work started pouring in and Toys went on hold. Evidently during the on hold time I used the arduino for something else and I think I deleted that file. It doesn't bother me having a hard time figuring it out. What bothers me is I had a code that worked, deleted it and don't remember hw I did it. After a week I pulled out the hub motor and now using a wiper motor and wheelchair motor.
Yesterday I decided to stop trying to force learning programming, build the vehicle and in the meantime go back to start with the basic starter kit and work my way back up. Thanks for the videos they are helpful
@@TheOldKid I'm glad the videos are helpful. Good luck with you learning journey and your project.
Hi. Could you please do the same thing, but this time with an arduino? 😊
I am using an Arduino for this example. It happens to be a Nano, but it'll work the same on an Uno as well.
Do you have github?
github.com/TheBoredRobot/RUclips-Code
Also I use a motor driver bus, and don't have some of the pins, how would you modify that ?
@@TheBoredRobotLLC
That's a difficult question to answer without more information. What pins are missing? @@selimhandogan6693