I wanted to connect two stepper motors to an Arduino Mega using DM542T stepper motor drivers, watched several videos, and your video was the only one that had correct wiring that worked. Thanks ❤
Excellent. I have the same motor and driver. I just need to add a button to start the motor in FWD and another button to start the motor in REV. Thanks again.
I hope the channel continues to grow I want to request a TB6600 driver, nextion display for stepper motors and arduino can be united, please make a tutorial. I'm sure many people saw it
Most of the time, it's a good practice to connect the zero volts (ground) from the power sup to the zero volts of the Arduino Uno (ground)? most of the time, it avoids some issues, like noise or spikes... good video at the right pace!
Thank you! Yes, sometimes it is useful and/or necessary to connect the common points. For example if you want to measure voltage (otherwise the Arduino's reference can be shifted as compared to the voltage sources 0 V). In this application it is not necessary, it works without it, but I have other type of controllers, where it is necessary to connect the Arduino's GND (which I believe it is more like a COM (common)) to the power supply's negative pole.
@@CuriousScientist I spent more than 35 years of working on electronic automation as PLC, CNC, etc, connecting all zero volt together and to the ground solved many issues... But 35 years ago, electronic was different!!!
This is an interesting video of a stepper wired for Common Anode mode. I see you did another also covering the sketch. Can you do a video covering Common Cathode mode please as most Arduino sketches are based on that mode? Why? I trying to run 3 x Nemer 23 with Uno plus TB6600 form an antenna impedance matching unit for Amateur Radio Antenna. The aim is to use a tandem match bridge to sense reflected antenna voltage on A0 and then have the 3 x 23s turn a capacitor/inductor combination for minimum reflected voltage. It is a very interesting project and your ideas on it would be very welcome. Cheers from OZ.
Hi! They don't really differ as far as I know. Common anode is active low, so you have the positive supply connected to the positive pins of the driver while switching the negative pins. Common cathode is when you have the opposite: negative pins go to a common negative terminal while you are switching the positive pins. This is an active high configuration. I guess both should work with the TB6600. On the other hand, sorry but I don't make videos for requests for free. I don't have the time and resources for that.
Best wiring instructions for Arduino, step controller and step motor. Can you show us how to make Arduino and TB6600 run CNC machine. Your explanation of steps are very logical and simple. Thanks!
Thanks! If you provide me the parts, sure! For CNC, I would need several motors, axes, controllers...etc. I won't just go and buy the parts and make a freely available tutorial, sorry. I only work with stuff I have at home, or I am interested in. I could do many more stuff, but I do not fulfill requests for free.
Hello, can I ask what's the part that you connect to the 9v power supply that connects tot grnd and vcc? I've been looking for what that thing is called and that's the last part that I'm looking for
Hi! Google "DC power jack screw terminal". Just pay attention to the diameter, it can be 2.1 mm and 2.5 mm too. It is also listed on my website specifically made for this purpose, to help people to find parts: curiousscientist.tech/tools Cheers!
Give me help when i keep stepper motor in stop condition, motor draw current which is not good for my product , how to reduce this type problem , please reply me .
@Curious Scientist. What current and voltage settings were you applying to the stepper? SInce the adapter has a 24V range, wouldn't it be kind of dangerous to be putting in a 24 V and 3A setting to power the stepper. It seems like you are putting in 12V and 2.8A-3A if I'm not wrong
Hi! I do not exactly remember the details, but I usually use my small variable power supply (see description) for this demonstration which can do 24 V and 3 A max. I think, it was at ~14-18 V and well, the current was depending on the motor's hunger. If you are interested, I could measure it for you. I promised some testing for another viewer, and this weekend I will do it on the very same setup that you see on this video.
Hello, how do i controll the stop position step of the stepper motor . For example is want the stepper motor rotate to 100 step and hold for few second and than comeback to the previous position. I hope i can get the answer🙏🏻
Hi! You should watch my other stepper motor-related videos, I have a plenty of them. This video for example can be helpful: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-0Xi7unlq1L4.html
Thanks! The ENA doesn't lock the motors but it switches the current off. It can happen that current flows through the coils of the motor even when it is standing still which can lead to overheating. ENA turns off the current basically.
Well, the best thing is to actively control it. Turn it on when (before) the motor must move and turn it off when you don't need the motor to be energised.
Sure, you can skip the breadboard. It was just more convenient for me to demonstrate it. I would just wire it up in the same way, but without a breadboard.
I wrote my own code, based on the AccelStepper library. Please check the link in the description that leads you to my other AccelStepper video. That video has a Pastebin link for the full source code.
Thanks! Yes, as far as I know that's how 3D printer's work (CNC). The firmware which is usually installed on an Arduino Mega-based board takes the G-code from the slicer and performs the actions defined in the code. There are different shields for this as well. They can take several stepper motor drivers.
Depends on how many connections you have available and which controller you are using. The TB6600 basically just needs 2 pins as well as the A4988. To run 4 motors independently, it is more about coding and not hardware. Many of the 3d printers have the Mega as the motherboard, and they can accommodate 5 drivers/motors.
The controller should work with anything that creates pulses. I could even make a motor move by connecting a pulse generator wheel to it. However, I don't know if the accelstepper library works on it, I haven't tested it. But I assume that it should work. There is nothing hardware-specific in the code.
Preferably, just use 5V. If you have a higher voltage, then you'll need current limiting resistors. Read the datasheet because I don't remember all the details.
Thank you for video! One question. Can two stepper motors be connected to one driver and run in sync? I got two nema23 motors that I want to use them for simulator steering wheel force feedback.
Hi John! Yes, they have! So, in the video I have the following order: B-: blue, B+: red, A- green, A+: black. Please check the code I wrote in the other video I put in the description. If I give the command for positive rotation with this order of wiring, it will move counterclockwise. If I flip the wires of -for example- A (A+: green, A-: black), the motor will also flip directions and it will move clockwise with the same command. I, personally don't care about the wiring, because I can always override it within the software. For me, the only thing that matters is that I connect the same coils to the same terminals.
Order of pairs only influence the direction as far as I know. I also know a another test which doesn't need any instruments. Short two of the cables and rotate the shaft of the motor. If you feel resistance in rotation, you found a coil and its two wires.
Great video! I have just one question, can I connect 2 stepper motors to the same motor driver? Can I just connect the second stepper motor wires to the motor driver and run it at the same direction and same speed?
Hello, question relating to wiring.. Should the GND of the Arduino be connected to the ground of the 12vdc power supply to make sure both grounds are at same potential. If yes, should that be the same practice when using a dc motor driver, etc. Normally should it be a good practice to connect all GND together when using different sources of dc supplies ?
Hi! In general it is a good idea, yes. Actually, some drivers require it, some don't because the supply ground and the logic ground is connected in the circuit. If your motor doesn't work and the only missing part is the interlinked grounds (btw, there's a reason why it is also called as _common_ (COM)), then connect them. In the TB6600 it is a bit different. If you see, the three positive control pins, en, step and dir are connected to the MCU's +5V, and their negative parts are connected to the corresponding gpio pins. So, whenever they are toggled, they sink and they pull the pins to ground, so essentially in the moments of switching, the whole system's gnd is common. If I understood correctly.
You can have it connected the other way around, too. It depends on if the inputs are active high or active low, if I remember correctly. Check the datasheet of the TB6600.
I think most of the functions can do both speed and acceleration control. If you check the documentation of the AccelStepper library, you will see that some of the functions (i.e. runSpeedToPosition()) do no use acceleration. But majority of it does. If you check the end of the video, you see that I control both acceleration and speed.
Yes! Map its value to a selected range and update the speed of the stepper motor based on the position of the potentiometer. But it is more elegant to use rotary encoders.
What about the ground wire , I have the same driver , but my control board require connection to 4 pins : step , dir , grn and +5v , can you advise if the minus pull and minus dir act as grn pin ?????????? Thank you , I am in the process of assembling the wiring and this was my issue , thank you for help
Hi! As far as I am concerned, the NEMA motors are only up to NEMA 42. However, The NEMA 23 is 57 mm x 57 mm so I will assume that you are actually asking about the NEMA 23. In that case the answer is yes.
I'm brand new to Steppert motors but I'm a fairly quick learner my friend. Thanks for the brilliant videos and information but I wanted to ask u question if u have the time to answer.. Q. Can all this be used in conjunction with CAD & CAM, etc to be able to run my own home built CNC Router machine or would it be far more difficult than I think?? I really want to build my own CNC. I have bought 2 steppers with the drivers to run the gantry up and down the table and one for the More to move the router over and back side to side. I want to get a better motor for move the spindle up and down but I'm a little lost atm. I'm about to open my own small woodworking shop and I eventually want to build a decent sized CNC Router to help grow my small business. I still work fulltime atm but eventually I want to go out on my own with a workshop of my own. The links to the Arduino on Banggood are not the real thing my friend. U know that right? They're a copy of some kind but not the Arduino I saw at my work place today.. Do they work as well as the real ones or should I get the arduino parts? I have bought the Aluminium and pulleys, etc but as I said I'm a little lost atm. I'm not going to rush this bcos eventually I will want to use this experience to build better and bigger than the 1200mm by 800mm CNC that I have in mind right now.. I hope u don't mind me commenting on here like this. I would be very grateful if u could let me know anything about the questions I have concerning the CNC home build.. I don't want to use steel to build bcos I don't want to go thru all the issues with metal warping under heat and all that entails so I will stick with Aluminium extrusions I have been investing in..
Hi! Yes, you can build your own CNC machine based on DIY parts. Several people already did it. Also, there are many shared resources where you can make your Arduino compatible with GRBL and enable it to control CNC machines. Just search for "Arduino GRBL". There is no such thing as a "real Arduino" by the way... Yes, there are the official Arduino boards, but the design itself is an open-source microcontroller board design based on Atmega chips. Even I designed and made my own Arduino, and anyone can do it.
@@CuriousScientist Thanks very much for ur reply pal. I'm new to all of this type of thing but I really want to build one. I bought a load of 2020 1200mm Aluminium Extrusion, other parts to put them together and I got the V Slot wheels, and parts to run them along the sides of the aluminium. I also got stepper motors and the TB6600 drivers. I have 2 motors, Nema 17 type with the Drivers as well but how good should the motor for the spindle housing be? I'm not sure which Axis this one is atm but I'm learning all the time. I went on Banggood tonight and bought 3 UNO3 for a small amount so I hope they're ok. Everybody says they are compatible. The job I work at uses boards for Routers for companies like BT in England but they have contracts all around the world. I'm new to my job and I've never worked in this field b4 but I'm beginning to pick it up fairly quick now. One of the guys I work with showed me the Arduino board the other day. They have them in my job but I only saw it on Friday. TBH I don't know anything about programming or coding but I want to and I will work hard to learn CAD/CAM,etc and I will become fairly good at it down the line. I appreciate u taking the time to reply to my comment my friend. It's really appreciated.Take it easy my bro..
Typically you can buy ready-made housing for the spindle. Alternatively, a lot of makers make 3d printed bracket for them. It is up to you. I wish you good luck on the learning journey. Don't be afraid of failures and keep trying. You'll get there if you stay motivated!
Is it possible to connect another type of motor to that driver? The motor I want to use is a servo motor composed of a multi-turn potentiometer and a DC motor, without control circuit board for the position of the motor, just only five cables, two for the dc motor, + and -, and three for the pot, ccw, cw and s. I have been looking for information about my motor and how to conect it to the driver and an arduino mega, but I can't find anything and I would be grateful if you could help me. Thank you
This driver is for stepper motors. That's why you won't find any information about how to connect it with a DC motor. You need a DC motor driver. TB6612FNG is, for example, a good choice if your motor is not too large.
@@CuriousScientist I have looked for more information about my motor and it is supposed to be a stepper motor. The model is HDM: L2.105.1311/01, SERVO GEAR MOTOR, Subcategory Stepper Motor.
If the motor has only 2 wires, then it is definitely not a stepper motor because a stepper typically has at least 4 wires. 2 for each coils. I tried to search for a datasheet based on the data you provided, but I did not succeed. But if it has 2 wires, it is safe to assume that it is a DC motor. Connect it to a variable power supply, set the current limit to a low value and gradually increase the voltage. If the power supply hits the current limit, increase the limit just a little bit. Observe if the motor is getting hot. If it starts to spin, then it is a DC motor. If it does not spin, then probably something else. If it is a stepper, there must be at least two more wires there somewhere.
@@CuriousScientist I just opened the enclosure and it is a DC motor with 2 cable (+ & -) and it is connected with gears to a 10 turn precision potentiometer like the model 7286R10KL.25 with 3 cable (ccw, cw & s) When I turn the shaft of the motor, the gears connected to the shaft moves the potentiometer at same time
I would like to home the motor and tell it to rotate x steps ftom home. Am I thinking correctly: Opto 5v pin goes to Uno 5v pin, Signal goes to maybe pin 10 and third wire goes to GRN pin on Uno?
It is still unclear why you need the optocoupler. Optocoupler is needed when you, for example, want to switch a low voltage signal with a high voltage signal or the other way around. A limit switch for homing is typically operated at 3.3 or 5 V, there's no need for an optocoupler.
Maybe I'm not using the right name, I see it's called several different things.... it's an IR Optocoupler Interupter, the type of sensor commonly used in reprap 3d printers for limit control and homing of axis
Yeah, that's an optical limit switch (photo interrupter), typically a phototransistor module. In that case, your first comment was almost correct. However, pin such "GRN" does not exist. Probably, you meant "GND" (ground).
I don't really understand what you mean. First of all, stepper motors don't have "digital pins". They only have "analog pins" if we want to be precise. 2 pairs for each coil in the motor. The demo code I provided uses 2 digital pins only, but those pins (step and direction) go to the stepper motor driver first. Then the driver has 4 output pins which are then connected to the motor's four pins.
@@CuriousScientist i tried to run the example code for "onerevolution" under stepper, the example uses 4 pins (pins 8 to 11) but i only have 2 pins available coming from my driver to arduino which are the PUL and DIR.
The amount of drivers depend on the board you use. For the Uno, you can for example buy shields that support 5 drivers. The limit switches depend on you. It depends on how you want to use them; poll them or use them with interrupts. I have a huge playlist for stepper motors, check it!
@@CuriousScientist do you have to buy shields to get the 5 or utilize just the uno directly ? Isn't the shield so you can use the drivers that come with it ? Thank.
Shields are not mandatory to use, but they make your life much easier because it is much more simple to connect everything. On the other hand, you will always need drivers, you cannot drive the motors directly from the Arduino. This is a whole kit for 4 motors: www.banggood.com/custlink/DKDyi3Db8z and this is a whole kit for 5 motors: www.banggood.com/custlink/3m3yIKvAl8
i have used a4988 and DRV8825 drivers and both gets very hot after using for few seconds then the motor start playing funny , becuase both drivers gets very hot even with heat sink applied , does the driver your using TB6600 has problem with high temperature ?@@CuriousScientist
Ah, now I understand! Thanks! We'll, if your driver overheats, first you should adjust the current. Probably, it is set to the max value, which is way too much for a NEMA17 motor with a regular load. If you use the TB6600 with its highest current setting it will also overheat the motor. So, first before getting a new driver, try to adjust the current on the ones you have.
I am using the arduino UNO + TB6600 + Nema17 + 24volt 5 Amp power. When I use micro stepping then motor moves smoothly but when I use at non microstepping mode then after few rotation motors halts and only sound will come. I am trying to achieve rpm around ~600 . is it possible to achieve with this configuration? thanks
It sounds like that you are not using acceleration but you're trying to start the motor immediately at 600 RPM. Check my other stepper motor-related videos where I show how to use the AccelStepper library and implement accelerations. The motor needs to be accelerated to the required RPM values. Nema17 should be capable of ~1800 RPM max.
@@CuriousScientist thanks for the your reply. I have used increasing acceleration and in that only for few rounds it rotates then stops and only sound wiill come (like it's increasing) then at the end when it de accelerate it again start to move.
Sorry, I don't know this language, so I will reply in English. Yes, I posted a 14 minutes video without posting the code. First of all, who are you to demand anything from me for free?? Second, you should maybe read the description where it is written that you can find the source code under another video that focuses more on the code part. This video is focusing on the wiring and assembly. Oh, and be careful, the other video where I explain the code is even longer.
@@CuriousScientist Primeiro de tudo: Não estou exigindo. A frase expressa uma crítica moderada. Não fique chateado comigo. Falo português, por isso não entendi direito seu vídeo sobre o código. Eu estou fazendo um trabalho pra faculdade. Só preciso que me responda nesse vídeo. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-usYdMPWf7xw.html Aprecio seu trabalho.
When selecting a power supply for my motor. Does output current, input voltage, and power rating matter? Or do I only look at output voltage that I will need
This is obviously a good topic for your RU-vid views (although it has no meaning to me). Look at the views. Use the same keywords and do more of these type videos and see if views increase!
Actually, I love working with stepper motors. I am planning to put more work into these kind of videos, actually, my most recent video (12 July) is also in this topic. And one of my most viewed video with over 10k views is also with stepper motors. But it is sad to see that not even 5% of the viewers of that video have subscribed. But what is even more sad is the fact that more than 2100 people have downloaded the source code that I freely provided in that video and not even half of it subscribed in exchange for my efforts. Obviously, no one asked for these videos and codes, but it looks like it helps many people, yet they can't even click a button to "return the favor".
@@CuriousScientist you have to ask. Psychologically the law of reciprocity will force most people to have the urge to return a favor. They just don't know how unless you tell them what to do.
I am trying to incorporate "begging" in my recent videos, but it is not easy. Slowly but surely, I will find a way to efficiently do it without disrupting the video too much. I don't know if you have noticed, but now, there is a logo in the bottom right corner over the video where people can subscribe. Maybe that will help too.
Arduino: 1.8.14 Hourly Build 2020/09/23 10:33 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)" The sketch name had to be modified. Sketch names must start with a letter or number, followed by letters, numbers, dashes, dots and underscores. Maximum length is 63 characters. TB6600_and_Arduino_-_Wiring_and_demonstration:22:10: fatal error: AccelStepper.h: No such file or directory #include ^~~~~~~~~~~~~~~~ compilation terminated. exit status 1 AccelStepper.h: No such file or directory This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
like everything else that i try this does nothing but lock the motor up I copied your code from your website and installed the accelstepper.h using the installation tool in the Arduino software. i get no errors at all but it does not turn. is there a is there a smaller bit of source code I could try? The source code I copied is quite lengthy maybe I copied the wrong bit?
If it locks the motor up, you did not follow the video properly. The same code is shown in the video and as you can see it, it works for me without any issues. You can test your system with simpler the examples provided in the AccelStepper library.
@@CuriousScientist I HAVE RECHECKED MY WIRING OVER AND OVER ITS PERFECT. oops caps lol I can run the regular stepper code included with the Arduino ide and it runs it, maybe my dip switches?
I don't really know without seeing what you built or how you use my code. If you followed the video and copied the code, it should work. Do you by chance mixed the direction and step pins?
@@CuriousScientist no i have checked all of these many many times, this is very very simple mt 12v power supply is only rated for 1.4 amps.....but the stepper I'm using should work with that