![]() If the robot tilts at an angle, then in the frame of the wheels, the center of mass of the robot will experience a pseudo force that will apply a torque opposite to the direction of tilt.įigure 1. The robot is prevented from falling by giving acceleration to the wheels according to the robot's inclination from the vertical axis. The MPU-6050, the PCA9685, and the L298N modules create a feedback control loop, as shown in Figure 1, which balances the robot and automatically corrects its position upon disturbance. Note: The complete example code for this NetBeans IDE 8.0.2 project can be downloaded here. It uses a GPIO interface to produce the direction signal and connects to the PWM module to activate and control the speed of each motor. L298N dual H-bridge DC motor driver, which controls the speed and direction of the two robot motors.It uses an I2C interface at address 0x41h to prevent the Raspberry Pi from producing a software pulse that forces a large delay in CPU response. Adafruit PCA9685, which is a 16-channel, 12-bit pulse width modulation (PWM) servo driver that produces pulses at a desirable frequency to control motor speed.The sensor uses an I2C interface at address 0圆8h to read a value raw that contains the accelerometer and gyroscope data. The accelerometer measures linear acceleration and earth gravity vectors and the gyroscope measures angular velocity. MPU-6050 sensor, which contains a three-axis gyroscope and an accelerometer.This article, which is the first in a new series, focuses on using two types of interfaces, GPIO and I2C, to create a prototype two-wheel self-balancing robot using the following modules: In my last four-part series of articles, I explained how to connect electronic sensors or devices to the Raspberry Pi 2 Model B using various interfaces: Part 1 showed how to use general-purpose input/output (GPIO) interfaces, Part 2 used inter-integrated circuit bus (I2C) interfaces, Part 3 used universal asynchronous receiver transmitter circuit (UART) interfaces, and Part 4 used serial peripheral interface (SPI) interfaces. ![]() Learn how to build a two-wheel self-balancing Java robot using Raspberry Pi. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |