0% found this document useful (0 votes)
6 views

Arduino

digital electronics

Uploaded by

ananyapandey6582
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Arduino

digital electronics

Uploaded by

ananyapandey6582
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Project : Space Station

• Our team is divided into 2 groups:


1. Encoders
2. IMU

We are working on encoders, our mentors are:

Aayush Jaiswal
Daksh Dua
Aniket Nandi
Varun Mahajan

What we have learnt in this week ??


We studied about Arduino and PID in the first 2-3 days of the
week. Then we started encoders.
After that we applied all the things practically . We controlled
a DC motor through encoder.
Arduino
Arduino is an open-source electronics platform based on easy-to-use hardware
and software. Arduino boards are able to read inputs - light on a sensor, a finger
on a button, or a Twitter message - and turn it into an output - activating a
motor, turning on an LED, publishing something online. You can tell your board
what to do by sending a set of instructions to the microcontroller on the board.
To do so you use the Arduino programming language (based on Wiring), and the
Arduino Software (IDE), based on Processing.

ARDUINO-UNO BOARD

PID CONTROL
PID is termed Proportional Integral Derivative. It is the device that is widely
employed in industrial regulatory applications for controlling process variables
such as pressure, temperature, speed, flow, and others. This device works with a
control loop feedback approach for the regulation of process variables and
provides results with more preciseness.Using the proportional, one can know
the error and this error helps in providing the corrective response value. The
proportional term is even termed as proportional gain constant. With integral,
the past error values are known and integrated. When the error values are
excluded from the system, then the integral value gets increased. And using
the derivative, the forthcoming error values are expected depending on the
current values.

We saw an example in which a drone tries to reach 50m of height.

How to control a DC motor using encoder?


In this project, a small DC Motor is controlled with an Arduino and a Motor Driver
IC where target
Is achieved via pid control system.
Connections
Encoder A output → DO pin 2
Encoder B output → DO pin 3
Encoder ground → Arduino GND
Encoder VCC → Arduino 5V
Motor terminal 1 → Motor driver output 1
Motor terminal 2 → Motor driver output 2
Power supply → Motor driver Vin/GND
Motor driver GND → Arduino GND
Motor driver PWMA input → Arduino pin 5 [pwm]
Motor driver IN1 input → Arduino pin 7
Motor driver IN2 input →Arduino pin 6
Encoders and working of System
For this we will use a rotary encoder. A rotary encoders senses
the rotatory changes and converts them to electrical signals
hence determining the position.
For clockwise movement the output A will be triggered first and
for anticlockwise the output B. By reading the output of B, we
are increasing or decreasing the value of position for > 0 and
<0 respectively.
We have set a random target which is a Sinusoidal function of
time for which the constants of PID that we have taken are
Kp = 1
Kd= 0.025
Ki = 0 as there after achieving target we don’t want it to
continue moving snd to overshoot.
Here we have taken the assumption that derivative is (pos-
target) /Delta T and
Eintegral=eintegral+error*deltaT where Delta t is current Time
– previous time.
The control signal is Kp* error+Kd*dedt. According to given
feedback response about u if u>0 or u<0 the motor will rotate
clockwise or anticlockwise accordingly moving towards the
target. Error =pos- target. Also if the absolute value goes above
255 it would reach to it’s limit. I. e pwr= 255.

You might also like