In this video, I demonstrate how to use PID Control to synch the positions of two motors with encoders by only using two interrupt pins on the Arduino.
Check out this Reference Desk Mat for Arduino:
amzn.to/3vO6QBl
Video Timestamps:
0:00 - Introduction
0:33 - PID Control for a single motor
0:40 - Parts needed
0:46 - Pin out for the motor and encoder
0:58 - Wiring the circuit
1:16 - Arduino code for one motor
4:40 - Selecting the gains
5:27 - Beginning of two motor example
5:32 - Updating the wiring for two motors
5:58 - Arduino code for two motors
7:29 - Selecting the gains for the two motor example
7:58 - Conclusion
The code for the section with PID control for a single motor was adapted from what was presented in this video below. I have no incentive to reference this video, but it's a great resource for other projects:
• How to control a DC mo...
👉Subscribe for more robotics and engineering tips:
/ @theboredrobotllc
Share this video with a friend:
• Synchronizing Motor Po...
Website:
www.theboredrobot.com/
Parts needed for this example:
Arduino Uno - amzn.to/3pGK6Am
Gear Motors with Encoder - amzn.to/3Fszeuj
Power Supply - amzn.to/3DKs2sF
Motor Shield - amzn.to/3Qtbeh6
(Note: This shield is a different one from the example. Make sure the pin assignments line up with the the documentation for the shield.)
Connect:
Instagram - /theboredrobot
Twitter - @theboredrobot
Facebook - / theboredrobot
Pinterest - /TheBoredRobot
Disclaimer: This video contains affiliate links, meaning that if you make a purchase from one of the product links, I'll receive a small commission.
Негізгі бет Ғылым және технология Synchronizing Motor Position with Encoders, PID Control and Arduino
Пікірлер: 78