Sichun Xu
Sichun Xu
  • 3
  • 56 144
Constant Angular Acceleration of a Stepper Motor with Arduino
This video shows how to achieve constant angular acceleration of a stepper motor with an Arduino, but the concepts can be applied to other microprocessors as well. I also show a quick way to implement acceleration if you don't need constant angular acceleration
Link to simple acceleration code:
github.com/sichunx10/Vulcan/tree/master/Preliminary%20Testing%20Code/ezacceleration
Link to constant acceleration code: github.com/sichunx10/Vulcan/tree/master/Preliminary%20Testing%20Code/constantAccelerationStepper3
0:00 Introduction
1:07 Simple Acceleration - Theory
6:49 Simple Acceleration - Code
9:47 Simple Acceleration - Testing
11:51 Constant Acceleration - Theory
18:59 Constant Acceleration - Code
24:48 Constant Acceleration - Testing
Переглядів: 16 250

Відео

Robotic Arm Motor SelectionRobotic Arm Motor Selection
Robotic Arm Motor Selection
Переглядів 39 тис.3 роки тому
In this video, I explore the different types of motors that could be used in the robotic arm project, and explain the advantages and disadvantages of each one. Below are some great videos that I've watched in the past on some topics covered in this video Learn how a DC motor works: ua-cam.com/video/onjFFoOC_yk/v-deo.html Learn how a servo motor works: ua-cam.com/video/LXURLvga8bQ/v-deo.html Lea...
IntroductionIntroduction
Introduction
Переглядів 5263 роки тому
A very brief introduction on what this channel will be about and what to expect in future videos.

