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.
@rthally947 жыл бұрын
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.
@conraddiaz22746 жыл бұрын
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!
@jmarkhan92354 жыл бұрын
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.
@vincentpernicano32772 жыл бұрын
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!
@Steve_LSP Жыл бұрын
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
@maciejmajewski40333 жыл бұрын
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.
@exnihilo415 Жыл бұрын
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!
@franztrinidad34544 жыл бұрын
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 😅
@MattMcConaha3 жыл бұрын
I'm riding that same boat right now
@Siamect7 жыл бұрын
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...
@JyrkiKoivisto7 жыл бұрын
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.
@Siamect7 жыл бұрын
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...
@wrobel77 жыл бұрын
Siamect interesting insight. Do you have any DIY blog/vlog? Would be nice to learn from someone more experienced 😀
@Siamect7 жыл бұрын
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...
@adrianrawlings24703 жыл бұрын
Hallaluha, someone actually showing and explaining in detail. I'll certainly be watching this again.
@msimila6 жыл бұрын
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!
@johannesbrahms27186 ай бұрын
You are like a magician! I had incredibly hard time with these steppers! Thank you!
@web1bastler7 жыл бұрын
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!
@randunik777 жыл бұрын
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 ;)
@jenskapmeyer25796 жыл бұрын
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 ...
@profBricks2 жыл бұрын
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
@MaximilianBeck6 жыл бұрын
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
@johnlocke96092 жыл бұрын
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.
@k345616 жыл бұрын
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
@DNSXH17 жыл бұрын
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.
@iforce2d7 жыл бұрын
Thanks for the kind feedback :)
@yurigagarin19873 жыл бұрын
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.
@MrSantiagoDELO3 жыл бұрын
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.
@monfalcon35966 ай бұрын
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
@VinceSamios4 жыл бұрын
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.
@jarchdm4 жыл бұрын
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?
@VinceSamios4 жыл бұрын
@@jarchdm Ive got some finishing off to do, but I'll do a video when it's done.
@jarchdm4 жыл бұрын
@@VinceSamios excellent looking forward to it
@automateanything6 жыл бұрын
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!
@KW-ei3pi8 ай бұрын
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.
@ZeedijkMike6 жыл бұрын
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.
@davidburt92383 жыл бұрын
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 !
@pd.dataframe28334 жыл бұрын
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.
@lazymouse6367 жыл бұрын
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.
@SirRobinII3 жыл бұрын
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.
@PiefacePete464 жыл бұрын
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.
@iforce2d4 жыл бұрын
Have you seen a doctor about this odd behavior :)
@PiefacePete464 жыл бұрын
@@iforce2d : Yep... he told me to "Keep using the pills and potions"! (And watch more KZbin) :o)
@insanet32 жыл бұрын
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.
@will394905 күн бұрын
Best teacher of all fime
@RcCarFan017 жыл бұрын
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 ^^
@ЮліанКулик Жыл бұрын
Thank you very much sir, you have the best video on youtube to explain this topic
@PiefacePete467 жыл бұрын
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.
@iforce2d7 жыл бұрын
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.
@jonaspeter40303 жыл бұрын
Exactly what I was looking after! Thanks a lot! You did a great job!
@loukask.91116 жыл бұрын
u deserve like 10 times more subs, this is insane.
@1_HighDuke7 жыл бұрын
Very interesting exercise. Thanks for taking the time to explain it like you did.
@amanpreetwaliacool3 жыл бұрын
You can interweave the steps of stepper motors to coordinate them together. Thus, all motors will have (pseudo-) parallel step execution.
@sato4kaiba6 жыл бұрын
Hint: I will not use floating point values. The reason has to do with how floating point values are processed in binary, too much overhead. If you have to use floating point values, then get an FPU coprocessor to do the calculations as it will be faster. Also, use ATMEL port addressing and writing with masking so that you can eliminate the overhead of the digitalWrite functions as they will need to be called while direct port access to the PORTs and DDRs will take less clock cycles. That will help make your code faster and more optimized. Now that you have saved yourself some time, the question of the solution to the equation can be handled. Look into changing your function to do time by CPU cycle pulse as the board frequency is fast enough to give you better time durations. If this does not work, then you have to consider moving your code to an Arduino Due as the execution speed for machine instructions are much faster. Hope my Two Cents help. Its a different view to approach your difficulties.
@amilcarmalave41152 жыл бұрын
this video deserves millions of likes
@YoutubeAdministrator7 жыл бұрын
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.
@TheRealStructurer3 жыл бұрын
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
@philbx17 жыл бұрын
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.
@letrung91993 жыл бұрын
Thank you so much. I’m looking for this video in quite a long time. This is super valuable for me!
@a.chrisblythe79916 жыл бұрын
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
@RelentlessHomesteading4 жыл бұрын
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.
@iforce2d4 жыл бұрын
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.
@helixalgorithm31607 жыл бұрын
Cool insight to servo controls. I believe you could use a Gaussian distribution for smooth a/de-cceleration
@jims4087 жыл бұрын
Many thanks for a very instructive and practical video... you have a real knack for explaining things well.
@mikebiermans42737 жыл бұрын
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
@ceptimus7 жыл бұрын
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 KZbin it - I intend to, but I have too many other projects on the go right now...
@patrickjdarrow6 жыл бұрын
Insanely insightful video. Huge help for me as a student.
@danielmirandacruz71644 жыл бұрын
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?
@automateanything6 жыл бұрын
for those that cant get the later interupt sketches working. i did it like this . change each stepper with port mapping to digitalwrite as below #define X_STEP_HIGH digitalWrite(X_STEP_PIN, HIGH); // PORTF |= 0b00000001; #define X_STEP_LOW digitalWrite(X_STEP_PIN, LOW); // PORTF &= ~0b00000001;
@jcjensenllc4 жыл бұрын
Not true for Arduino 101 and other models that cannot run the function: ISR(Timer1_COMPA_vect). A major code rewrite is necessary to run on my Teensy MCU. Am not qualified to do that yet.
@ernestarranzpasqual71672 жыл бұрын
It worked! THank you
@hytiklin6 жыл бұрын
Very nice teaching sir....Lovely. Become Fan of yours..
@heinrichhelmbold4194 жыл бұрын
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.
@frab887 жыл бұрын
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)
@DoubleminecraftxX4 жыл бұрын
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?
@bartmanpoet90675 жыл бұрын
I am building vertical tower garden. Which consists of 5 foot lengths of 4 inch PVC with holes arranged around the pipe every 6 inches down it. In those holes I will grow my vegetables. I would like to build a system with an Arduino or Raspberry Pi to rotate it 180 degrees and back for maximum sun exposure. I would like to connect these towers with some type of chain and a stepper motor that would turn a row of them, all at the same time. Could you offer any advice on the controller, gears, chain, motor, code(slow timing) or anything else that that would be relevant. Very informative channel, with information presented in a logical way. Keep up the good work!
@anthonyj7777 жыл бұрын
I was glued the whole time. Great video.
@davidforrest9372 ай бұрын
From looking at the motion planning code, it doesn't seem like they all accelerate at the same times. initially, they are all set to the same 1000-unit acceleration(c0 time delay), so and all reach top speed/minStepInterval at the same time, so the acceleration period would end at the same time, but then when you apply the speed scaling, it looks like it would stretch out the acceleration curve for longer. So if the fast axis comes up to speed in 0.1 sec, then a 5x slower axis might come up to speed in 0.5sec. The movements still finish the entire movement at the same time, but since their acceleration curves aren't syncrhonized, they aren't coordinated for straight-line movement--one axis is still accelerating while the other is moving at constant speed. Although they start and stop at the same times, they aren't accelerating for the same times, so the motion is not coordinated.
@iforce2d2 ай бұрын
Yes, you're correct. Not sure if it completely disqualifies usage of the word 'coordinated' though.
@davidforrest9372 ай бұрын
@@iforce2d It is hard to tell from the videos, since I think the accelerations are pretty quick compared to the distances, and it might be just a small fraction of the motion. It would then be straight-line coordinated motion during the cruising segment, but (versus the 44:04 explanation) there would be some bends and curves in the line as some axes finish their acceleration while others are still accelerating. CNCs and 3d printers keep stepper motions perfectly coordinated by planning the motion for the controlling axis, and moving the other axes in precise position ratios to the controlling axis using the Bresenham algorithm. To do perfect straight lines by scheduling time, you'd also have to at least synchronize the times of the changes in acceleration, and then...the `p=1/2*a*t^2` physics formula of motion would make the motion proportional to the acceleration: `p/a = 1/2*t^2`. So straight lines where the accelerations are both/all happening, and bends where one axis is accelerating while the other(s) is cruising, and then straight lines again when they are all cruising.
@josemanuelgonzalez69683 ай бұрын
Awesome video!!! I'm gonna try with 3 nema 17 I have at home. One question, How do you make the homing?
@RuiMartins6 жыл бұрын
The problem you have at 8:15, is related with the fact that you are not using a sqaure have with a 50% duty cycle You are doing a very quick HIGH to LOW, and a much longer LOW to HIGH. Wait the same amount of delay between both transitions, and you will be able to make it work faster more reliably.
@jcjensenllc4 жыл бұрын
I prefer to generate a square wave in the for-loop putting equal delay between each digitalWrite.
@mohamedmokdad52226 жыл бұрын
If you are trying to run this tutorial on a Arduino Mega2560, you have to change 1st the the macro STEP_HIGH and STEP_LOW. These pins are located some else as in the tutorial.
@tomasliendro22485 жыл бұрын
Hello! Im new in Arduino programming and I cannot find where are these pins in MEGA. Could you please help me? Thanks!
@DoRC7 жыл бұрын
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.
@anol45903 жыл бұрын
This is exactly what I needed, thank you so much for sharing with us!
@blankphoto6 жыл бұрын
It is cool :) Decided I'm going to use a stepper motor for a pet feeder build I'm doing, thanks to your video.
@numenrider6 жыл бұрын
Thanks a lot because of you i can understand how to assign a function including 3 stepper motors, which will work cordinately😍😍😍
@mohamedmokdad52226 жыл бұрын
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?
@bochozack3 жыл бұрын
Hi, Do you know what code he is using? I use Python, and I am guessing this is C code? Thanks
@peta10012 жыл бұрын
I did not really go beyond the point in video, where the author gives in sophisticated calculation and theory. The author had a very efficient approach in the first place. All I did was to base my acceleration function on incrementing the speed instead of incrementing delay. So here is my modified version of the author's good idea (it works, but it should be improved in a few ways...depending on the main application code): void linAccel(int steps, int uSteps) { //we assume the uSteps (microsteps) are defined before calling linAccel(steps, uSteps) int lowSpeed = 100; //rpm int highSpeed = 400; //rpm float speedIncr = (float) 2 / uSteps; int rampUpStop = (highSpeed - lowSpeed) / speedIncr; //steps before highest speed achieved int rampDownStart = steps - rampUpStop; //steps after highest speed starts to deccelerate float d = 60000000 / lowSpeed / 200; //[us] lowSpeed Delay based on 1.8 degree steps ==> 200 steps per rotation float curSpeed = lowSpeed; // Serial.println("rampUpStop: " + String(rampUpStop)); // Serial.println("rampDownStart: " + String(rampDownStart)); // Serial.println("curSpeed: " + String(curSpeed)); // Serial.println("speedIncr: " + String(speedIncr)); // Serial.println("delay: " + String(d)); for (int i = 0; i < steps; i++) { digitalWrite(stepX, HIGH); digitalWrite(stepX, LOW); delayMicroseconds(d); // delay(10); if (i < rampUpStop) { curSpeed += speedIncr; d = 60000000 / curSpeed / 200; //d += speedIncr; // if (curSpeed > highSpeed) curSpeed = highSpeed; } else if (i > rampDownStart) { curSpeed -= speedIncr; d = 60000000 / curSpeed / 200; // -= speedIncr; // if (curSpeed < lowSpeed) curSpeed = lowSpeed; } // Serial.print(String(i) + "," + String(curSpeed) + "," + String(d)); // Serial.println(); } }
@isidoromaich72267 жыл бұрын
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.
@mkmyuu3 жыл бұрын
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!
@TheSterlingwright12 жыл бұрын
Is it possible to get the wiring information as to what group of wires go where on the Adriano and the stepper driver?
@doanlinhvo17834 жыл бұрын
great explaination! easy to understand. Just want to say thank you so much! :)
@jimmycstephens6 жыл бұрын
Thanks for all your hard work. However, as a former programmer, please document every line of the sketch. I look back over code I wrote years ago and can not remember what it is doing w/o documentation. Also, you might want to show the end result first so the viewer can see what you are up to.
@alexgonzalez23383 жыл бұрын
This is very impressive engineering knowledge
@waynedow9227 Жыл бұрын
Nice job in explaining your sketches and theory. I was wondering if you could, in your linear transition, instead of calculating the slowest movement to end all processes could you calculate for the fastest? For example when using two motors starting at “M1 pos 0 and M2 pos 0” to “M1 pos 20 and M2 pos 40” you are calculating so M1 finishes the same time as M2, where M2 would take longer to arrive at desired pos. In some cases I would think it would be more expedient to calculate for the faster motor, making both arrive at desired pos sooner.
@iforce2d Жыл бұрын
Generally there will always be one axis of movement that limits the movement speed to some upper bound. For example in my CNC router the gantry weighs about 35kg and cannot move as fast as the much smaller spindle. If I want a straight line move the only way is to match what the slower axis can do. Making the stepper controller match the speed of the fastest axis would only result in missed steps on the gantry.
@Adamcz957 жыл бұрын
Ah, I wish I saw this video when I was making my bachelors thesis (DIY camera slider). Very nice.
@VinceSamios4 жыл бұрын
Hey, I'd love a link to this thesis
@yepitsodex7 жыл бұрын
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).
@andrewmack48308 ай бұрын
Very clever, and well explained. Thank you
@Xraller7 жыл бұрын
Great video! I've been wanting to know just these things for a while. Thanks!
@PIXscotland7 жыл бұрын
Rather than calculate the time in formula it'd be more accurate to disable the steppers and run the step routine counting millis(). Doing that will also include any additional service routine delays and other interrupts. You could run a "simulated" routine at power up to keep the figures accurate just in case the clock speeds or other "thing" change that could affect the time. Calculating 5 long moves at power up would only take a few of seconds at most.
@iforce2d7 жыл бұрын
I don't quite follow what you mean about counting millis(), what would be the purpose of that? You mean to find out how long each motor would take so I can slow down the fast motors? Yes, it might be more accurate but accuracy is not as important as the ratio between the individual speeds. It would also make every movement take twice as long if I have to run a 'dummy' pass first to measure the time before actually doing the movement.
@PIXscotland7 жыл бұрын
Regarding your question at 45minutes: Thinking you could in the software calculate at some point the time taken for a "travel" of, say, 100,500,1000,5000 steps. Knowing the time taken for these it should be possible to graph or calculate the time taken for anything in between. The lower step times will be dominated by loop times, acceleration/deceleration times. Longer runs will take much nearer the "running at full speed" time. Plotting more points would allow a more accurate "estimate" of the time taken for all steps distances but would add to the time. Once you know the table above, you could loop rapidly through your "job file" and gather the entire time taken for all moves. For higher accuracy you could actually recalculate the table or add extra points as you progress through your "job file." At the end of the job you could export the table back to your PC giving yourself some solid data on the real time it took for each move. With all of that data I'd expect a really accurate graph of time taken for a step of any size to be achievable. Since you're moving all at the same time and slowing the short travels to match the time taken for longer travels you only need to calculate time taken for the longest travel on each loop. Basically, it's a version of your brute forcing the timings to build a graph that can be read back quicker at any future time. I hope this makes more sense.
@mastermoarman4 жыл бұрын
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.
@jakhongiralimov74814 жыл бұрын
wow. thats what i needed - using steppers in timer interrupts
@gusarw2 жыл бұрын
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.
@yucemantar6 жыл бұрын
ADAMSIN KARDEŞ
@mr.es18574 жыл бұрын
Reading the AVR paper I got to this eq in page 6 : n1 = [ ( n1 + n2 ) w°2 ] / ( w°1 + w°2 ). In the reading when can find that is used to find " n1 " but for me makes no sense since " n1 " is still on the right side. I kinda have a clue for this... If we assume that n1 + n2 = 160 this eq would let us know the actual value of n1 in the case we want to divide the steps into two with different accelerations. Thanks to everyone in advanced!
@gotmilkforme232 жыл бұрын
Hello, love this project. I have a question there a way to modify this code to only run 2 stepper motor and have it return to a home position?
@floatrope4664 жыл бұрын
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!
@iforce2d4 жыл бұрын
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.
@stevejones86657 жыл бұрын
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
@antoniopedrajasantiago84155 жыл бұрын
how you conected the motor, Black 1A, Red 1B, Green 2A,, Blue 2B, ? In the modular stepper yurbot. Thanks and congratulations!!!
@lokeshsilwal57327 жыл бұрын
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?
@RSC21945 жыл бұрын
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
@democracyslave2084 Жыл бұрын
I need to switch the direction of the stepper motor at 1800rpm like forward and reverse required moving angle 90 degree only , required 7 cycle per second it's possible?
@barrinfin3 жыл бұрын
Thank you, great video, it explains so much and easy to follow
@vishalramadoss6683 жыл бұрын
Fantastic work and documentation
@ruggedtechie58673 жыл бұрын
None of it is complicated , just additional steps . Good video regardless
@d333gs2 ай бұрын
Super stuff!! Is there the Arduino ide sketches available somewhere? You mentioned there is code on your site? I only saw references to games.