Controlling a Stepper Motor with a Remote Control and Arduino

Поділитися
Вставка
  • Опубліковано 22 лип 2024
  • In this example, I demonstrate how to use Arduino and remote control to control the speed of a stepper motor.
    Check out this Reference Desk Mat for Arduino:
    amzn.to/3vO6QBl
    👉Subscribe for more robotics and engineering tips:
    / @theboredrobotllc
    Share this video with a friend:
    • Controlling a Stepper ...
    Website:
    www.theboredrobot.com/
    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
    Connect:
    Instagram - /theboredrobot
    Twitter - @theboredrobot
    Facebook - / theboredrobot
    Pinterest - /TheBoredRobot
    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.
  • Наука та технологія

КОМЕНТАРІ • 46

  • @oljobo
    @oljobo 8 місяців тому

    Brilliant! Thanks! 👍😊

  • @andrewjamez
    @andrewjamez 9 місяців тому

    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

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  9 місяців тому

      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: ua-cam.com/video/QRCvC5xhJCw/v-deo.htmlsi=KyVg_lC3tNivcTqr

  • @galizakeithd.2579
    @galizakeithd.2579 5 місяців тому

    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?

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  5 місяців тому

      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.

  • @ObserverChat
    @ObserverChat 10 місяців тому

    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.

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  10 місяців тому

      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:
      ua-cam.com/video/QRCvC5xhJCw/v-deo.html&lc=Ugxyodf6jKO0uOF9O6t4AaABAg

    • @ObserverChat
      @ObserverChat 9 місяців тому

      ​@@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.

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  9 місяців тому +1

      @@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.

  • @MohamadAlifDanial
    @MohamadAlifDanial 9 місяців тому

    is this gonna work with different motor driver such as (CNC 2DM860H Digital Two Phase Stepper Motor Driver)??

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  8 місяців тому

      Yes, this should work with these types of drivers, as long as you set up your pin assignments correctly.

  • @mujahidmdrosli883
    @mujahidmdrosli883 8 місяців тому

    hi, my friend, i tried to use Radiolink controller and R1DS but still not working. what are your suggestion?

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  8 місяців тому

      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.

  • @mariuschirita2017
    @mariuschirita2017 3 місяці тому

    Hi, is this working with elrs transmitters ?

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  2 місяці тому

      I believe this protocol may be unique to this brand or transmitter/receiver. I haven't taken a look into other models though.

  • @maurodrone793
    @maurodrone793 10 місяців тому +1

    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

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  10 місяців тому +1

      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.

    • @maurodrone793
      @maurodrone793 8 місяців тому

      @@TheBoredRobotLLC Hello, everything is fine, the program worked, but how can I make it run faster?

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  7 місяців тому

      @@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.

  • @steveg2277
    @steveg2277 Рік тому

    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!

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  Рік тому +1

      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.

    • @MultiGregor11
      @MultiGregor11 9 місяців тому +1

      ​​@@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? 😅😅

  • @stevefox3763
    @stevefox3763 2 місяці тому

    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!

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  Місяць тому

      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.
      ua-cam.com/video/QRCvC5xhJCw/v-deo.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.

    • @stevefox3763
      @stevefox3763 Місяць тому

      @@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?

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  Місяць тому

      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.

  • @Noake2612
    @Noake2612 3 місяці тому

    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?

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  3 місяці тому

      Fundamentally this motor driver should work the same. You just need to confirm the pin assignments.

    • @Noake2612
      @Noake2612 3 місяці тому

      @@TheBoredRobotLLC thanks for the help !

    • @Noake2612
      @Noake2612 3 місяці тому

      @@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.

  • @AChi__
    @AChi__ Рік тому

    Hi. Could you please do the same thing, but this time with an arduino? 😊

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  Рік тому

      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.

  • @TheOldKid
    @TheOldKid Рік тому

    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

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  Рік тому

      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.

    • @TheOldKid
      @TheOldKid Рік тому

      @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

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  Рік тому

      @@TheOldKid I'm glad the videos are helpful. Good luck with you learning journey and your project.

  • @asdfghjkl77357
    @asdfghjkl77357 2 місяці тому

    ı am usinf fly sky FS-İ6x
    can ı used ıt wıth the same circiut and code

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  2 місяці тому +1

      Yes, this should work, if you have a receiver that uses the I-Bus protocol.

    • @asdfghjkl77357
      @asdfghjkl77357 2 місяці тому

      @@TheBoredRobotLLC ı don’t know about that but ı will take a look at it thanks 🙏

  • @Chris-bk8mc
    @Chris-bk8mc 4 місяці тому +1

    Please share the code

  • @selimhandogan6693
    @selimhandogan6693 6 місяців тому

    Do you have github?

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  6 місяців тому

      github.com/TheBoredRobot/UA-cam-Code

    • @selimhandogan6693
      @selimhandogan6693 6 місяців тому

      Also I use a motor driver bus, and don't have some of the pins, how would you modify that ?
      @@TheBoredRobotLLC

    • @TheBoredRobotLLC
      @TheBoredRobotLLC  6 місяців тому

      That's a difficult question to answer without more information. What pins are missing? @@selimhandogan6693