Coordinated stepper motor control (arduino)

Поделиться
HTML-код
  • Опубликовано: 24 июл 2024
  • Addendum, regarding that question at the end: • stepperControlAddendum...
    Atmel doc: ww1.microchip.com/downloads/en...
    Sketches: www.iforce2d.net/sketches
  • РазвлеченияРазвлечения

Комментарии • 563

  • @alizghoster
    @alizghoster Год назад +6

    most insane video ever! I tried to understand it when I was 18, 4 years ago, but I failed. So I came back today, and I have to say that you did an excellent job.

  • @MaximilianBeck
    @MaximilianBeck 6 лет назад +6

    Almost every time I'm working on an electronics related project I find a video of you covering exactly what I was looking for! :D

  • @msimila
    @msimila 6 лет назад +7

    One of the best videos I've seen in a long time! Well narrated, interesting subject, examples well presented and explained. Really, really good job!

  • @randunik77
    @randunik77 6 лет назад +55

    I'm so glad that youtube suggested this video to me. Very nice, super interesting and well explained (from my point of view). Thank you. And finally I saw an real life application of a series and of a series sum (because on my math classes they teach me a lot of these series, but I never understood why should I know about them and what they are good foor). Very good video. Definitely I'll what your other videos ;)

  • @johannesbrahms2718
    @johannesbrahms2718 Месяц назад +1

    You are like a magician! I had incredibly hard time with these steppers! Thank you!

  • @rthally94
    @rthally94 6 лет назад +30

    Fantastic work! It's rare to see anyone create an alternative to the Accelstepper library, which does multiple steppers with either acceleration or coordination, but not both. I'd be very interested to see this migrate to a separate library.

  • @mikebiermans4273
    @mikebiermans4273 6 лет назад +4

    Thank you for this video, I have learned allot from it, as I do from most of your videos. Tyvm for making these videos. Grtz Mike

  • @jenskapmeyer2579
    @jenskapmeyer2579 6 лет назад +3

    Thanks a lot. I learned much, always wondered how to program interrupts with Arduino. Nicely structured lesson. Assigning this video as "Entertainment" is pure understatement, engineering would be appropriate ...

  • @YoutubeAdministrator
    @YoutubeAdministrator 6 лет назад

    Thank you for sharing this, i like the indepth explanations and real use case examples provided. seems like many skips these steps when introducing arduino programming.

  • @adrianrawlings2470
    @adrianrawlings2470 3 года назад +1

    Hallaluha, someone actually showing and explaining in detail. I'll certainly be watching this again.

  • @MrSantiagoDELO
    @MrSantiagoDELO 3 года назад +1

    great video! I'm just now developing a cable robot for a uni project and I've looked at your sketches and the Atmel doc, and I've managed to add my take on this, in short, I'm giving a fixed time target for all motors to complete their task (just a constant acceleration between two positions). With that, you can set a base start delay and acceleration proportional to the Steps/Time request.

  • @franztrinidad3454
    @franztrinidad3454 4 года назад +55

    I think this is my 5th time watching this video. every watch, It's making more sense for me! Im new to arduino and steppers btw 😅

    • @MattMcConaha
      @MattMcConaha 3 года назад +3

      I'm riding that same boat right now

  • @ZeedijkMike
    @ZeedijkMike 6 лет назад

    I just love the sound of stepper motors "singing" together.
    Nice video - and no yawning from me at all.
    Small tip though: When I have a lot of setup stuff, I put it in a separate .h (header file) fx. pinSetup.h for all your pin assignments. This keeps the "tedious" or "non chsnging" stuff separate and your main program easier to maintain.

  • @web1bastler
    @web1bastler 6 лет назад +5

    That's awesome! Btw. the most important use case of coordinated motors is on robotic arms. Since CNC machines often have to move axis-by-axis except for interpolated movements like you showed with the diagonal path. I love coordinated motors!

  • @maciejmajewski4033
    @maciejmajewski4033 2 года назад +2

    Thanks for the video, answering your question(if it is still valid), the series sum can be calculated from the following formula
    float calcAccelDuration = step_delay * sqrt( (float)accel_lim + 1) ;
    variable names from the ATmel document. Greetings from Poland.

  • @jims408
    @jims408 6 лет назад

    Many thanks for a very instructive and practical video... you have a real knack for explaining things well.

  • @DNSXH1
    @DNSXH1 6 лет назад +1

    I want to thank you for your channel, you explain in a very detailed and patient way all the points for each project, besides, your english is very good, i mean, i'm not a native english speaker, so i have problems with some youtubers when they talk fast in technical language that i'm not familiarized with it at all. Thank you and greetins from Chile.

    • @iforce2d
      @iforce2d  6 лет назад +1

      Thanks for the kind feedback :)

  • @stefanoalfredolaspina8471
    @stefanoalfredolaspina8471 Год назад

    well done. really dense of concepts and best explained. Thank you. Instead of using already prepped libraries, gone under the hood and see how it's actually working. recommended for everyone who wants to understand more

  • @pd.dataframe2833
    @pd.dataframe2833 3 года назад

    This is super super useful man. Thanks a lot for sharing. Use of Taylor series for simplifying acceleration is the most important part to get this running smoothly on arduino.

  • @exnihilo415
    @exnihilo415 Год назад +2

    Just in case this helps out any other rookie programmers here, I finally figured out why the final sketch wasn't working when more than 8 motors were added in the same manner in the code. It's because the left and right bitshift operators (>) would break the byte type for remainingSteppersFlag and nextStepperFlag. Just find "byte" and replace with "word" in the sketch and all is well. All you experts can tell me how obvious this was but it took me all day. I was sure something in the interrupts or timing needed to be adjusted given the extra overhead, but no. Live and learn!

  • @philbx1
    @philbx1 6 лет назад

    Very nicely explained. Thanks much for the obviously great amount of time you put in!
    Off topic a bit, I'm trying to create an RC LED controller for a mate but ran into trouble using a Digispark module to get the PWM value from the RX.
    Way too random using the CHANGE interrupt, so now moving to a Nano so at least I can debug using serial.
    Looks like using registers may be best way to go.

  • @conraddiaz2274
    @conraddiaz2274 5 лет назад +40

    AWESOME demonstration and tutorial! Exactly what I was looking for. Although I've loved DIY-type stuff for over 30 years, professionally, I'm an automated product and system design engineer (and design engineering instructor). I have tons of invention ideas that I want to bring to life, and some of those involve motion control. You've taken a professional approach to achieve the kind of motion control (and experience) you were after, combining several skills, and sharing your journey with us. THANK YOU SO MUCH! Also, you cracked me up when you asked if you just heard one of us yawn!!! That was actually the part where I was excitedly thinking "this is EXACTLY what I was looking for, and this guy thinks and explains things they way I do". Far from yawning!! Ha ha! Thank you again, and we'll be in touch!

    • @jmarkhan9235
      @jmarkhan9235 3 года назад +1

      I want to control 4 stepper motors in a sequence 1,2,3,4 , with 0 to 180 degrees of movement like half circle with reverse and forward motion. Please help me out.

    • @vincentpernicano3277
      @vincentpernicano3277 2 года назад +2

      Yeah that was a great tutorial im picking up everything that guy just put down and I feel confident I can complete my project now!

  • @Siamect
    @Siamect 6 лет назад +64

    Actually linear acceleration is not always what you want... I made a position controller in the late 80-ies and we had problems when we used it for portal conveyors. The structure was shaking. The reason is that linear acc - constant speed - linear deceleration contains a lot of higher harmonics. Ideally you should try to move things in a way that does not have any higher frequency components. Sine-square acceleration does this and I used a table to calculate this. I also had dedicated hardware to generate the pulses... The portal conveyors were not shaking any more but we could notice that the structure bent very slightly during the acceleration and deceleration. It was amazing...

    • @JyrkiKoivisto
      @JyrkiKoivisto 6 лет назад +8

      For starters I think it's good idea to start with linear acceleration/deceleration. Other acceleration profiles can be added at a later time if coded such.
      Jerk controlled acceleration I think is the most desired (control the acceleration of acceleration to produce velocity profile and over time it gives the position)
      There's couple of mainstream ways to implement that. Make the Jerk to Jerk or Jerk the Jerk with sinusoidal profile.
      Jerk is just the acceleration of acceleration. Or how fast the acceleration changes.

    • @Siamect
      @Siamect 6 лет назад +4

      Sure you have to start with what is usable and simple to implement.
      I think the smoothieware is using jerk and maybe the TinyG/G2 and gbrl too...

    • @wrobel7
      @wrobel7 6 лет назад

      Siamect interesting insight. Do you have any DIY blog/vlog? Would be nice to learn from someone more experienced 😀

    • @Siamect
      @Siamect 6 лет назад +1

      No real blog, I have posted some clips of flying fpv on youtube lately and I have my website siamect.com and if you look at the upper part of it there are a few links to technical stuff but it is really old and corky...

  • @lazymouse636
    @lazymouse636 6 лет назад +6

    I didn't yawn very interesting, thx for sharing!
    When ramp up delay is calculated with d=d-(2*d)/(4*nr+1) then ramp down is d=d+(2*d)/(4*nr-1) where nr is the step number in ramping up or down (nothing to do with total steps made). Increment nr when ramping up and decrement it when ramping down. nr doesn't change when at constant speed. At constant speed only n changes.

  • @1_HighDuke
    @1_HighDuke 6 лет назад +2

    Very interesting exercise. Thanks for taking the time to explain it like you did.

  • @patrickjdarrow
    @patrickjdarrow 6 лет назад

    Insanely insightful video. Huge help for me as a student.

  • @jonaspeter4030
    @jonaspeter4030 2 года назад +1

    Exactly what I was looking after! Thanks a lot! You did a great job!

  • @letrung9199
    @letrung9199 2 года назад

    Thank you so much. I’m looking for this video in quite a long time. This is super valuable for me!

  • @TheRealStructurer
    @TheRealStructurer 3 года назад

    Considering to build my own camera slider and this will help a lot 👍🏼 Thanks for sharing to such a detailed level. Got yourself a new subscriber

  • @anol4590
    @anol4590 3 года назад

    This is exactly what I needed, thank you so much for sharing with us!

  • @johnlocke9609
    @johnlocke9609 2 года назад +1

    I'm using your simpleAccel for a 3 motor polisher, with 3 motors of 2HP, they move with the help of linear rails and servos back and forward to polish metal, is really really cool your video.

  • @anthonyj777
    @anthonyj777 6 лет назад

    I was glued the whole time. Great video.

  • @automateanything
    @automateanything 5 лет назад

    i watched this late at night after whisky- and fell asleep! first thing in the morning i put it on and watched it twice. however your video is done superbly- and a great explanation of what is required. my math skills need polishing obviously -but in my defence im old and school was along time ago! i wanted this sort of code to make a table saw stop measuring scale- its perfect for my needs!

  • @monfalcon3596
    @monfalcon3596 Месяц назад

    I have learned my stepper motor control in this site long time ago. This is an excellent tutorial!! I hope you update the driver with a new one

  • @Xraller
    @Xraller 6 лет назад

    Great video! I've been wanting to know just these things for a while. Thanks!

  • @profBricks
    @profBricks Год назад

    I enjoyed the video a lot, quite followed it until the end, and I'm going to merge your last idea into the existing multistepper library

  • @loukask.9111
    @loukask.9111 6 лет назад +4

    u deserve like 10 times more subs, this is insane.

  • @k34561
    @k34561 6 лет назад +2

    I enjoyed your video and didn't yawn.
    The standard for coordinated stepper motors is Bresenham's line algorithm. Most famous in graphics. But it was originally developed by Jack Bresenham in 1962 to coordinate the motors for line drawing on a Calcomp plotter. It is the algorithm used in the open source GRBL CNC code. Bresenham's is all integer in the main loop, so very fast. I'm not sure what GRBL does for acceleration. They managed to cram it all into an Arduino Uno with just 2K of RAM. They just went to the Mega in the last year.
    I'm working on making a CNC glass cutter. The glass cutting head needs to be parallel to the direction of travel. So I'm going to use a fourth stepper motor coordinated with the with the original three. Before I dive down into the rabbit hole of GRBL and Bresenham's it is interesting to see what other people have done.
    Thanks,
    Kurt

  • @numenrider
    @numenrider 5 лет назад

    Thanks a lot because of you i can understand how to assign a function including 3 stepper motors, which will work cordinately😍😍😍

  • @PiefacePete46
    @PiefacePete46 4 года назад

    Chris, I watched this when you first posted it in 2017. I have watched it a couple of times since, and I just watched it again! (End to end every time.) It is way beyond my abilty to comprehend in detail, but it was never boring. :o) Thanks again.

    • @iforce2d
      @iforce2d  4 года назад +1

      Have you seen a doctor about this odd behavior :)

    • @PiefacePete46
      @PiefacePete46 4 года назад

      @@iforce2d : Yep... he told me to "Keep using the pills and potions"! (And watch more RUclips) :o)

  • @yurigagarin1987
    @yurigagarin1987 3 года назад +2

    Excellent topic. You have a mastery of coding the program. I need to watch this video 10x to see the total picture. Your programming jump start a newbie like me to a higher level. Your programming is a nice template to master this Arduino, stepper motor & controller in one place. Maybe you teach us to handle another beast called Picollo F28004s LaunchPad of Texas instrument. Thank you very much for sharing your intelligence.

  • @insanet3
    @insanet3 Год назад

    its year 2022 and found this video very useful. im impressed the cheap A4988 could move that smooth with that algorithm, i though only the more expensive drivers with proper sinewave output like TMC2009 and similar could move like that.

  • @yucemantar
    @yucemantar 6 лет назад

    ADAMSIN KARDEŞ

  • @davidburt9238
    @davidburt9238 3 года назад

    As a simulation, you could write a sequence for your six steppers to proceed as an odometer stepping out (tenths , units , 10's ,100s, 1000s, 10000) ! Just a thought. Enjoyed your presentation,.... keep-em coming !

  • @k2_robotics
    @k2_robotics 6 лет назад

    Great explanation, very helpfull for me, as usual. Thank's for the video!

  • @helixalgorithm3160
    @helixalgorithm3160 6 лет назад

    Cool insight to servo controls. I believe you could use a Gaussian distribution for smooth a/de-cceleration

  • @KW-ei3pi
    @KW-ei3pi 3 месяца назад

    Thank you SO much for your help in my previous comment. Very kind of you to take the time. I'm going to try and implement your acceleration code, but replace the "highspeed" (at 9:18 in the video) with an AnalogRead of a Potentiometer. I think this will accelerate the Stepper Motor to a maximum speed that I have set on the Potentiometer. Thanks again. Regards.

  • @blankphoto
    @blankphoto 6 лет назад

    It is cool :) Decided I'm going to use a stepper motor for a pet feeder build I'm doing, thanks to your video.

  • @user-wb9hc2zh9p
    @user-wb9hc2zh9p Год назад

    Thank you very much sir, you have the best video on youtube to explain this topic

  • @Bechill3d
    @Bechill3d 5 лет назад +1

    Thanks a lot ! Very well explained, exactly what i was looking for :)

  • @doanlinhvo1783
    @doanlinhvo1783 3 года назад +1

    great explaination! easy to understand. Just want to say thank you so much! :)

  • @fonecelautorizadatim882
    @fonecelautorizadatim882 5 лет назад +4

    Ótimo trabalho homem. Obrigado por compartilhar esse conhecimento poderoso.

  • @barrinfin
    @barrinfin 3 года назад

    Thank you, great video, it explains so much and easy to follow

  • @brhayanliberatotafur4786
    @brhayanliberatotafur4786 5 лет назад +4

    Hi iforce2d, congratulations! is a excellent video, it is explained very well how move stepper motors, i want to comment that present problems with the configuration of the ports (#define STEP_HIGH PORTD | = 0b00001000; #define STEP_LOW PORTD & = ~ 0b00001000; ) and i solve it only by assigning the pins the high and low as is normally done, (digitalWrite (STEP_PIN, HIGH); digitalWrite (STEP_PIN, LOW); ) and in this way the code worked correctly. Greetings from Colombia.

  • @PiefacePete46
    @PiefacePete46 6 лет назад +4

    Great video thanks. This is a topic that gets too little coverage... I think it is in most peoples "too hard" basket. It is certainly at a level above my comfort zone, but I could follow the process in general terms thanks to your presentation approach. Cheers.

    • @iforce2d
      @iforce2d  6 лет назад +1

      It went in and out of my "too hard" basket a couple of times during this process actually. Those interrupt routines can be tricky things to manage sometimes.

  • @abting4546
    @abting4546 6 лет назад +2

    Thank you so much for your video and clear explanation. i learned so much :)

  • @RcCarFan01
    @RcCarFan01 6 лет назад

    Very interesting, once i have tried to speed up a stepper motor as fast as possible. My frequenz methode has reached 4092 rpm's with a stepper motor 200Steps/turn. (Video on Channel) Very good explaination and you haven't got me lost until the formula out of the datasheet/pdf.
    Great Video!!
    P.S.: I have already worked with Timer Interrups ^^

  • @jakhongiralimov7481
    @jakhongiralimov7481 3 года назад

    wow. thats what i needed - using steppers in timer interrupts

  • @SirRobinII
    @SirRobinII 3 года назад +1

    Thanks for the guide! Im using micros() in a loop instead of ISR. Those equations for acc/dec work really well, I haven't tested my code for running multiple steppers at once.
    update: seems like there's no way to do coordinated movements without interrupts, multiplying by the speedscale breaks the fluent motion.

  • @danielmirandacruz7164
    @danielmirandacruz7164 4 года назад +1

    Hello!
    This is a great work! Explained with simple working examples. I would like to know if you can no only stop the motor while running, as you showed, but also change the speed anda acceleration to use it in a PID control loop with position measurements by rotary encoders. I tried other libraries but I could not manage to get it working. The interrupts of the encoders counters are blocking the steps/rev action send to the motor and the behavior of the motor is different when the encoders are added.
    Can you help me with this problem?

  • @RSC2194
    @RSC2194 5 лет назад

    Hi, awesome tutorial! I have a question, the simple acceleration at 11:40 sounds like a S curve velocity profile (which is better than trapezoidal) even the curve is similarly, in practice this is not better than trapezoidal profile? another question, in the linear acceleration at 29:40, the curve is not a perfect trapezoid, this is due to aproximation? regards

  • @frab88
    @frab88 6 лет назад +2

    Thanks for this video, I'm really passionate about this stuff. However I'm having some problem using some of your example sketches with my motor drivers (TB67S109AFTG) and a pro-mini-16MHz. In particular, in sketch4_linearSpeedInterupt I think that the step pulses are a little too short (T_ON=125ms in my case). Most stepper drivers are rated for pulse freq less than 100KHz (T_ON > 300ns for my drivers)

  • @amilcarmalave4115
    @amilcarmalave4115 2 года назад

    this video deserves millions of likes

  • @ceptimus
    @ceptimus 6 лет назад

    I wanted something similar to control the four (mecanum) wheels of a robot simultaneously. The robot gets its signals via an r/c link so the Arduino has to decode the channels, do some maths to decide how fast and in which direction each wheel should be turning and then drive the four stepper motor wheels. I figured the Atmel 328 didn't really have enough power to do the job, so I used an Arduino Due. The Due processor has lots of independent 16-bit timers that can each trigger a separate interrupt routine so it made the job easier. I suppose I ought to blog or RUclips it - I intend to, but I have too many other projects on the go right now...

  • @vishalramadoss668
    @vishalramadoss668 3 года назад

    Fantastic work and documentation

  • @andrewmack4830
    @andrewmack4830 4 месяца назад

    Very clever, and well explained. Thank you

  • @lokeshsilwal5732
    @lokeshsilwal5732 6 лет назад

    Thank you for this video, it was really helpful, but I do wanted to know how much power are you supplying to the system with multiple servo motors?

  • @mastermoarman
    @mastermoarman 4 года назад

    thank you for making this video. i am taking a class that we use arduino and i want to do basically every thing you put in this video lol. looks like i have more learning to do. i wish you went more in detailed on the video.

  • @Adamcz95
    @Adamcz95 6 лет назад

    Ah, I wish I saw this video when I was making my bachelors thesis (DIY camera slider). Very nice.

    • @VinceSamios
      @VinceSamios 4 года назад

      Hey, I'd love a link to this thesis

  • @antoniopedrajasantiago8415
    @antoniopedrajasantiago8415 5 лет назад

    how you conected the motor, Black 1A, Red 1B, Green 2A,, Blue 2B, ? In the modular stepper yurbot. Thanks and congratulations!!!

  • @yepitsodex
    @yepitsodex 6 лет назад

    Great video! Thanks for posting
    I've never been able to get steppers to work without a delay between driving step pin high and driving it low, if i do those commands back to back its just a big fail, as if the driver cant detect the falling edge. In fact I cant get your code to work without some delay before sending that falling edge - maybe differences in drivers, or some emf phenomenon (though its odd I've used various driver boards over the years).

  • @Teach_EM
    @Teach_EM 2 года назад

    Thank you for this tutorial. It has been very helpful

  • @dulithchinthaka7129
    @dulithchinthaka7129 3 года назад

    Really appreciate your explanation ❤️

  • @isidoromaich7226
    @isidoromaich7226 6 лет назад +1

    Is cool because I recently was watching a lot of videos about running several motors at the same time with arduino, and the ones I saw nobody was caring about sincronization.
    Hmmm it's seems to me that interesting projects are coming, I promise not yawning and watch every video complete in one pass.

  • @vkoutsovoulos9425
    @vkoutsovoulos9425 6 лет назад

    Great approach ! Thanks for sharing

  • @DoRC
    @DoRC 6 лет назад

    I think you might get some smoother operation when running slowly by putting the delay between the high and low as well as at the end of the loop. The way it is means it takes 2 steps delays takes 2 steps etc... Maybe it wouldnt make a noticeable difference though.

  • @mkmyuu
    @mkmyuu 2 года назад

    I am currently working on a scenario with three equally angled motors, where one of them needs to be scaled vertically by sqrt(3) to achieve a perfect XY movement. I've been trying to incorporate your fantastic work to help me get going with accel/decel, but I do not get accurate positioning. It is off by an ever so slight margin. Do you have any clues what I could look at? Any help is appreciated! Cheers and thanks for the great content!

  • @prodipkumarmandal1413
    @prodipkumarmandal1413 6 лет назад

    Very nice teaching sir....Lovely. Become Fan of yours..

  • @yugendravenkatadurgamruthk7797
    @yugendravenkatadurgamruthk7797 4 года назад

    A wonderful Video. Very useful information. I learned a lot.

  • @RelentlessHomesteading
    @RelentlessHomesteading 4 года назад +1

    Great video -- I'd have gone with a simple table for the speed values. If you have too many points, then you interate between adjacent values. Its a great way to get the curve you want without wasted computations on uCs.

    • @iforce2d
      @iforce2d  4 года назад

      These mcus only have 2048 bytes of RAM, it disappears pretty fast :) But yes, on most other hardware that would be the way to go.

  • @a.chrisblythe7991
    @a.chrisblythe7991 5 лет назад +2

    I think I would be right in saying quite a few people would be interested in an add on to explain the interupt and more involved later part of the video, any chance of making an advanced version add-on video? It was very informative and I learned a lot for which my thanks

  • @MatteoPresot
    @MatteoPresot 5 лет назад

    Hi, to calculate limit of the sum, try with a lookup table and interpulate beetwen breakpoints

  • @germanangeles5648
    @germanangeles5648 3 года назад

    Excellent this video, very good command of kinematics

  • @VinceSamios
    @VinceSamios 4 года назад +2

    I've done a total re-write to come up with a new solution for coordinated steppers with acceleration. My solution includes optional acceleration, optional deceleration, and no delay between routine steps. It retains the speed and acceleration aggression options. I'll post a video on it some time, but essentially all step scaling is pre-processed and the acceleration/deceleration equation is run only once (no need to run between routines) per step.

    • @jarchdm
      @jarchdm 4 года назад

      I'm just about to program my automatic curtain puller and I would love to see your code. If possible could you post a link to a Google Drive file or something?

    • @VinceSamios
      @VinceSamios 4 года назад

      @@jarchdm Ive got some finishing off to do, but I'll do a video when it's done.

    • @jarchdm
      @jarchdm 4 года назад

      @@VinceSamios excellent looking forward to it

  • @Onestone445
    @Onestone445 5 лет назад +1

    Hello iforce2d,
    could please name the type of the extension board and the steppers you used in combination with the arduino?
    Thanks for your answer!
    Cheers ;)

    • @iforce2d
      @iforce2d  5 лет назад +1

      The big board I got here: goo.gl/hx8LTH
      The drivers are called A4988, the steppers are NEMA17 and NEMA11.
      The single driver board I think is just called something like "A4988 driver board"

  • @gusarw
    @gusarw 2 года назад

    Hello! Great video, and great work! Thank you!
    I am trying to adopt your last sketch (Coordinated motion) to run under Arduino Uno with only 4 motors (CNC motor shield 3.00). Everything works great, except the Y-motor doesn't change its direction. I see with a meter that the DIR signal on pin 6 for Y-motor does go to HIGH after prepareMovement() - when it is time to change direction, but then it immediately goes to LOW when runAndWait() is executed. Do you know what within runAndWait() could possibly be resetting direction signal just for this one motor? (I am using Step/Dir pins: 5/2 for X, 6/3 for Y, 7/4 for Z, 13/12 for A). Thank you.

  • @mohamedmokdad5222
    @mohamedmokdad5222 6 лет назад +1

    First of all, many thanks for this very useful tutorial video in my view. Would it be possible to have the exact reference of the stepper you are using? I have making some checking with an oscilloscope and the behavior in my environment differs a bit from yours. E.g. with the settings as done in your sketch, the 1st pulse is about 2.8 ms and the second one is about 11.6 ms. The rest of the pulses are decreasing are predicted. This seems to be connected to line 12 in your code
    float c0 = 2000 * sqrt( 2 * angle / accel ) * 0.67703; in sketch Stepper3_linearSpeed. Any advice on that?

    • @bochozack
      @bochozack 3 года назад

      Hi, Do you know what code he is using? I use Python, and I am guessing this is C code? Thanks

  • @floatrope466
    @floatrope466 3 года назад +1

    Great video and well explained, I’m working with the “linear Speed Interrupt Multiple Motors” sketch.
    Is it possible to “enable each stepper driver, run the required steps and then power down to reduce heating and power consumption?
    Looking at the code, could the “si.movementDone” be utilised to control each enable pin so the stepper driver is only enabled whilst there are steps in progress and powers down when completed.
    I have tried various ideas but cannot get it to work, Hopefully it’s a simple addition to the code for someone with more programming experience.
    Thank you!

    • @iforce2d
      @iforce2d  3 года назад

      I suppose you could use a relay to break the connections between the driver and the motor when necessary. I get the feeling that there's a better solution though. If you're concerned about wasting power because you're running from battery, I'm really wondering what you're making. If you're mainly concerned with heat, perhaps you could adjust the maximum current the driver is allowed to push, or just use larger motors.

  • @alexgonzalez2338
    @alexgonzalez2338 3 года назад

    This is very impressive engineering knowledge

  • @LOUISGSKATEBOARDS
    @LOUISGSKATEBOARDS 5 лет назад

    Hello, I would like to say thank you for the great video, I learned so much from it.
    I have a question regarding your Stepper4_linaearSpeedInterrupt code. You said that the maxSpeed is timer ticks per STEP and some of the that time is taken up running the interrupt. Is there a way to take this maxSpeed value and figure out rev/sec of the max speed?
    Thanks

    • @iforce2d
      @iforce2d  5 лет назад

      I think it would be pretty hard to get a good number. Best idea might be to check micros() every n steps and take the difference between them, when running at a constant speed. Do that for a range of different speeds and you might be able to plot a curve that gives you a general estimate.

  • @jamesbeckett7125
    @jamesbeckett7125 5 лет назад

    Great Video, would you mind explaining how you calculate estStepsToSpeed?

  • @heinrichhelmbold419
    @heinrichhelmbold419 4 года назад +1

    This is a late reply but this has been a very informative video!! I am busy getting my head around interrupts - I can see why it took so long. Just a simple question... If your Stepper3_linearSpeed sketch works, should the Stepper4_linearSpeedInterrupt sketch also work without editing? My stepper just makes a slight movement and that's it... the non linear sketches works perfectly.

  • @traceyflanders
    @traceyflanders 2 года назад

    Great explanation, appreciate it.

  • @stevejenkins6198
    @stevejenkins6198 6 лет назад

    My remote control car witch I lost the remote for,has a circuit board with a 3vdc Relay. Since I lost the remote to the car I scrapped the circuit board an added a Arduino an motor shield. What I wanna know is will I have any problems using a arduino uno. Also the car uses a 7.2v battery the motor is slightly larger than most remote controlled cars, so I wanna know is will there be any problem with the method I’m going to use with the arduino uno & the motor shield

  • @MrMitdac01
    @MrMitdac01 5 лет назад

    Thank you so much, your video is so helpful

  • @aceshelander1528
    @aceshelander1528 6 лет назад

    Thanks for the video and code I was wondering how to run simultaneous steppers on a single interrupt.
    About your total time problem try take the integral of your taylor approximation that should deliver an equation for time given n steps. (im not sure how much (if any) error there will be since the function is not technically continuous though)

  • @ManojSharma-ud3ox
    @ManojSharma-ud3ox 4 года назад

    Good Work! Thanks for sharing this information.

  • @jmarkhan9235
    @jmarkhan9235 3 года назад

    Thanks for sharing and really helped out.
    I want to control 4 stepper motors in a sequence 1,2,3,4 , with 0 to 180 degrees of movement like half circle with reverse and forward motion. Please help me out.

  • @DoubleminecraftxX
    @DoubleminecraftxX 4 года назад +1

    I'm getting some very strange results when trying to input large inputs, ie 100000+ steps in a prepareMovement. The integers aren't overflowing because of this though so I'm not sure what the problem is. Either the motor starts stepping in the opposite direction or it only does a tenth of the movement it should be doing. Any idea what could be happening here?

  • @stevejones8665
    @stevejones8665 6 лет назад

    Great Video mate and vwdone sticking with it👍I watched to the end and didn't yawn once even tho i don't think I will ever have a need to control 6 steppers at once...Was very surprised to see there was no slip i am guessing it's because you used interrupts..which part of down under are you from? I have lived in Christchurch NZ twice but am now stuff back in wet and Cold Liverpool UK now Winter is on the way here and your Summer is just around the corner..Regards Steve