Это видео недоступно.
Сожалеем об этом.
How to make three motors move in Sync with MINDSTORMS and SPIKE
HTML-код
- Опубликовано: 17 авг 2024
- Please like and ask any questions you have in the comments!
Get the T-Shirt on: shop.spreadshi...
Support my work on: / antonsmindstorms
For complete building instructions and in-depth articles go to:
www.antonsmind...
How to run two motors at the same time (motor synchronization)
In this video, I'll explain how you can run motors to different positions simultaneously. Running these motors at the same time is difficult with LEGO MINDSTORMS or SPIKE Prime because the move-to-position block finishes the complete movement before going to the next block. To show you how this works, I'll use this Ladybug model. The Ladybug model needs to move one set of legs backward while moving another set forward. Furthermore, this model needs to tilt to the correct side every time it moves its propulsion legs.
You can follow this video with three motors connected to your LEGO hub. For the full experience, you can download the building instructions for this SPIKE Prime Ladybug on my website. This tutorial works for both LEGO MINDSTORMS and SPIKE Prime. I'm going to use the SPIKE app.
Why do we need synchronization?
Why is this tutorial important? Let me show you. If we do not run motors at the same time, we can still make the ladybug walk. We can program the robot to run each motor in turn. What you then get is this movement. It works, but it looks clunky. It's robotic in a bad way. Wouldn't it be much smoother if the legs moved at the same time?
Option 1
The first option for running motors at the same time is selecting multiple motors in the blue block. Let's see how that works. The problem here is that you can choose only one target per set of motors. Multiple motors will not work for our ladybug because one set of legs has to run forward while the other runs backward. I could cheat by moving this pin here. But then I will not be able to turn on the spot anymore.
Option 2
Our next option is to broadcast a message. If we broadcast, we can start several stacks at the same time. Every motor in every stack will start together at the moment of the broadcast. Let's have a look at that.
Option 3
Our third option is to use the pink movement block. LEGO provided this block to drive straight with a robot. To drive straight, the robot wheels need to move at precisely the same speed. They should also stop together and start together. We can use that behavior for other purposes than driving. Let me show you how that works with the ladybug.
Finally, we want to tilt left and right, based on the position of the movement legs. Here's how that works.
If you have learned a thing or two about programming in this video, it is a great idea to hit the subscribe button. I'm making new MINDSTORMS and SPIKE tutorials all the time. If you want me to explain a specific subject, please leave a comment!
After this video, it's fun to build a program that moves the ladybug backward or makes it turn. If you download my building instructions, you will get a full program with the complete solution.
If you liked this video, you could support me on Patreon. Patreon supporters who pay $10 or more also get every new building instruction I make. Thanks for watching!
Support my work on: / antonsmindstorms
Yo, this is so helpful. Been playing with the code a bit trying to figure out the little weird parts of it. Super helpful man keep it up!
Glad to hear it!
Love you videos! Can you please make more videos for 51515 alone for those who are not lucky enough to have Spike as well? Being Spike so expensive compared to what you get, I think most people will have 51515 only, at least that's my case. Thanks!
THANKS APPRECIATED
wederom een zeer boeiende en informatieve film. #dankjewel
Thanks for the videos
Awesome!!
Hi, thank you for sharing. May I know if I can use Mindstorms EV3 set to build and program it? Currently I only have EV3, and find the EV3 CLASSROOM is different from 51515 set software. It looks like EV3 software does not have some of the coding blocks 51515 has. Thanks a lot!
Thank you. Very well explained. That helped loads! Subscribed. :-)
Hi, Anton. i have an rc i want to move with multiple motors, any idea how i can program it to do that? please let me know. :)
Is there a simple way to have motors running in parallel in Python? The rotation of each is specific so I can't use the MotorPairs. Thanks Anton
Yes. It's on my github: github.com/antonvh/mpy-robot-tools
Is there a way I can get 4 motors to go at once?
Anton, a perfect channel. I wish there was a block to synchronize 4 motors at once. Let's say I have 4-legged and I want all 4 legs to be in perfect sync. Any ideas how to do it?
In other words I'm looking into executing two parallel movement blocks for infinite time. If I just start two movement and then Stop Movement, only one of them stops.
I made a video about this with Gelo. I also created some python boiler plate to make it really easy.
How to give MINDSTORMS GELO a natural walk and make him do hand plants with Python
ruclips.net/video/GRdy6kBNJLM/видео.html
Sometimes while using the broadcast block, multiple receive commands don’t work at the same time. Please help me find a solution
What have you tried?
@@AntonsMindstorms I set up 2 receive blocks for one broadcast, I made it so the receive blocks aligns 2 motors each, then the 2 motors move synchronized. So the left side of the robot moves 2 motors backwards, right side moves 2 motors forwards. But how do I synchronize the left and right side? This was very hard to explain. Perhaps I can send some sort of media (pic or video)?
@@D1S0- Have you tried 4 receive blocks, instead of one per side?
@@AntonsMindstorms sorry for replying so late, I didn’t get a notification for some odd reason, what I wrote might have been a bit confusing to read. To sum it up, I’m trying to synchronize 4 motors but make 2 turn right, and make the other 2 turn left. Maybe there’s a better way to achieve this? They need to be perfectly synchronized because I’m making a quadruped robot dog.
@@D1S0- Yes. The solution is the same as I mentioned a week ago.