КОМЕНТАРІ

  • @elicoelhomedeiros4813
    @elicoelhomedeiros4813 День тому

    Please make more vides like that

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

    use AccelStepper Library, more simple with max speed and acceleration variables!!

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

    Sir, your only 3 videos were the best. Will you please come back to UA-cam. I don't think you understand the clarity and distinct method you use to explain your works. Your style is unmatched and we will miss out on your knowledge if you don't donate it to us. Please come back 😢

  • @user-ub5qd3eo1d
    @user-ub5qd3eo1d Місяць тому

    It sounds like you’ve done a thorough comparison of different actuators for your robotic arm project. Here’s a brief summary of what you covered: 1. **DC Motors**: - **Pros**: Simple, low cost. - **Cons**: Difficult to control speed and acceleration accurately. Not precise enough for high-precision applications. 2. **Servo Motors**: - **Pros**: Includes a position feedback mechanism, decent torque. - **Cons**: Limited rotation range (typically 180 degrees), precision can be lacking, and not ideal for applications requiring more than 180 degrees of rotation. 3. **Stepper Motors**: - **Pros**: High precision with defined steps, better control over position and acceleration. - **Cons**: Lower torque compared to servo motors, requires additional components like drivers and possibly sensors for homing. For your robotic arm, you decided on **stepper motors**, specifically the NEMA 17, due to their precision and control capabilities, despite the need for additional components and lower torque. The plan to use a gearbox to increase torque is a good approach to address the torque limitation. You also mentioned future improvements, such as implementing smooth acceleration and deceleration to make the arm's movements less abrupt and more fluid. That’s a great next step to enhance the overall performance of the robotic arm.

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

    Great explination. Thank you Sir

  • @i-make-robots
    @i-make-robots 4 місяці тому

    I strongly recommend designing from the wrist to the shoulder, one step at a time. You'll never unexpectedly run out of torque.

  • @KW-ei3pi
    @KW-ei3pi 4 місяці тому

    Thank you for posting the files. I'm trying to utilize ConstantAcceleratioStepper2 and I need a bit of help. Are you available to answer a couple of questions? Thanks very much. Regards

  • @knucklehead83
    @knucklehead83 4 місяці тому

    Couldn't you do something like: for (stepperDelay = 3000; stepperDelay >= 700; stepperDelay = stepperDelay*.99) and achieve similar results? I mean, unless I am not understanding something, I was lost on the explanation of angular and linear acceleration, it seems as what you are looking for is acceleration that is proportional so that the speed ramps up in a straight line instead of curving.

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

    HOW DO YOU MAINTAIN A REQUIRED SMOOTHNESS OF COORDINATED MOTION AMONG STEPPERS?

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

    Subscribed 😉👍 👏👏👏

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

    Big show 😉👏👏👏 great video !

  • @user-oh4zl7ml3i
    @user-oh4zl7ml3i 7 місяців тому

    it's a pity that you stopped posting new video, it would be awesome to see the finall roboproject.

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

    Fantastic Video and explanation, but I wonder what the formula would be for the number of steps for deaccelerating to stop using the linear algorithm. Thank you!

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

    😮❤

  • @woodyouloveit-fe1sw
    @woodyouloveit-fe1sw 8 місяців тому

    Can it be possible follow with Stepper motor ua-cam.com/video/K7FQSS_iAw0/v-deo.htmlsi=arbj93d4FtY-aq5e

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

    could you please provide more info about the nema 17 motor , is there a link i can read more about it , thank you

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

    Have you considered BLDC motors? HDD uses this type of motor to spin the disk with high precision.

  • @SoCalFreelance
    @SoCalFreelance 11 місяців тому

    The servo motor can be hacked to provide 360 rotation. If you take it apart you will notice little notches which mechanically limit rotation. Use a Dremel to grind down the limiters and bam! 360 rotation. 👌 You will learn these things over time.

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

      Yes, that is true. Also, there are some servos that are "continous" - where the 'endstop' is removed from factory. I have those in my current robot arm. Trying to build a new robot from scratch, using stepper motors + drivers sets me to around $200/stepper motor * 6 = $1200. But those are 24 volt stepper motors with drivers. Not big enough to compete with robots from Fanuc, ABB, KUKA and so on, also the size of the stepper motor/quality is less then say a Beckhoff brand (as an example). Also, you can have a stepper motor with an encoder to find postion.

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

    awesome video, i really enjoyed it!

  • @KW-ei3pi
    @KW-ei3pi Рік тому

    Thank you. This will be a valuable asset in coding for Stepper Motors, as in some cases, the motor won't start at high speeds without problems. Thanks

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

    wow amazing video you gave me so much insight about servo and strepper motors

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

    For driving stepper motors, I would highly recommend TMC drivers like TMC2209. These drivers can run the motors silently, have sensor-less homing feature and can run much higher current through them.

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

    I agrey with BlakeRobrt

  • @user-hn4tg2su4d
    @user-hn4tg2su4d Рік тому

    Do you know the name of an integrated circuit that gradually increases the frequency, which means acceleration?

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

    For me, this is a very valuable video because it shows me how to code part of my project that I know quite a bit about but didn't know how to even begin to implement the up/down ramps. Actually, I think I can package his code into my support code verbatim. This is an excellent presentation with really clean and consice code. This engineer really knows his trade! You, Sir, will be saving me many hours of grief and constipation. Thank you so very, very much...... FWIW: 45+ yrs ago, I was the senior electronics design engineer in a small company that was developing a product that relied heavily on the performance of a stepping motor to slew and position a print head on a highly advanced dot matrix printer. Too often in testing, the stepper would 'lose sync' when starting or changing direction. It could lose one or two steps or totally lose it and chatter/vibrate like the dickens. A few lost steps resulted in fuzy characters being printed. The software weenies blamed my Z80 hardware design, but my cohort in crime explained to me what was happening and educated me on the need to 'ramp' stepper motors. Charley had Been-There-Done-That years before in a previous job. Along with becoming a lifelong personal friend, Charley was a very good and experienced engineer with many talents. When I diplomatically explained the situation to the software iguneers, they balked, told me to mind my own business, and complained to the owner that I was interfering with their work. The boss called me in and said I needed to leave the 'kids' alone. Later, the 'kids' convinced the boss that they were working with bad motors and an inferior Z80 hardware design that was losing interrupts, which of course was my fault. He asked the manufacturer/supplier to come up and help identify our hardware problems. The supplier evaluated our hardware design and motor control microcode and said nothing was wrong with the hardware but that the microcode was really lacking and really bad. As they briefed a bunch of us on their findings, a small smile creeped across my face, but our boss never looked at me. I think he was embarrassed. Four weeks later, we had a new software team leader, 2 of the original 4 'kids' were laid off, and I was appointed as project engineer with oversight over the entire project. BTW : I think those 2 kids should have been fired. The other two were good guys who knew their stuff, and one of them picked up where the two losers left off and fixed the code to perfection. Anyways, as the almighty stepper motor god in the back room sais, 'Don't ever forget your ramps, your job may depend on it'.......

  • @user-lh8iq8kv6q
    @user-lh8iq8kv6q Рік тому

    thnx a lot that's helped me

  • @Aaron-hs4gj
    @Aaron-hs4gj Рік тому

    Thanks

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

    please can you explain to me why there is no delay after digitalWrite(stepPin, LOW)?

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

    Timestamp(Num_Step)=(sqrt(2)*(ALPHA/STEP_MODE))/ACCELERATION*(sqrt(Num_Step+1)-sqrt(Num_Step)) Calcul de l'intégrale sous la droite de vitesse en considérant une accélération constante ACCELERATION in step/s/s ALPHA = unit/s^-1 = 1000000 (for µs) STEP_MODE = number of precision steps / real step = 1 by default (maybe 1/2/8/16/...) Note : ((sqrt(2)*(ALPHA/STEP_MODE))/ACCELERATION) is a fixed value and could be calculated one time per stepper acceleration to freed up some CPU time

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

    keep up the amazing work dude very informative

  • @jbjb303
    @jbjb303 2 роки тому

    Time is always an issue when working on software with precision movements and add work also. Where does your life go with so little time? Your videos are A+ rating

  • @NekoNihongo
    @NekoNihongo 2 роки тому

    good video

  • @goesintite
    @goesintite 2 роки тому

    Thank you. I'm going to look around your channel to see if you added interrupts for my motors

  • @SchwanaCARDHUT
    @SchwanaCARDHUT 2 роки тому

    Bravo 👏 👏 merci

  • @gios.5816
    @gios.5816 2 роки тому

    Thoughts on using brushless DC motors? It seems like the benefits would be greater but cost would increase so Def not used for many diy robots.

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

      They are used with gearboxes for getting high torque and a rotary encoder for feedback. This makes them servo motors and are the most common ones used in industry due to their high speed and high precision. Though, the cost is high therefore, stepper motors are the most cost-effective solution here.

  • @shoppingoneclick2044
    @shoppingoneclick2044 2 роки тому

    Nice thought But I am bit confuse about your for loop. You are decreasing pulse width/delay and giving it to motor. So acceleration you are giving to one micro step of motor. Or Acceleration to one complete rotation of motor ?

  • @user-li8lq6cu4g
    @user-li8lq6cu4g 2 роки тому

    Im actually making a robot arm for a school project! THX for your video!

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

      @ Jiang Chengen Great! what is your robot arm?

  • @ayanvaidya2727
    @ayanvaidya2727 2 роки тому

    That big DC motor with extra wires Those wires are for encoder it's very accurate if you know how to use them

  • @Disparus
    @Disparus 2 роки тому

    in your for loop, instead of incrementing delay, if you increment the frequency then calculate the corresponding delay, the acceleration will be linear, right?

  • @ralphrego7470
    @ralphrego7470 2 роки тому

    Hi Sichun Xu, I love your presentation. I would like to know if I can stop the stepper motor in one spot indefinitely , then when I switch off my machine the stepper motor reverses to original position

  • @324amit77
    @324amit77 2 роки тому

    great stuff ! I would love to see more about the arm project.

  • @jimmcmoy4624
    @jimmcmoy4624 2 роки тому

    You NEVER want to disconnect the ground. You always disconnect the +

    • @MarcelRobitaille
      @MarcelRobitaille 2 роки тому

      What is the context for this? That is false without a specific context. If you look up low side switching, you can see that many applications disconnect the ground.

    • @ugetridofit
      @ugetridofit 2 роки тому

      @@MarcelRobitaille The context is that when you have other things like serial cables and what not connected to other equipment, disconnecting the GND is a bad thing to do. It will cause other connected things voltages to spike or float at wrong levels.

  • @imwhatim7259
    @imwhatim7259 2 роки тому

    Dude almost 1 year completed where is your robotic arm

  • @BlakeRobert
    @BlakeRobert 2 роки тому

    I saw you only have 3 videos. Really interesting I wish you would keep making them!!!!

  • @nuke_bird
    @nuke_bird 2 роки тому

    Not sure about 180, most likely potentiometers can rotate 270 degrees

    • @CycloidalHeadache
      @CycloidalHeadache 2 роки тому

      Sg90s go 180 degrees due to a physical stop on one of the gears I think. In reality they don’t even go quite that far, probably more like 170 degrees lol it’s really annoying

    • @nuke_bird
      @nuke_bird 2 роки тому

      @@CycloidalHeadache yeah, true. I looked up specs, its 180. And yep, it usually less than that

  • @mahadevas8738
    @mahadevas8738 2 роки тому

    great explanation

  • @edumini
    @edumini 2 роки тому

    Great video 👍

  • @williamhuang5329
    @williamhuang5329 2 роки тому

    Hanzhen harmonic drive gear , over 30 years experience , robot gear , joint gear reducer

  • @STRATOS13PAO
    @STRATOS13PAO 3 роки тому

    very interesting, i typed your code and tried it for myself, i couldnt find the link to the github, i guess to make drive a robot arm you will update the code so that you can drive from a possition to an other while accelerating and keeping a stady max speed and deselerating before you reash the end possition. Is this about right or you have something else in mind? I'm also in the prosses of building a robot arm, i would love to see more videos from you.

    • @sichun100
      @sichun100 3 роки тому

      Yeah progress has been a little slow, hopefully I will be working on it a bit more soon. Your description is correct, that's how I plan to drive it. I'll add the link for the github right now

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

      this is called (s curve motion ) and using TMCStepper library is better with TMC drivers because they have the ability to do so in the code beside holding stepper position at the movement end

  • @greedybaku
    @greedybaku 3 роки тому

    How far are you in the project?

    • @sichun100
      @sichun100 3 роки тому

      Progress has been a little slow because of school, I have the electronics and mechanical design done, software development has been holding everything up. I still plan to finish it

    • @greedybaku
      @greedybaku 3 роки тому

      @@sichun100 what are you using for mc?

    • @sichun100
      @sichun100 3 роки тому

      have been using arduino, but I think I might port everything to a Raspberry Pi

    • @CycloidalHeadache
      @CycloidalHeadache 2 роки тому

      @@sichun100 it’s tough to control everything on an arduino, and your processing power is so limited. Have you considered Esp32? An Esp32 devkit board is around 3 dollars, cheaper than both arduino and pi, and has Bluetooth, Wi-Fi, and some other wireless capabilities built in. It can be used with arduino IDE with some simple downloads, and has I think quite a bit more processing power if I’m not mistaken.