Thanks! Yes, the LCD is a big pain in the butt. With a faster device, it is probably less problematic. I will try it with the blue pill soon which is much faster (16 vs 72 MHz).
Thank you, clearly explained and exactly what I need to automate my macro photography rail . And a lot of learning. I am using a nano and an oled display as these are what I have to hand. A little code tweaking needed. As a non coder something of a challenge but I think I’ll get there. Perfect timing!
Thanks! I am glad that you could use my resources for your project! Keep looking around on my channel because there are other videos where I have very similar things to what you want to build.
Love you 3000... that's great, can you tell me how to start and stop step motor by start and stop buttons. That seem to be impossible for myself especially STOP step motor immediately
Hi! The answer for your questions can be found in most of my stepper motor related videos. Search for my stepper motor control panel, it is implemented there.
@@CuriousScientist I am sorry about that, but unfortunately seem to can not stop motor when running by a click button. I figure out lots of related videos and no one can control step motor by START STOP RESET buttons. To be honest. Hope you tell me the method. Peace
If it is interesting, I would like to make a suggestion for a plaslyst to complement your projects, which I will certainly follow for learning. there is a Display touch scren called Nextion 7 "that we can place an animation and automate a project with total control by the display touch. It will be quite an experience! Hugs!
This display looks promising. But I have two issues with it. It is way too expensive for my budget, and it might be that it requires too much resources (CPU time). For the stepper motor, it is very important to unload the CPU as much as possible. I don't know how "heavy" its library is.
Thanks. You have already asked a question under another video. I am not a free support service, so if the question is not related to the video, feel free to hire me as a consultant.
Hello, I am new to arduinos and stepper motors. Are there enough pins on a single arduino to have an LCD, rotary encoder, and two stepper motors (with TB6600s)? If you have a video on this subject, I could not find it. Thanks!
HI. Is there a way to get the " stepper.setAcceleration " to work with this code? I have stripped the code down to 2 buttons only. I have changed the RotateCounter++; to RotateCounter = (steps); ( steps = 0 ) Added stepper.setCurrentPosition(1000); and it homes back to (steps ) for one button and stepper.setCurrentPosition(-1000) for the other. As its 1000 steps i would have thought the stepper.setAcceleration Would work
Hi! Sure, but does it really make sense? In the original scenario, the motor mimics the movement of the rotary encoder which means that 1 click of the encoder is 1 step of the motor. You cannot turn the rotary encoder (by hand) so fast that you would need acceleration. So, it does not really make sense. Also, the functions I used do not implement acceleration (see the library's documentation). If you need acceleration, you will need to rewrite everything that moves the motor.
Not that I know about. That's why I explain every bit of it, so those who follow the video carefully can built it. Wiring, source code, everything is freely accessible on my website.
It is simple math. You have the units in steps/sec. But your question doesn't make any sense without knowing what mechanism is used with the stepper motor...
Can this work without the LCD and rotary hooked up? I'm trying to figure out how to make this circuit work with just the push buttons. Sorry new to this..
@@CuriousScientist Ok, so I just place a wire from the 5V on the UNO to the 5v rail on the breadboard and then a wire from the GND on the UNO to the rail on the breadboard?
Hello, I fantastico your videos, I am following and doing as your explanation, won another subscriber, Congratulations! I would like to collaborate with an information that I observed and I was desperate because it did not compile the file, kkkk, in reality I had not included the LCD library. "LiquidCrystal I2C". as it was not in the description below, I went to look for the reason and found how to include this library, only that was missing.
Thanks! The mentioned LCD library is in the source code. However, if you don't have it installed in your Arduino IDE, the compiler will complain about it.
Your encoder has 2 pins on one side ( Switch side) and 3 pins on the other side. From the schematic it looks like you wired one side of the switch to VCC and the other side of the switch GND. So that creates a short circuit when I push the switch. Obviously I'm missing something? But what?
Search for the "KY-040 rotary encoder" on Google. It has 5 wires: VCC, GND, SW, DT and CLK. VCC and GND is very obvious, DT and CLK is written in the source code and SW is not used. The software I used to draw the circuit does not have this specific encoder in the models (or at that time, I could not find it), so I just used a general one and indicated the connections to make it clear.
I bought the same encoder you used in your schematics in order to make this easy The encoder has 2 pins on one side labeled PIN 1 = Switch and pin 2 =GND. The other side has 3 pins labeled Out A, GND and Out B. None of this matches your schematic. Which pin is the equivalent CLK? DT? Which pin do I wire to VCC. Obviously the 5vcc can go to GND, it can't go to the output A or B and it cant go to Switch. There are no other pins left. Rotary-Encoder-For-Dummies.jpg (1600×1053) (thecustomizewindows.com) .
@@CuriousScientist Well actually it doesn't help. I bought all the same components in order to follow the schematic. Now that you have changed the components I don't have any reference to follow.
You could not buy the same components because the one I show in the video is also in the description of the video and it happens to be the KY-040 encoder. Check my website, this drawing for the 5-pin encoder. curiousscientist.tech/blog/building-a-coil-winder-part-2 You are welcome......
Yes you can do that. Just assign a pin to the button and when you press the button, use the moveTo() function of the accelstepper library to move to that absolute position. Of course you need to tailor the numbers to the specific setup, but once it is done, it works automatically.
@@CuriousScientist Thanks I want to make a locomotive turn table for a roundhouse. And I need it to be able to set a button for each track. Thanks again.
Yes, that is easy. You need a home position or zero position that you always use as a starting point. Then, you measure the number of steps from this home position to each tracks. Now, you know that track 1 is let's say 693 steps away from the home, track 2 is 4321 steps....etc. You note these values down and create variables in the code such as track1position = 693, track2position = 4321...etc. Then, you just have to use the buttons in a simple if() condition. In a very simplified algorithm: if(track1button == 1){steppermotor.moveTo(track1position);}. This says that if you pressed the button assigned to track 1, the accelstepper library will move to the track 1's position. The good thing about the moveTo() function is that it uses absolute positions, so for example if you are currently at track 6, the code will know that it has to move backwards to track 1. I hope this helps.
I'm moving a pool table back and forth and need to control acceleration. Basically I thing your setup without the Pot, just 2 buttons would work. one for CCW and one CW. Can you help me with the code?
Do you read my answers at all? I answered you twice already. Check my most recent video, there you have the solution. All code is published and every line of the code is explained in the video. I cannot do more than that, at least not for free.
@@CuriousScientist I think I have watched about 20 of your videos . Maybe I just didn't watch the right one yet but I haven't seen any way to hook up two buttons to actuate the motor. I will keep watching. Thanks for the GREAT content.
Without any offense, but if you want me to spoon-feed the info to you, then you will find button-controlled stepper motors in the following videos: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-4Wrt7swXjsQ.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-eVnZIuAVQEQ.html
@@CuriousScientist This is my first project so maybe I'm a bit slow to start. This circuit in this video would be perfect if it didn't have the Rotor Encode and LCD. Can I simply remove them from the circuit and hard code the maximum speed in the accelstepper parameter " stepper.setMaxSpeed(5000); //SPEED = Steps / second stepper.setAcceleration(1000); //ACCELERATION = Steps /(second)^2 "
Yes, you just remove the unnecessary hardware and the corresponding code and it will work. The LCD, the buttons and the rotary encode are all independent, so it will not influence anything if you remove them.
@@CuriousScientist Thank you very much for what you have shared. it works very well but in your program It limits position to 32767. When the motor reaches position 32767, it reverses the rotation and does not accept switch commands. If I want the motor to spin continuously without any limit. On which line do I have to edit the code?