No video

Multiple stepper motors with joystick, TB6600 and the accelstepper library

  Рет қаралды 31,139

Curious Scientist

Curious Scientist

Күн бұрын

Пікірлер: 161
@ianbeaver9627
@ianbeaver9627 2 жыл бұрын
Several people have asked in the comments where to find the links to the circuit diagrams and the code etc and this had me foxed for a while too. 'In the comments as always' the Curious Scientist said. But I read all the comments and all I saw was other people also complaining that they could not find the links to the code or circuits etc. 'In the comments' said the Curious Scientist repeatedly. This post is just to let other subscribers know that the trick to solving this problem is that the very top comment, immediately after the video, yes the one with the blue 'Curious Scientist' logo, on my screen at least, has a 'SHOW MORE" button. Click on that and all is revealed.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
The problem is (and I am not trying to criticize or offend anyone) that people just usually so impatient or lazy. They want everything to be "spoon-fed" to them. I always publish the schematics, the code and often add extra resources, but many people are too lazy to check the description of the video and click on the link. I cannot do anything else but telling them over and over to always read the description. :D
@Meccanokinematics
@Meccanokinematics 2 жыл бұрын
Great vid. The resonance fenomenon van be avoided by using TMC drivers. I have been using all kind of drivers for my projects, like A4988, DRV8825, M415C, HY-DIV268N and a couple of other ones. They all had in common, that they can't cope with the resonance and electrical noise. TMC drivers however are absolutely silent.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Thank you! Yes, those drivers are more silent, I have them in my 3d printer and they make a huge difference. They also come with some extra features as compared to the other mentioned drivers.
@ScrapYardDog64
@ScrapYardDog64 2 жыл бұрын
Fantastic!!! Wish me luck , this is exactly what I have been trying to build!!
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Good luck! Glad to hear that you found what you were looking for.
@robertneff6583
@robertneff6583 2 жыл бұрын
just ordered your preferred joystick. your setup is almost exactly what i need to use. Hate reinventing the wheel, so looks like this will save a bunch of time. Maybe i missed something, but didn't find the webpage you mentioned as place where one could download the accellstepper code that you wrote.? worst case i just retype it all.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Hi! I don't know what you missed, but the website link is (as always) in the description of the video. This joystick is a really good one, I really like it. It is robust and it has a nice mechanical response.
@Nickael7
@Nickael7 2 жыл бұрын
@@CuriousScientist You didn't get his question. He asked that: he didn't find the webpage you mentioned as place where one could download the accellstepper code that you wrote. The weblink for your modified "accelstepper code is not here. Without it, it doesn't work.
@schleichfix7017
@schleichfix7017 3 жыл бұрын
This is a great tutorial to rebuild, everything works great. Can you maybe show how to add limit switches to this circuit and program. I would like to use this to move a camera, these limit switches would be very helpful.
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Thanks! You should have looked around on my channel... It is full of limit switch-related builds. Check this: kzbin.info/www/bejne/j5WYooKvgpZ4ftU
@saulosamorim
@saulosamorim Жыл бұрын
awesome! nice code! you save me from a long research
@CuriousScientist
@CuriousScientist Жыл бұрын
It's great to hear that! 👍
@LegitLeeVelez
@LegitLeeVelez 4 жыл бұрын
Great Job was waiting for something like this to come looking forward to what you use this for!
@CuriousScientist
@CuriousScientist 4 жыл бұрын
Thanks! This afternoon, I've been working on the X-Y table. It will be a bit of a Frankenstein style, because I mix 3d printer parts and hardware store bought parts, but it will be nice. At this moment, I don't have any _specific_ purpose, other than maybe helping people out with the source code and some ideas, but in the future, this will be a nice addition to a DIY press drill.
@LegitLeeVelez
@LegitLeeVelez 4 жыл бұрын
@@CuriousScientist sounds good to me and we people looking for assistance in our future projects thank you for your info
@CuriousScientist
@CuriousScientist 4 жыл бұрын
Thank you! I am very happy if my projects can help others. Basically, this is the purpose of the channel: trying to help others by sharing my hobby projects.
@desmondwalsh3826
@desmondwalsh3826 3 жыл бұрын
Very informative video. However, I believe there is a mistake in the schematics. For stepper motor 2 PUL- connects to Pin 10 (according to code) to Pin 9 (according to schematics) DIR- connects to Pin 11 (according to code) to Pin 10 (according to schematics) I assume the code is the correct
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Thanks for the remarks! I fixed it. The code is correct as you can see it in action in the video.
@bilginerkoc7519
@bilginerkoc7519 Жыл бұрын
Very nice work.. congs. I will make a robotic arm and try to use this kind of circuit and equipment. this video will very benificial for us. thanks ....
@CuriousScientist
@CuriousScientist Жыл бұрын
Thanks! I am glad to hear that my content is useful for your project!
@KW-ei3pi
@KW-ei3pi 6 ай бұрын
Very interesting! I'm looking forward to checking out your code and functions. I don't use the Accelstepper library. I try and write all of the code myself. I'm just wondering how much you code requires it. I hope I can figure that out and be able to use it. Thanks!
@CuriousScientist
@CuriousScientist 6 ай бұрын
Thanks!
@rimenaouissaoui9933
@rimenaouissaoui9933 2 жыл бұрын
Great video ✌, thanks a lot! did you use two 12V-adaptor for 2 motors or just one? Thank you
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Thanks! Just one with enough current supplying capabilities.
@user-kp4uh2tk8p
@user-kp4uh2tk8p 7 ай бұрын
Hello I don’t know a lot in electronics but what settings do you have on your drivers ? And if I need to increase a microsteps what should I change in the code ? Thanks
@CuriousScientist
@CuriousScientist 7 ай бұрын
Hi! Microsteps (and current) are set on the driver. I don't remember the settings, but it is probably written in the code I published. You can check the current needed in the datasheet of the stepper motor you use and the microstepping is entirely up to you.
@robertneff6583
@robertneff6583 2 жыл бұрын
great video
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Thank you!
@michaelrydahl8669
@michaelrydahl8669 Жыл бұрын
Hi, I've started watching your videos, could you use color convention minus = black/blue, plus = red, data = all other colors when you connect the different components, it will be a great help for those of us who don't hear very well. Please
@CuriousScientist
@CuriousScientist Жыл бұрын
Hi! I don't always have the chance to pick the colour of the wires because some components arrive already with some wiring. Also, most of these videos have a corresponding article on my website where you can find the schematics and read everything. I hope that helps.
@user-yi5lb1ue8h
@user-yi5lb1ue8h Жыл бұрын
Dear Sir, your work is fantastic! Could you please tell me how to integrate 2 limit switches ( in other words 2 "if" statements ) into your sketch in order to stop the motor from over-running in each direction but still allowing to bring it back from the "limit"-position? Thankyou in advance.
@CuriousScientist
@CuriousScientist Жыл бұрын
Hi! You can stop the motor after a limit switch is hit and then make it go back until the limit switch is released.
@malikaibuchanan2759
@malikaibuchanan2759 Ай бұрын
hello is it possible to add limit switches and a homing function with the tb6600 and joystick
@CuriousScientist
@CuriousScientist Ай бұрын
Hi! Sure, it is possible.
@conradvandien3495
@conradvandien3495 11 ай бұрын
I spent a lot of time for looking similar project with stepper motor control speed and direction by joystick but with A4988 driver and found nothing. Can you help me find the code for A4988 driver?
@CuriousScientist
@CuriousScientist 11 ай бұрын
The driver doesn't matter... it is still a step/dir type of driver. They are interchangeable. Also, if you look at my videos, you will find a video where I demonstrated this.
@diegomonzon
@diegomonzon 3 жыл бұрын
Thank you for your tutorials, they are all super useful. I am replicating this one with an ST-M5045 driver, a nema 24 motor and a 10k potentiometer. It works, but the speed is not as fast as in your video . I tried changing the stepper.setMaxSpeed(5000); //SPEED = Steps / second and it doesn't change anything. I also tried changing the multiplier (5) in stepper2.setSpeed(5*(Analog_Y-Analog_Y_AVG)); It does get to my max speed faster but the max speed stays the same. Any help is very appreciated.
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Hi! Thank you for the kind words! If your stepper motor is not as quick as mine, check the following settings: - Check the microstepping - I always use 400 steps / turn. - Change the acceleration (this will not work with the runSpeed() and setSpeed() functions however - use the run() and setMaxSpeed() instead at the corresponding places) - Change the max speed. - Better power supply. (I am running tiny motors, they are easier to speed up) Let me know about your progress later!
@echearista
@echearista 3 жыл бұрын
Great tutorial! I have a question... the same power supply for both tb6600 are independent? Is there a problem if I use the same for both drivers?
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Thank you! Of course, you can power the drivers from the same power supply! Just make sure it can provide enough power for both drivers/motors. I used independent power supplies only because of convenience. It was easier with the cabling for me. :)
@sumantriaza4707
@sumantriaza4707 Жыл бұрын
Sir, what software do you use to make the diagram?
@CuriousScientist
@CuriousScientist Жыл бұрын
Hi! It is Fritzing. But the diagram on my website was only partially made with it. It did not have the model for the TB6600 so I pasted my Fritzing-made circuit into Paint and finished the rest of the circuit with the TB6600 using Paint.
@sumantriaza4707
@sumantriaza4707 Жыл бұрын
Okey thanks sir😊
@DorfyBoi
@DorfyBoi 5 ай бұрын
I'm controlling mine via http requests over pygame and a joystick from a client pc. It's pulsing the motor based on how fast the packets are being sent. so the motor cant move fast at all. what method can I use to get the motor to pulse fast, whilst using my x_axis -1 to 1 values?
@CuriousScientist
@CuriousScientist 5 ай бұрын
How fast is fast? Stepper motors are not that super fast, they are made for precision and not speed. With proper driving, 2-3000 RPM is achievable, depending on the type of motor and driver.
@tarquinoriverojoseorlando1763
@tarquinoriverojoseorlando1763 3 жыл бұрын
very good video, I want to do something similar but with the Nextion screen, is it also possible?
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Thank you! Of course it is possible. It only depends on your coding skill, but adding a few buttons to the display and then sending commands by poking the display should work nicely. I actually purchased a tiny Nextion display recently, so there will be content with it in the next months.
@tarquinoriverojoseorlando1763
@tarquinoriverojoseorlando1763 3 жыл бұрын
super, and will you upload a video explaining something with nextion? It is still new for me and I am having a hard time learning that part
@CuriousScientist
@CuriousScientist 3 жыл бұрын
@@tarquinoriverojoseorlando1763 yes, I will. Explanation, source code, wiring diagram, all will be shared as usual. But as I said, it will take some time as I am working on other projects at this moment.
@Paravision1
@Paravision1 2 жыл бұрын
Thank you for all the tutorials!! I'm trying to remote the joystick via rs485. I've substituted the A0 pin for "int Analog_X = Serial.parseInt();" I can get the joystick reading from the Master arduino on the slave in the void ReadAnalog() fine, but for a reason that I don't understand, I can't use the "int" value from the Serial.parseInt() in the other void events or equations. So the Interval Values are always zero. Any pointers would be gratefully received. Many thanks
@CuriousScientist
@CuriousScientist 2 жыл бұрын
You are welcome. Did you check if the master sends the values to the serial? Then, are you sure that you define the variable at the beginning of the code and not inside a function? I suspect that you defined the variable maybe twice, once in the beginning, once inside a function. And since you redefined it, its value became zero. But it is hard to say anything helpful without seeing the actual code. (Please don't paste your code in the comments because it destroys the comment section and I cannot read the comments properly).
@Paravision1
@Paravision1 2 жыл бұрын
@@CuriousScientist Thanks for the help. Half way there now! The calcs are working, so stepper is moving with joystick via rs485, but much slower.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
You're welcome! If it moves slower, it is very obvious that something is not correct with the speed settings.
@davidmarrazzo7223
@davidmarrazzo7223 4 жыл бұрын
Hey this is my 1st arduino project so Im just learning, I tried to run a test build before changing anything but it fails and this is what it says 'InitialValues' was not declared in this scope' & 'ReadAnalog' was not declared in this scope', I thought these populate from values generated by the pot, am I doing something wrong? Thanks for any help
@CuriousScientist
@CuriousScientist 4 жыл бұрын
Hi! Maybe it is a bit too complex for a first project. :) You have to follow what the error message says. These two _FUNCTIONS_ are not declared! They have to be declared. Seems like you did not copy the exact code, or missed a "}" somewhere or something like that. Does your code contain the initialization of the above mentioned functions?
@davidmarrazzo7223
@davidmarrazzo7223 4 жыл бұрын
@@CuriousScientist Thanks for the reply, after seeing your reply I figured I would try in arduino sketch instead of vscode and it did compile but do you know what I would have to change to use with a tmc2208 driver
@CuriousScientist
@CuriousScientist 4 жыл бұрын
@@davidmarrazzo7223 Hi! The mentioned stepper motor driver should work without any problems and modifications. It has step and dir pins like any other drivers. You connect it in the same way as this driver I use, but instead of pul, you have step pin. Also, I am pretty that you can find some wiring diagrams on Google.
@saulosamorim
@saulosamorim Жыл бұрын
can you explain the power supply you used ? i'm getting a lot issues with power sup....
@CuriousScientist
@CuriousScientist Жыл бұрын
It is a simple variable power supply set to 12 V, nothing sophisticated. I have the product on my website under the parts and tools page.
@saulosamorim
@saulosamorim Жыл бұрын
@@CuriousScientist so you used 2x (Variable power supply (4-24 V, 2.5 A)) one for each stepper?
@CuriousScientist
@CuriousScientist Жыл бұрын
I ran two motors parallel. They won't take so high current anyway, so the supply can deal with them.
@saulosamorim
@saulosamorim Жыл бұрын
@@CuriousScientist thx!
@ShahramMeretiun-sm3sj
@ShahramMeretiun-sm3sj Жыл бұрын
Hi how are you i need a more information how to connect the arduino and microstep drive with joystick please show me how to make together the video you make it,s not clear to me thank you
@CuriousScientist
@CuriousScientist Жыл бұрын
Hi! All necessary information can be found on my channel and on my website. If it is still unclear, start with a simpler and smaller project.
@muhammadshahzaibmemon6671
@muhammadshahzaibmemon6671 3 жыл бұрын
Great video, I was wondering how can we add limit switches and a MG995 servo ? can u route me to a direction ?
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Hi and thanks! Check my recent videos on stepper motors, there you'll find the answer for limit switches. Adding a servo is a different thing as it would require a different controller and probably a different code as well.
@jeromechamounai9477
@jeromechamounai9477 2 жыл бұрын
Hello, tanks for your tuto , if i need 3 motors can you tell me the code with 3 stepper plz ?thanks
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Hi and welcome! I am not a free support service, I can't just write a code for you, sorry.
@Justsayin71
@Justsayin71 2 жыл бұрын
Hi, how reliable are those joy sticks?
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Hi! I would say, they are pretty good.
@ryanmccoll7248
@ryanmccoll7248 3 жыл бұрын
this is the perfect match of a project I am working on. Would you be willing to PM me a copy of this code? thanks
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Hi! Read the description! :)
@ryanmccoll7248
@ryanmccoll7248 3 жыл бұрын
thank you
@CuriousScientist
@CuriousScientist 3 жыл бұрын
You're welcome, I hope it helps!
@yaoleynikov
@yaoleynikov 2 жыл бұрын
Thanks a lot. But if I have a StepStick A4988 controller, and it has 2 control pins, the step and direction. How to be? Or why do you have 1 pin specified for 2 motors?
@CuriousScientist
@CuriousScientist 2 жыл бұрын
What do you mean? This motor controller also has 2 pins, step and direction. I also have a video about this topic: kzbin.info/www/bejne/lZbRiauZd7mCmq8
@yaoleynikov
@yaoleynikov 2 жыл бұрын
@@CuriousScientist on the code 1, AccelStepper stepper > 1 < , 8, 9 pin.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Seems like you haven't read the documentation of the Accelstepper library. Read it and you will see why it is used. It is not a pin definition, it indicates that a stepper motor driver is used, so step and direction pins will be used in the argument.
@osamaabbas6746
@osamaabbas6746 Жыл бұрын
I need code please 😢. Becouse the link is not open
@CuriousScientist
@CuriousScientist Жыл бұрын
The link works just fine.
@edouardezaoui9967
@edouardezaoui9967 3 жыл бұрын
Merci tres bon tuto 👍👍👍👍👍👍
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Thank you! Unfortunately, I do not have Wii nunchucks, so I cannot test it. But, hopefully it will help others who visit this video.
@23szendre
@23szendre 3 жыл бұрын
Nice, thank you for this tutorial! What do you think, it is possible to make a setup like this with 3 stepper motor using an TMC2208 Stepper Motor Driver?
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Thanks! It would work with "any" number of drivers and motors as long as you have enough pins on your Arduino for that. All you need to do is to define the motors one by one in the beginning, then refer to them in the code appropriately. The accelstepper library works with this particular driver too since it just needs the "step" and "dir" pins. As I added a second motor to the code in this demo, you can add a third, fourth..etc. (AccelStepper stepper1(1,8,9); AccelStepper stepper2(1,10,11)...etc.). Just follow the same strategy. Let me know if you need more help!
@MuhammadHafizHasburRahma-sr5if
@MuhammadHafizHasburRahma-sr5if 11 ай бұрын
Can you tell me type of joystick?
@CuriousScientist
@CuriousScientist 11 ай бұрын
Hi! There's a direct link to the product on my website under the parts & tools page.
@0raibi
@0raibi 3 жыл бұрын
Very nice video.. I found it just in the right time for a project I'm working on.. I have one question though, I used the code exactly as it is and just changed what needed to be changed however I don't seem to notice that this library does acceleration or deceleration for high speed movements. Is there a method or a function to accelerate other than setting max speed and setaccelerate?
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Ummm, if you would have watched the video carefully enough and read the documentation of the accelstepper library, you would know that the runSpeed() function does not use accelerations.
@0raibi
@0raibi 3 жыл бұрын
@@CuriousScientist I probably missed this part, so how do I use the same approach with acceleration and deceleration feature
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Read the documentation of the accelstepper library. Everything is explained there.
@mimo2802able
@mimo2802able 3 жыл бұрын
Hello. You made a great video and I really like this project. I want to ask if it can be used as a power supply pc source if I like this as a good solution since there is 12v for driver and 5v for arduino power supply it will be ok ? Thank you for your answer and I still wish you a lot of such videos
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Hi and thank you! If you mean that you want to use a PC power supply to supply this circuit, then it is perfectly fine. As you said, you can use the +5 V rail for the Arduino and +12 V for the TB6600. I will soon have a video with this exact topic: joystick and stepper motors. I will build an x-y table. I just got the parts this afternoon.
@mimo2802able
@mimo2802able 3 жыл бұрын
Yes I meant an ATX 600w power supply from an old pc ....
@CuriousScientist
@CuriousScientist 3 жыл бұрын
It should be good!
@jeffreyberces8005
@jeffreyberces8005 2 жыл бұрын
I followed al the wirings and codes . But its not working to me.. Maybe i need to flip dip sw to match on my motor?
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Do you have the exact same hardware too? Many things can go wrong, so it's very hard to guess.
@jeffreyberces8005
@jeffreyberces8005 2 жыл бұрын
@@CuriousScientist the only difference is my motor.. Its larger
@jeffreyberces8005
@jeffreyberces8005 2 жыл бұрын
My motor is 57HS112-3004A08-D21.. I hope you can help me where to adjust.. Maybe on the codes or on a DIP sw.. Another thing i noticed is, when it runs on CW, the CCW is ver slow.. But i cant get the proper run.. Hope you can guide me.. Thank you
@CuriousScientist
@CuriousScientist 2 жыл бұрын
That's a hefty motor indeed! First of all, we have to make sure that the power supply you are using is capable of supplying at least 3 A. But 5 A would be even better to have some safety margins. Then, yes, you need to play around with the DIP switches. Make sure you flip them to a position where the driver can provide at least 3 Amps. There are many different drivers out there labeled as "TB6600", so always refer to the text on the enclosure. But as I can see, "OFF-OFF-OFF" on the 4-5-6 dip switches should provide high enough current.
@jeffreyberces8005
@jeffreyberces8005 2 жыл бұрын
I use, 400 for stepping on TB6600.. I have 36V power supply 30A..
@harikrishna-zo1us
@harikrishna-zo1us 2 жыл бұрын
would you provide other joystick link which you shown in the middle of video please?
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Have you tried reading the description of the video or visit my website?
@harikrishna-zo1us
@harikrishna-zo1us 2 жыл бұрын
Can I use This 3 PS2 Joysticks for 3 individual motors?
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Of course.
@harikrishna-zo1us
@harikrishna-zo1us 2 жыл бұрын
Thank You ....your videos are so much informative.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Thank you!
@ekambaramvenkatesan7609
@ekambaramvenkatesan7609 2 жыл бұрын
Hi sir thank u for tutorial how many cost of this project?
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Hi and welcome! I shared the cost for most of the components, so you can easily estimate it.
@ekambaramvenkatesan7609
@ekambaramvenkatesan7609 2 жыл бұрын
@@CuriousScientist ok sir thank God component name and qty sir please
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Watch the video and read the description.
@mimo2802able
@mimo2802able 3 жыл бұрын
Hi. On the link to the web page where the connection is like a mini cnc for 3 axes X, Y, R, it is generated, G, code and I want to ask if this connection and that code is functional for 3 axes or it needs to be modified. I believe arduino will work on my mini cnc as well.Thanks.
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Hi! Could you please rephrase your question? I do not really understand what you mean.
@mimo2802able
@mimo2802able 3 жыл бұрын
@@CuriousScientist Hi . Simplified ... I want to make exactly this project of your 3 axis mini cnc.And I need, g, code I think it's called ... for all 3 axes controlled by a joystick .Please help me ... My flood question was about the link on your web pages where you already have some code but I do not know whether it also applies to connections from 3 axes and joysticks
@CuriousScientist
@CuriousScientist 3 жыл бұрын
If you want to control the 3 axes with this approach, you do not need any g code as you have the full control over the joystick and you directly drive the motors. However, it might be a bit challenging or uncomfortable to have all the 3 axes on 1 joystick. X and Y can be on 1 joystick, but for Z, I would use another joystick, or 2 buttons (z+ and z-). I have never worked with any g code related things, so I am not familiar with it.
@harikrishna-zo1us
@harikrishna-zo1us 2 жыл бұрын
can I connect 3 Nema 23 stepper motors for a single joystick?
@CuriousScientist
@CuriousScientist 2 жыл бұрын
No. Not even a single one. You connect the motors to the drivers and not to the joystick directly. Then, depending on the number of axes of the joystick you can hook up the same amount of motors to the circuit.
@harikrishna-zo1us
@harikrishna-zo1us 2 жыл бұрын
@@CuriousScientist what will be the code if I want to connect 3 TB6600 drivers to the single Joystick. And would you please share the wiring diagram.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Wiring depends on you. I cannot guess which pins you want to use. Also, you can easily use the contents of this video to build a system with 3 motors.
@SrkLarblack
@SrkLarblack 3 жыл бұрын
u r God
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Thanks! I am just a curious scientist. :)
@suri4kannada887
@suri4kannada887 Жыл бұрын
Sir can I run nema 23stepper motor on this code
@CuriousScientist
@CuriousScientist Жыл бұрын
Sure. It is not depending on the code, but on the driver. You might want to use a TB 6600 or similar driver to provide enough current.
@suri4kannada887
@suri4kannada887 Жыл бұрын
@@CuriousScientist A stepper motor can be used instead of an LED for Z axis
@CuriousScientist
@CuriousScientist Жыл бұрын
@@suri4kannada887 Sure. Each axis of the joystick can be associated with a corresponding stepper motor. Or just anything that you want to control with some input parameters.
@suri4kannada887
@suri4kannada887 Жыл бұрын
@@CuriousScientist sir I want to build a cnc machine Pls tel me Suitable pinion and rack gear for nema 17 stepper motor
@CuriousScientist
@CuriousScientist Жыл бұрын
Google is your friend.
@ipadize
@ipadize 2 жыл бұрын
i have a TMC2208 and when i use the joystick to control it i notice that it runs really rough. When i run the Stepper with the Accelstepper Library then its really smooth and quiet. I think thats due to the setSpeed/runSpeed command, i think it would be better if we would calculate the commanded speed but also with acceleration/deceleration.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Do you use the same microstepping? It can make the stepping rougher, especially with the lower divisions. The acceleration would be a little bit tricky with the joystick, but could be doable. However, I would write a code for it from scratch.
@ipadize
@ipadize 2 жыл бұрын
@@CuriousScientist i have set it to 1/16. i just did try out 1/2 step and dividing the maximum speed by 5 and when i hit the maximum speed then the motor runs nice but whenever i dont hit the maximum it runs rough. maybe i need to filter the joystick values but then i still dont have acceleration.
@ipadize
@ipadize 2 жыл бұрын
also the TMC2208 even at fullstep has a sinusoidal wave output to the stepper unlike for example the a4988 which has a rectangle output
@CuriousScientist
@CuriousScientist 2 жыл бұрын
@@ipadize what do you mean by the maximum speed, do you mean the setMaxSpeed()? That is the global maximum you can reach with the motor by accelerating or manually increasing the speed to the maximum speed. If your microstepping is 1/16, one turn will need 3200 steps. So, when you are not maxing out the joystick, you are at the lower end of the speed value for the motor. I am not sure, because I haven't used that driver before, but maybe it needs more current when it is forced to move with such microstepping. The acceleration would need a totally different approach, this code is written based on the idea that the user is manually accelerating by gradually moving the joystick to one of its end position. If the joystick is moved in that way, the acceleration is done manually by the user. I do not really see the need for acceleration. Why is it so necessary?
@ipadize
@ipadize 2 жыл бұрын
@@CuriousScientist yes i mean the setMaxSpeed. Whenever i hit that limit the output to the stepper motor is clean but when its under this limit then the output is "dirty". I have a homing routine at the start which has acceleration and runs completely clean so i think its inaccuracy from the joystick or missing filtering of the values. When the values are stuttering and there is no acceleration then the output will also stutter and make the stepper run rough. I will probably look at the step pin with my oscilloscope. i currently build a focus stacker for my camera which will have a linear and a rotary axis (for macrophotography, there is a shallow depth of field so by using a stacker i can take pictures in different positions of an object and then a software will render these images and basically the object will be sharp from front to back). Acceleration for jogging is not necessary but its nice to have. For the moves between images i will just use moveTo() and run().
@Thomas-ij7ki
@Thomas-ij7ki 2 жыл бұрын
You show the movement of one motor in much detail and repeated as in many other videos before but the movement of the two motors - the only interesting part of this video - only very short and superficial. In many videos from you it would be nice when you would concentrate more on the topic. Only as a critic. Nevertheless I like the topics of your videos.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Thanks! Why I did like that is because I think that the most important part is to understand how to control one motor. Then you can add an arbitrary number of motors just by adding the same type of variables and doing the same routine. Nevertheless, thanks for the feedback. These things sound different in my head and it sounds different for the viewer and it is good to hear how they perceive the content of the video.
@endurobikeparts3092
@endurobikeparts3092 2 жыл бұрын
thank you for this tutorial. I'm new to Arduino and it's really useful all this information. I used your code to control a single Nema 17 with an A4988 and a KY-023 joystick using only X axis and an arduino Nano.....and also with the help of your second tutorial "Let's discuss different stepper motor drivers" but impossible for it to work. the motor moves step by step and only in one direction and the joystick just gives information in one direction......it's a disaster. can you help me...... here is the modified code, you will see that the pin dir is in 2 and Pin pulse 3; joystick X is at A0. ......................................................................................................................................................................................................................................................................................... //If you found this code useful, please subsricbe to my channel: kzbin.info //It took several hours for me to prepare everything, but subscription is just a click for you. Thank you! //This code is used to test 4 different stepper motor driver circuits with the accelstepper library. //Stepper motor controllers: //EasyDriver //A4988 //DRV8825 //TB6600 #include AccelStepper stepper(1, 2, 3);// direction Digital 9 (CCW), pulses (or step) Digital 8 (CLK) const byte Analog_X_pin = A0; //x-axis readings //Pins const int MS1 = 7; //MS = microstepping const int MS2 = 6; const int MS3 = 5; //A4988 or DRV8825 without breakout board //Variables int Analog_X = 0; //x-axis value int Analog_X_AVG = 0; //x-axis value average //------------------------------------------------------------------------------- void setup() { Serial.begin(115200); //define a baud rate //Pin modes pinMode(MS1, OUTPUT); pinMode(MS2, OUTPUT); pinMode(MS3, OUTPUT); //A4988 or DRV8825 without breakout board //---------------------------------------------------------------------------- //PINS pinMode(Analog_X_pin, INPUT); //---------------------------------------------------------------------------- InitialValues(); //averaging the values of the 3 analog pins (values from potmeters) //---------------------------------------------------------------------------- //Microstepping setup digitalWrite(MS1, HIGH); digitalWrite(MS2, LOW); digitalWrite(MS3, LOW); //A4988 or DRV8825 without breakout board //---------------------------------------------------------------------------- //Accelstepper parameters stepper.setMaxSpeed(400); //SPEED = Steps / second stepper.setAcceleration(800); //ACCELERATION = Steps /(second)^2 stepper.setSpeed(500); stepper.enableOutputs(); //enable pins } void loop() { ReadAnalog(); stepper.runSpeed(); //step the motor (this will step the motor by 1 step at each loop indefinitely) } void ReadAnalog() { //Reading the 3 potentiometers in the joystick: x, y and r. Analog_X = analogRead(Analog_X_pin); //if the value is 25 "value away" from the average (midpoint), we allow the update of the speed //This is a sort of a filter for the inaccuracy of the reading if(abs(Analog_X-Analog_X_AVG)>25) { stepper.setSpeed(5*(Analog_X-Analog_X_AVG)); } else { stepper.setSpeed(0); } } void InitialValues() { //Set the values to zero before averaging float tempX = 0; //---------------------------------------------------------------------------- //read the analog 50x, then calculate an average. //they will be the reference values for(int i = 0; i
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Hi! First of all, copy-pasting the code is not a good idea because it is really hard to read it. Second, don't expect me to troubleshoot the source code for free, I am not a free support service. Check the cables, connections. Make sure you use the enable pin for the motor driver. Make sure you have the right polarity on the motor. Try swapping the DIR and STEP pins.
@endurobikeparts3092
@endurobikeparts3092 2 жыл бұрын
Thank you for your quick reply. the enable pin for the motor driver must be hight and connected: on your diagram "Let's discuss different stepper motor drivers" it is not connected. to help me solve this code you asked how much? now I have an error code: C:\Users\Laurent\Documents\Arduino\sketch_feb10a_2022_02_10_stepper_library\sketch_feb10a_2022_02_10_stepper_library.ino:11:9: error: #include expects "FILENAME" or #include .........stop for tonight
@CuriousScientist
@CuriousScientist 2 жыл бұрын
@@endurobikeparts3092 Not all drivers/boards require it, but some do. I can't see your circuit, so I cannot tell how it should be connected. If you follow my tutorial, it should work as I show the working example. You can see in the video that it works. For business inquiry, you can contact me via email.
@endurobikeparts3092
@endurobikeparts3092 2 жыл бұрын
hello, this morning I redid all the possible tests; with a DM542.....arduino uno.....arduino nano driver. I checked my voltages 5V and 12 V. checks all my connections.....connected like your example. with the complete code and also the simplified code for an engine. Nothing happens, it doesn't work for me... I'm going to try a simpler code with the Stepper.h library to see if I can get my Nema 17 to run..... It doesn't matter that I ask you again, I have to find the problem I have with my components..... thanks again for your advice.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Good luck with the project, I hope you will make it work!
Arduino and joysticks - Part 2 - 3-axis joystick
42:49
Curious Scientist
Рет қаралды 23 М.
Glow Stick Secret Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 18 МЛН
Dad Makes Daughter Clean Up Spilled Chips #shorts
00:16
Fabiosa Stories
Рет қаралды 6 МЛН
Coordinated stepper motor control (arduino)
47:11
iforce2d
Рет қаралды 354 М.
TB6600 and Arduino - Wiring and demonstration
15:39
Curious Scientist
Рет қаралды 96 М.
Big Stepper Motors with Arduino
29:43
DroneBot Workshop
Рет қаралды 1,2 МЛН
Arduino with AccelStepper library and TB6600 stepper motor controller
24:48
Closed loop stepper motors -- very impressive
10:46
Matthias random stuff
Рет қаралды 125 М.
Stepper Motors with Arduino - Controlling Bipolar & Unipolar stepper motors
50:22
Glow Stick Secret Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 18 МЛН