\documentclass[11pt,twoside]{article}\makeatletter

\IfFileExists{xcolor.sty}%
  {\RequirePackage{xcolor}}%
  {\RequirePackage{color}}
\usepackage{colortbl}
\usepackage{wrapfig}
\usepackage{ifxetex}
\ifxetex
  \usepackage{fontspec}
  \usepackage{xunicode}
  \catcode`⃥=\active \def⃥{\textbackslash}
  \catcode`❴=\active \def❴{\{}
  \catcode`❵=\active \def❵{\}}
  \def\textJapanese{\fontspec{Noto Sans CJK JP}}
  \def\textChinese{\fontspec{Noto Sans CJK SC}}
  \def\textKorean{\fontspec{Noto Sans CJK KR}}
  \setmonofont{DejaVu Sans Mono}
  
\else
  \IfFileExists{utf8x.def}%
   {\usepackage[utf8x]{inputenc}
      \PrerenderUnicode{–}
    }%
   {\usepackage[utf8]{inputenc}}
  \usepackage[english]{babel}
  \usepackage[T1]{fontenc}
  \usepackage{float}
  \usepackage[]{ucs}
  \uc@dclc{8421}{default}{\textbackslash }
  \uc@dclc{10100}{default}{\{}
  \uc@dclc{10101}{default}{\}}
  \uc@dclc{8491}{default}{\AA{}}
  \uc@dclc{8239}{default}{\,}
  \uc@dclc{20154}{default}{ }
  \uc@dclc{10148}{default}{>}
  \def\textschwa{\rotatebox{-90}{e}}
  \def\textJapanese{}
  \def\textChinese{}
  \IfFileExists{tipa.sty}{\usepackage{tipa}}{}
\fi
\def\exampleFont{\ttfamily\small}
\DeclareTextSymbol{\textpi}{OML}{25}
\usepackage{relsize}
\RequirePackage{array}
\def\@testpach{\@chclass
 \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
  \ifnum \@lastchclass=7 5 \else
   \ifnum \@lastchclass=8 \tw@ \else
    \ifnum \@lastchclass=9 \thr@@
   \else \z@
   \ifnum \@lastchclass = 10 \else
   \edef\@nextchar{\expandafter\string\@nextchar}%
   \@chnum
   \if \@nextchar c\z@ \else
    \if \@nextchar l\@ne \else
     \if \@nextchar r\tw@ \else
   \z@ \@chclass
   \if\@nextchar |\@ne \else
    \if \@nextchar !6 \else
     \if \@nextchar @7 \else
      \if \@nextchar (8 \else
       \if \@nextchar )9 \else
  10
  \@chnum
  \if \@nextchar m\thr@@\else
   \if \@nextchar p4 \else
    \if \@nextchar b5 \else
   \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
   \fi \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi}
\gdef\arraybackslash{\let\\=\@arraycr}
\def\@textsubscript#1{{\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
\def\abbr{}
\def\corr{}
\def\expan{}
\def\gap{}
\def\orig{}
\def\reg{}
\def\ref{}
\def\sic{}
\def\persName{}\def\name{}
\def\placeName{}
\def\orgName{}
\def\textcal#1{{\fontspec{Lucida Calligraphy}#1}}
\def\textgothic#1{{\fontspec{Lucida Blackletter}#1}}
\def\textlarge#1{{\large #1}}
\def\textoverbar#1{\ensuremath{\overline{#1}}}
\def\textquoted#1{‘#1’}
\def\textsmall#1{{\small #1}}
\def\textsubscript#1{\@textsubscript{\selectfont#1}}
\def\textxi{\ensuremath{\xi}}
\def\titlem{\itshape}
\newenvironment{biblfree}{}{\ifvmode\par\fi }
\newenvironment{bibl}{}{}
\newenvironment{byline}{\vskip6pt\itshape\fontsize{16pt}{18pt}\selectfont}{\par }
\newenvironment{citbibl}{}{\ifvmode\par\fi }
\newenvironment{docAuthor}{\ifvmode\vskip4pt\fontsize{16pt}{18pt}\selectfont\fi\itshape}{\ifvmode\par\fi }
\newenvironment{docDate}{}{\ifvmode\par\fi }
\newenvironment{docImprint}{\vskip 6pt}{\ifvmode\par\fi }
\newenvironment{docTitle}{\vskip6pt\bfseries\fontsize{22pt}{25pt}\selectfont}{\par }
\newenvironment{msHead}{\vskip 6pt}{\par}
\newenvironment{msItem}{\vskip 6pt}{\par}
\newenvironment{rubric}{}{}
\newenvironment{titlePart}{}{\par }

\newcolumntype{L}[1]{){\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{){\centering\arraybackslash}p{#1}}
\newcolumntype{R}[1]{){\raggedleft\arraybackslash}p{#1}}
\newcolumntype{P}[1]{){\arraybackslash}p{#1}}
\newcolumntype{B}[1]{){\arraybackslash}b{#1}}
\newcolumntype{M}[1]{){\arraybackslash}m{#1}}
\definecolor{label}{gray}{0.75}
\def\unusedattribute#1{\sout{\textcolor{label}{#1}}}
\DeclareRobustCommand*{\xref}{\hyper@normalise\xref@}
\def\xref@#1#2{\hyper@linkurl{#2}{#1}}
\begingroup
\catcode`\_=\active
\gdef_#1{\ensuremath{\sb{\mathrm{#1}}}}
\endgroup
\mathcode`\_=\string"8000
\catcode`\_=12\relax

\usepackage[a4paper,twoside,lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1in,marginparwidth=0.75in]{geometry}
\usepackage{framed}

\definecolor{shadecolor}{gray}{0.95}
\usepackage{longtable}
\usepackage[normalem]{ulem}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{marginnote}

\renewcommand{\@cite}[1]{#1}


\renewcommand*{\marginfont}{\itshape\footnotesize}

\def\Gin@extensions{.pdf,.png,.jpg,.mps,.tif}

  \pagestyle{fancy}

\usepackage[pdftitle={Design of PID Controller for Direction Control of Robotic Vehicle},
 pdfauthor={}]{hyperref}
\hyperbaseurl{}

	 \paperwidth210mm
	 \paperheight297mm
              
\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{3}
\clubpenalty=8000
\emergencystretch 3em
\hbadness=4000
\hyphenpenalty=400
\pretolerance=750
\tolerance=2000
\vbadness=4000
\widowpenalty=10000

\renewcommand\section{\@startsection {section}{1}{\z@}%
     {-1.75ex \@plus -0.5ex \@minus -.2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\Large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
     {-1.75ex\@plus -0.5ex \@minus- .2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\Large}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
     {-1.5ex\@plus -0.35ex \@minus -.2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\large}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
     {-1ex \@plus-0.35ex \@minus -0.2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\normalsize}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
     {1.5ex \@plus1ex \@minus .2ex}%
     {-1em}%
     {\reset@font\normalsize\bfseries}}


\def\l@section#1#2{\addpenalty{\@secpenalty} \addvspace{1.0em plus 1pt}
 \@tempdima 1.5em \begingroup
 \parindent \z@ \rightskip \@pnumwidth 
 \parfillskip -\@pnumwidth 
 \bfseries \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}\par
 \endgroup}
\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
\def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
\def\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
\@ifundefined{c@section}{\newcounter{section}}{}
\@ifundefined{c@chapter}{\newcounter{chapter}}{}
\newif\if@mainmatter 
\@mainmattertrue
\def\chaptername{Chapter}
\def\frontmatter{%
  \pagenumbering{roman}
  \def\thechapter{\@roman\c@chapter}
  \def\theHchapter{\roman{chapter}}
  \def\thesection{\@roman\c@section}
  \def\theHsection{\roman{section}}
  \def\@chapapp{}%
}
\def\mainmatter{%
  \cleardoublepage
  \def\thechapter{\@arabic\c@chapter}
  \setcounter{chapter}{0}
  \setcounter{section}{0}
  \pagenumbering{arabic}
  \setcounter{secnumdepth}{6}
  \def\@chapapp{\chaptername}%
  \def\theHchapter{\arabic{chapter}}
  \def\thesection{\@arabic\c@section}
  \def\theHsection{\arabic{section}}
}
\def\backmatter{%
  \cleardoublepage
  \setcounter{chapter}{0}
  \setcounter{section}{0}
  \setcounter{secnumdepth}{2}
  \def\@chapapp{\appendixname}%
  \def\thechapter{\@Alph\c@chapter}
  \def\theHchapter{\Alph{chapter}}
  \appendix
}
\newenvironment{bibitemlist}[1]{%
   \list{\@biblabel{\@arabic\c@enumiv}}%
       {\settowidth\labelwidth{\@biblabel{#1}}%
        \leftmargin\labelwidth
        \advance\leftmargin\labelsep
        \@openbib@code
        \usecounter{enumiv}%
        \let\p@enumiv\@empty
        \renewcommand\theenumiv{\@arabic\c@enumiv}%
	}%
  \sloppy
  \clubpenalty4000
  \@clubpenalty \clubpenalty
  \widowpenalty4000%
  \sfcode`\.\@m}%
  {\def\@noitemerr
    {\@latex@warning{Empty `bibitemlist' environment}}%
    \endlist}

\def\tableofcontents{\section*{\contentsname}\@starttoc{toc}}
\parskip0pt
\parindent1em
\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
\newenvironment{reflist}{%
  \begin{raggedright}\begin{list}{}
  {%
   \setlength{\topsep}{0pt}%
   \setlength{\rightmargin}{0.25in}%
   \setlength{\itemsep}{0pt}%
   \setlength{\itemindent}{0pt}%
   \setlength{\parskip}{0pt}%
   \setlength{\parsep}{2pt}%
   \def\makelabel##1{\itshape ##1}}%
  }
  {\end{list}\end{raggedright}}
\newenvironment{sansreflist}{%
  \begin{raggedright}\begin{list}{}
  {%
   \setlength{\topsep}{0pt}%
   \setlength{\rightmargin}{0.25in}%
   \setlength{\itemindent}{0pt}%
   \setlength{\parskip}{0pt}%
   \setlength{\itemsep}{0pt}%
   \setlength{\parsep}{2pt}%
   \def\makelabel##1{\upshape ##1}}%
  }
  {\end{list}\end{raggedright}}
\newenvironment{specHead}[2]%
 {\vspace{20pt}\hrule\vspace{10pt}%
  \phantomsection\label{#1}\markright{#2}%

  \pdfbookmark[2]{#2}{#1}%
  \hspace{-0.75in}{\bfseries\fontsize{16pt}{18pt}\selectfont#2}%
  }{}
      \def\TheFullDate{2014 2014-01-15 (revised: 1 Year 2014 15 January 2014)}
\def\TheID{\makeatother }
\def\TheDate{2014 2014-01-15}
\title{Design of PID Controller for Direction Control of Robotic Vehicle}
\author{}\makeatletter 
\makeatletter
\newcommand*{\cleartoleftpage}{%
  \clearpage
    \if@twoside
    \ifodd\c@page
      \hbox{}\newpage
      \if@twocolumn
        \hbox{}\newpage
      \fi
    \fi
  \fi
}
\makeatother
\makeatletter
\thispagestyle{empty}
\markright{\@title}\markboth{\@title}{\@author}
\renewcommand\small{\@setfontsize\small{9pt}{11pt}\abovedisplayskip 8.5\p@ plus3\p@ minus4\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus2\p@
\belowdisplayshortskip 4\p@ plus2\p@ minus2\p@
\def\@listi{\leftmargin\leftmargini
               \topsep 2\p@ plus1\p@ minus1\p@
               \parsep 2\p@ plus\p@ minus\p@
               \itemsep 1pt}
}
\makeatother
\fvset{frame=single,numberblanklines=false,xleftmargin=5mm,xrightmargin=5mm}
\fancyhf{} 
\setlength{\headheight}{14pt}
\fancyhead[LE]{\bfseries\leftmark} 
\fancyhead[RO]{\bfseries\rightmark} 
\fancyfoot[RO]{}
\fancyfoot[CO]{\thepage}
\fancyfoot[LO]{\TheID}
\fancyfoot[LE]{}
\fancyfoot[CE]{\thepage}
\fancyfoot[RE]{\TheID}
\hypersetup{citebordercolor=0.75 0.75 0.75,linkbordercolor=0.75 0.75 0.75,urlbordercolor=0.75 0.75 0.75,bookmarksnumbered=true}
\fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}}

\date{}
\usepackage{authblk}

\providecommand{\keywords}[1]
{
\footnotesize
  \textbf{\textit{Index terms---}} #1
}

\usepackage{graphicx,xcolor}
\definecolor{GJBlue}{HTML}{273B81}
\definecolor{GJLightBlue}{HTML}{0A9DD9}
\definecolor{GJMediumGrey}{HTML}{6D6E70}
\definecolor{GJLightGrey}{HTML}{929497} 

\renewenvironment{abstract}{%
   \setlength{\parindent}{0pt}\raggedright
   \textcolor{GJMediumGrey}{\rule{\textwidth}{2pt}}
   \vskip16pt
   \textcolor{GJBlue}{\large\bfseries\abstractname\space}
}{%   
   \vskip8pt
   \textcolor{GJMediumGrey}{\rule{\textwidth}{2pt}}
   \vskip16pt
}

\usepackage[absolute,overlay]{textpos}

\makeatother 
      \usepackage{lineno}
      \linenumbers
      
\begin{document}

             \author[1]{C. S.  Mala}

             \author[2]{S.  Ramachandran}

             \affil[1]{  BMS Institute of Technology}

\renewcommand\Authands{ and }

\date{\small \em Received: 8 December 2013 Accepted: 5 January 2014 Published: 15 January 2014}

\maketitle


\begin{abstract}
        


A PID Controller has been designed and incorporated into the Robot based Agricultural System.  This system comprises a Robotic Vehicle which navigates through the field in the desired direction performing tilling or de-weeding as it moves. The PID control system has been designed for automatic steering and speed control of the Robotic Vehicle. The PID control system continuously checks and corrects the direction of travel to keep the vehicle on the desired track.  PID Control equations for Discrete Time Domain have been derived and validated by using MATLAB. Functional tests were carried out using ModelSim. The hardware results were finally validated using MATLAB again.  The direction accuracy achieved is better than 0.01%.

\end{abstract}


\keywords{PID controller, robot control, agricultural automation, speed control, steering control.}

\begin{textblock*}{18cm}(1cm,1cm) % {block width} (coords) 
\textcolor{GJBlue}{\LARGE Global Journals \LaTeX\ JournalKaleidoscope\texttrademark}
\end{textblock*}

\begin{textblock*}{18cm}(1.4cm,1.5cm) % {block width} (coords) 
\textcolor{GJBlue}{\footnotesize \\ Artificial Intelligence formulated this projection for compatibility purposes from the original article published at Global Journals. However, this technology is currently in beta. \emph{Therefore, kindly ignore odd layouts, missed formulae, text, tables, or figures.}}
\end{textblock*}


\let\tabcellsep& 	 	 		 
\section[{Introduction}]{Introduction}\par
he Robotic Vehicle is primarily designed to till the field to the specified length and breadth. The movement of the vehicle in any direction be it forward or reverse, should be in a straight line. Otherwise, the vehicle may move haphazardly, not tilling the ground in a straight line. If this operation is carried out manually, the throughput is painfully low. If the entire agricultural operation is carried out using Robotic vehicle, such as the proposed one, which is unmanned, then great care has to be taken to ensure that the movement of the vehicle is in the desired direction always. This calls for an automated feedback system, which keeps track of the wheel direction of the vehicle, compares it with the set direction, and takes corrective measure in case of any deviation from the set direction. There are many techniques reported to achieve the direction control or speed control of the wheels of automatic unmanned vehicles using PID controller.\par
A tele\textunderscore operated, farmland information collecting robot \hyperref[b0]{[1]} was developed using PID Controller and PWM principle \hyperref[b1]{[2]}. An ideal PID controller is described by  {\ref Wang Hongxing [3]} for a farm land information collecting robot.\par
For tuning of the PID controller parameters, critical proportioning methods are used \hyperref[b3]{[4]}. A PID Controller developed using 8051 microcontroller \hyperref[b4]{[5]}\hyperref[b5]{[6]} has been briefly explained with programming done in embedded C. Suying Yang, Miaomiao Gao, Jianying Lin, and Zhuohan Li have worked on PID controller IP Core for temperature control in System on a Programmable Chip (SOPC). The authors have described the PID Control algorithm using HDL on FPGA \hyperref[b6]{[7]}. They have designed PID controller IP core to make temperature tests to the control object with features of inertia and pure delay. Avalon bus is used for connecting processor to the peripherals.\par
Guoshing Huang and Shuocheng Lee have explained the PC based PID speed control in DC Motor \hyperref[b7]{[8]} using Lab view. It uses Vis Sim software simulator to analyze its response. The signals have been acquired through NI DAQ USB-6008 card. The parameters are adjusted to control the motor speed by using the Lab view aided PID controller.\par
Zhen Wang and Lingshun Liu \hyperref[b8]{[9]} have designed a control system using the microcontroller TMS320LF2407A for sampling and regulating the speed of the DC Motor and have used AT89C51 microcontroller for inputting and displaying the speed of the DC Motor.\par
Junyao Gao et al. \hyperref[b9]{[10]} have designed control methods for unmanned vehicle. For steering control of the wheels, the authors have applied a complex mathematics using a multistep neural network. Fuzzy Genetic Algorithm (GA) PID control method is used for the turning control of wheels.\par
An Intelligent Control for a Crawling Unmanned Vehicle \hyperref[b10]{[11]} have been designed by Dr. Kwang Hwa Lee. An adaptive feedback controller is designed by using a combination of PID and Adaptive Neural network Fuzzy Logic.\par
Xiaogang Ruan, Qiyuan Wang and Naigong Yu, have designed Dual-loop Adaptive Decoupling Control for Single Wheeled Robot based on Neural PID Controller \hyperref[b11]{[12]}. They have used Newton-Euler equations in their design to achieve wheel control.\par
Migara H. et al. have designed a Robotic Arm with Hydraulic actuators operated by servo valves \hyperref[b12]{[13]}. Each joint position is controlled by a PID based system. The system was modeled using MATLAB-SIMULINK tool box.\par
M. S.  \hyperref[b11]{[12]}. They have used Newton-Euler equations in their design to achieve wheel control.\par
Migara H. et al. have designed a Robotic Arm with Hydraulic actuators operated by servo valves \hyperref[b12]{[13]}. Each joint position is controlled by a PID based system. The system was modeled using MATLAB-SIMULINK tool box.\par
M. S. For tracking stabilization of Robot Motion, a new variable structure PID controller design is considered \hyperref[b14]{[15]}. A certain PID sliding motion of a controller with PID sliding surface is substantiated for a robotic manipulator. Lyapunov full quadratic form and upper and lower matrix norm inequalities are formulated for sliding and global stability. This control algorithm is applied to robot arm through simulations and the authors have found that the control function is satisfactory.\par
An approach for a remote PID controller design have been presented by Hui Zhang et al \hyperref[b15]{[16]}. They have first developed the design method for Static Output Feedback (SOF) Controller, and using this PID controller has been designed. The SOF Controller has been designed using Bernoulli random binary distribution and matrix inequalities.\par
Chaoraingern J et al. \hyperref[b16]{[17]} have designed PID Controller using Coefficient Diagram Method (CDM) for track following control of hard disk drive. It is based on proper selection of the characteristic transfer function of the closed loop control system. They have shown through MATLAB simulation results that CDM design is quite stable.\par
Marino R et al. \hyperref[b17]{[18]} have designed a nested PID control for lane keeping autonomous vehicles which are vision based. The steering angle is the control input and it is designed taking into account yaw rate and the central offset measured by a gyroscope and vision system respectively. The simulations were carried out on Standard Big Sedan CarSim Vehicle model. Saidonar M. S. et al. \hyperref[b18]{[19]} have considered only differential steering control with proportional control methods for a mobile robot. The current velocities of the right and left wheel are used to determine the current position of the mobile robot The velocity and angular velocity of the robot helps to determine the number of encoder pulses that have to be fed to the DC motors connected to the right and left wheel. The proportional controller is used to produce the same speed for both right and left wheel to ensure the movement of the robot in a straight line.\par
Veerachari Mummadi \hyperref[b19]{[20]} has proposed a digital PID controller for H bridge soft switching boost Converter. The author has formulated the mathematical models of the H bridge using the system identification tool and has used in the PID design. Designing the PID Controller has been done using Pole Placement Technique (PPT) together with Sensitivity Function Shaping (SFS).\par
PID Controller has been designed in this work for automatic steering and speed control of the Robotic Vehicle. PID Control equations for Discrete Time Domain are presented and validated by using MATLAB in this section.\par
The paper is organized as follows.  
\section[{II. Pid Control System}]{II. Pid Control System}\par
The PID controller produces an output signal comprising three terms-one proportional to error signal, another proportional to integral of error signal and the third one proportional to the derivative of error signal. Fig. \hyperref[fig_1]{1} presents the PID controller in its expanded form. u(t) = K p e(t) + (K p /T i ) ?e(t) dt + K p T d (d/dt) e(t) (1) or u(t) = K p e(t) + K i ?e(t) dt + K d (d/dt) e(t)\textbf{(2)}\par
where,u(t) = Total Corrected Error, K p = Proportional Gain, T i = Integral Time, T d = Derivative time, K i = Integral Gain = K p /T i and K d = Proportional Gain = K p T d .\par
The proportional control stabilizes the gain but produces a steady state error. The integral control reduces or eliminates the steady state error. The derivative control reduces the rate of change of error. For example, in steering control, if the reference or set direction is 180 degrees and if the robot is moving off from the set direction, say, to 182 degrees, then the controller dynamically corrects the wheel speeds in such a manner that the robot moves closer to 180 degrees. The frequency at which the measured direction is input is called the sampling rate. Higher the sampling rate, greater will be the precision in correcting the error. The PID control is also achieved at the same rate. 
\section[{a) Derivation of Discrete Domain PID Controller Equations}]{a) Derivation of Discrete Domain PID Controller Equations}\par
Fundamental PID Controller equations were presented in the previous section. In this section, discrete domain equations are so derived that it is amenable for Verilog RTL coding. To start with, the following assumptions are made:? Number of samples = n,\par
? Sample rate (say, 25 Hz depending on the sensor employed) = SR,\par
? Desired direction of the Robot = set\textunderscore dir, and? Actual measured direction from a digital compass = dir (n).\par
The difference between the set and the measured directions naturally is the error expressed as Eq. 3.e(n) = set\textunderscore dir -dir(n)\textbf{(3)}\par
Overall Error computed by the Proportional, Integral and Differential terms of the PID Controller may be derived from Eq. ( \hyperref[formula_0]{2}) and is presented in Eq. (4). u(n) = K0 * e(n) + K1 * e(n-1) + K2 * integral (n) \hyperref[b3]{(4)} where K0, K1 and K2 are constant gain factors for the Proportional, Differential and Integral terms respectively and integral (n) = integral (n-1) + (set\textunderscore dir -dir (n))/SR \hyperref[b4]{(5)} As an approximation, we get the corrected direction:dirn (n) = set\textunderscore dir + (K2/K0) * integral(n) -u(n)/K0 + [(u(n-1)/K0)/(K2/(K1*SR) + K0/K1)]\textbf{(6)}\par
Equation ( \hyperref[formula_5]{6}) gives the corrected direction.\par
In order to get the value of the corrected direction closer to the reference set direction, various values of K0, K1 and K2 were experimented with in the above equation using MATLAB. Optimum values arrived at for these gain constants are presented in the next section. 
\section[{b) MATLAB Realization of PID Controller}]{b) MATLAB Realization of PID Controller}\par
The PID Controller equations derived in the previous section has been coded in MATLAB and results of the corrected direction and the set direction for different gain constant values have been presented in Fig. \hyperref[fig_3]{2} for the Optimum Gain constants. For this set of gain constants, the corrected direction is closest to the set direction with the least overall error. The values for average direction, average error and overall error for different sets of K0, K1, and K2 have also been computed and presented in Table \hyperref[tab_2]{1}.    
\section[{Block Diagram of the Proposed Robotic Vehicle with pid Controller}]{Block Diagram of the Proposed Robotic Vehicle with pid Controller}\par
The block diagram of PID controller designed for the Robotic Vehicle is presented in Fig. 3. The system comprises the following functional blocks: Digital Compass, PID Controller, Robotic Controller and DC Motor Controller.\par
A digital compass is used for measuring the earth's magnetic field. It has a built in UART interface and can be readily used with any FPGA, ASIC or Microcontroller based design. The measuring range of the compass is 0 to 360 degrees and it has a resolution of 0.1 degree and an accuracy of 1 degree. The frequency response is 25 Hz. The initial reading is set as is convenient for the field to be tilled. It is the reference direction in which the vehicle is continuously expected to navigate.  The digital compass starts transmitting the measured value serially on its TX line. The reception baud rate is also 9600. One direction value is received as 7 bytes. The First and second Bytes are 0D H and 0A H respectively. Then the three bytes of data representing the measured direction in ASCII format is received. This is followed by 2E (being Byte 6) indicating decimal point. Byte 7 is the digit after the decimal point. As an example, for 350.0 degrees, the third byte to seventh byte is 33 H, 35 H, and 30 H respectively.\par
Since the ASM charts for the entire design are numerous, the ASM chart for the PID Controller only is presented as an example in Fig. 4. The main function of this module is to read the current direction of the robotic vehicle, check for deviation from the set direction at 25 Hz sample rate, calculate the error and correct the direction of the vehicle. The vehicle is kept at the desired direction by controlling the pulse width of the right wheels, whereas the pulse width of the left wheel is kept constant.\par
The PID Controller starts functioning only after receiving a valid "enable\textunderscore pidc" signal from the main controller. Once the module is enabled, it waits for the direction data output from the Digital Compass module. It acquires the direction data only after getting a valid "data\textunderscore valid" signal. The first direction data received is treated as the "set\textunderscore dir" (meaning set direction) for the vehicle. The successive "dir" data received is then compared with the "set\textunderscore dir" and the corresponding error "e(n)" is computed. Thereafter, the PID corrected error "u(n)" is calculated which is the sum of proportional, integral and the differential errors to compute the corresponding corrected direction "dirn".\par
Once the corrected direction is calculated, the next task of the PID Controller is to derive the pulse widths for the left and the right wheels. For this purpose, a free running counter "pwidthm" is used, whose terminal count corresponds to 100 \% duty cycle. For the left wheels, the counter value is compared with the "set\textunderscore dir" value, which is equivalent to about 67\% duty cycle pulse width and a high pulse output is issued at output pin "pwidthm\textunderscore l" for the condition: (start\textunderscore pwidthm = 1) \& (pwidthm <= set\textunderscore dir). Otherwise, Logic "0" is output. Similarly, for the right wheels, a high pulse output is issued at output pin "pwidthm\textunderscore r" for the condition: (start\textunderscore pwidthm = 1) \& (pwidthm <= dirn).      The direction is controlled by only the duty cycle of the two pulses. This is achieved by keeping the duty cycle of left wheel constant ("pwidthm\textunderscore l" low for "pwidthm = 3500") with respect to set direction (set\textunderscore dir = 3500), whereas the duty cycle of right wheels is determined based on the corrected direction value "dirn". When the set direction and the corrected direction values are equal, the pulse width for all the four wheels is same. In this example, the measured direction "dir" is 350.0. It may be noted that when the current PID computed Robot direction "dirn" matches (3491 meaning 349.1 degrees) the current running counter value "pwidthm", then the right wheels pulse width output "pwidthm\textunderscore r" is forced low, thus correcting the Robot direction to 349.1 degrees. Although the actual error "e(n)" is zero in this case, the PID computed error "u(n)" is -1. This error is made up in the next sample. 
\section[{VI.}]{VI.}\par
Validation of Verilog rtl Design using Matlab\par
Various directions such as the set direction (set\textunderscore dir), measured direction (dir), PID corrected direction (dirn) and the corresponding pulse width (pwidthm\textunderscore r) that controls the right wheels of the Robot are plotted using MATLAB for 40 samples of Digital Compass and is presented in Fig. 10. The waveform reveals that the direction correction effected by the RTL code is more effective than even MATLAB in spite of using less precision in Verilog coding, thus validating the Robotic Controller Design.   
\section[{Conclusion}]{Conclusion}\par
A PID Control System for Robot based Agricultural System has been designed. As an example, the set direction is taken to be 350 degrees and the Digital Compass continuously gives out the measured direction at the sample rate of 25 Hz. The number of samples taken is 40 for testing. The PID control system continuously checks and corrects the direction of travel to keep the vehicle on the desired track. PID Control equations for Discrete Time Domain have been derived and coded in Verilog RTL. Functional tests were carried out using ModelSim. The hardware results were finally validated using MATLAB. The direction accuracy achieved is better than 0.01\%.\begin{figure}[htbp]
\noindent\textbf{}\includegraphics[]{image-2.png}
\caption{\label{fig_0}}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{1}\includegraphics[]{image-3.png}
\caption{\label{fig_1}Figure 1 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{}\includegraphics[]{image-4.png}
\caption{\label{fig_2}}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{2}\includegraphics[]{image-5.png}
\caption{\label{fig_3}Figure 2 :}\end{figure}
          \begin{figure}[htbp]
\noindent\textbf{1} \par 
\begin{longtable}{P{0.048295454545454544\textwidth}P{0.07485795454545455\textwidth}P{0.08451704545454544\textwidth}P{0.06761363636363636\textwidth}P{0.20525568181818182\textwidth}P{0.1714488636363636\textwidth}P{0.19801136363636362\textwidth}}
Sl. No.\tabcellsep K0\tabcellsep K1\tabcellsep K2\tabcellsep Avg.\tabcellsep Avg. Error\tabcellsep Overall error\\
\tabcellsep \tabcellsep \tabcellsep \tabcellsep Direction\tabcellsep \tabcellsep in feet\\
1\tabcellsep 1/8\tabcellsep 1/32\tabcellsep 2/1\tabcellsep 350.0024\tabcellsep -0.0024\tabcellsep -0.0128\\
2\tabcellsep 1/8\tabcellsep 0\tabcellsep 2/1\tabcellsep 350.1875\tabcellsep -0.1875\tabcellsep -0.9817\\
3\tabcellsep 1/8\tabcellsep 1/32\tabcellsep 0\tabcellsep 350.5859\tabcellsep -0.5859\tabcellsep -3.0680\\
4\tabcellsep 1/4\tabcellsep 1/32\tabcellsep 2/1\tabcellsep 350.3446\tabcellsep -0.3446\tabcellsep -1.8042\\
5\tabcellsep 1/16\tabcellsep 1/32\tabcellsep 2/1\tabcellsep 348.0040\tabcellsep 1.9960\tabcellsep 10.4512\\
6\tabcellsep 1/8\tabcellsep 1/16\tabcellsep 2/1\tabcellsep 348.9060\tabcellsep 1.0940\tabcellsep 5.7284\\
7\tabcellsep 1/8\tabcellsep 1/32\tabcellsep 1/4\tabcellsep 350.4825\tabcellsep -0.4825\tabcellsep -2.5265\\
8\tabcellsep 1/16\tabcellsep 1/32\tabcellsep 1/4\tabcellsep 350.0093\tabcellsep -0.0093\tabcellsep -0.0488\\
9\tabcellsep 1/8\tabcellsep 1/32\tabcellsep 1/16\tabcellsep 350.5591\tabcellsep -0.5591\tabcellsep -2.9276\\
III.\tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \tabcellsep \end{longtable} \par
 
\caption{\label{tab_2}Table 1 :}\end{figure}
 			\footnote{© 2014 Global Journals Inc. (US)} 		 		\backmatter  			  				\begin{bibitemlist}{1}
\bibitem[Marino et al. ()]{b17}\label{b17} 	 		\textit{A nested PID steering control for lane keeping in vision autonomous vehicles},  		 			R Marino 		,  		 			S Scalzi 		,  		 			G Orlando 		,  		 			M Netto 		.  		2009. p. .  	 
\bibitem[Jafarov et al. (2005)]{b14}\label{b14} 	 		‘A New Variable Structure PId-Controller Design for Robot Manipulators’.  		 			E M Jafarov 		,  		 			M N A Parlaksi 		,  		 			Y Istefanopulos 		.  	 	 		\textit{IEEE transactions on Control Systems Technology}  		Jan 2005. 13 p. .  	 
\bibitem[Lee ()]{b10}\label{b10} 	 		\textit{An Intelligent Control for a Crawling Unmanned Vehicle},  		 			Dr. Kwang Hwa Lee 		.  		 MTS 0-933957-28-9.  		2009. p. .  	 
\bibitem[Chaoraingern et al. ()]{b16}\label{b16} 	 		 			J Chaoraingern 		,  		 			Ladkrabang 		,  		 			W Vaidee 		,  		 			T Trisuwannawat 		,  		 			A Numsomran 		.  		\textit{11 th International Conference on Control, Automation and Systems},  				2011. p. .  	 
\bibitem[Xiaokai ()]{b5}\label{b5} 	 		\textit{Design and Research of Reactive Control System of DC Motor Based on MCU of C8051F},  		 			Liu Xiaokai 		.  		2005. 12 p. .  		 			He Bei University of Technology 		 	 
\bibitem[Cheng et al. ()]{b0}\label{b0} 	 		\textit{Design of PID controller based on Information Collecting Robot in Agricultural Fields},  		 			Yuzhu Cheng 		,  		 			Yong Chen 		,  		 			Hongxing Wang 		.  		978-1-4244-9763-8/11, IEEE 2011. p. .  	 
\bibitem[Mummadi ()]{b19}\label{b19} 	 		‘Design of Robust Digital PID Controller for H-Bridge Soft-Switching Boost Converter’.  		 			Veerachary Mummadi 		.  	 	 		\textit{IEEE Transactions on Industrial Electronics}  		2011. 58  (7)  p. .  	 
\bibitem[Hu ()]{b4}\label{b4} 	 		\textit{Development of an information collection robot body in agricultural fields},  		 			Na Hu 		.  		2009.  		 			Nan Jing Forestry University 		 	 
\bibitem[Blas et al. ()]{b1}\label{b1} 	 		‘Fractional PID Controllers for Industry Application-a Brief Introduction’.  		 			M Blas 		,  		 			Vinagre 		,  		 			A Concepción 		,  		 			Monje 		.  	 	 		\textit{Journal of Vibration and Control}  		2007. 7 p. .  	 
\bibitem[Migara and Liyanage ()]{b12}\label{b12} 	 		\textit{Nicholas Krouglicof and Raymond Gosine Design and Control of a High Performance Scara Type Robotic Arm with Rotary Hydraulic Actuators},  		 			H Migara 		,  		 			Liyanage 		.  		2009. p. .  	 
\bibitem[Huang and Lee ()]{b7}\label{b7} 	 		\textit{PC based PID speed control in DC Motor},  		 			Guoshing Huang 		,  		 			Shuocheng Lee 		.  		2008. IEEE. p. .  	 
\bibitem[Hongxing ()]{b3}\label{b3} 	 		\textit{Research on the Control System of Farmland Information Collecting Robot},  		 			Wang Hongxing 		.  		2008.  		 			NanJing Forestry University 		 	 
\bibitem[Zhang et al. (2011)]{b15}\label{b15} 	 		‘Robust Stastic Output Feedback Control and Remote PID design for networked motor Systems’.  		 			Hui Zhang 		,  		 			Yang Shi 		,  		 			Aryan Saadat Mehr 		.  	 	 		\textit{IEE transactions on Industrisl Electronics}  		Dec 2011. 58 p. .  	 
\bibitem[Ruan and Wang (2010)]{b11}\label{b11} 	 		 			Xiaogang Ruan 		,  		 			Qiyuan Wang 		,  		 			Naigong 		.  		\textit{Dualloop Adaptive Decoupling Control for Single Wheeled Robot based on Neural PID Controller, 11 th Int. Conf. Control, Automation, Robotics and Vision},  				December 2010. p. .  	 
\bibitem[Saidonar and Desa ()]{b18}\label{b18} 	 		 			M S Saidonar 		,  		 			H Desa 		,  		 			RudzuanM 		.  		\textit{A differential steering control with proportional controller for an autonomous mobile robot, 7 th International Colloquium on Signal Processing and its Applications},  				2011. p. .  	 
\bibitem[Wang and Liu ()]{b8}\label{b8} 	 		\textit{The design of a speed regulator of DC Motor based on TMS320LF2407A and AT89C51},  		 			Zhen Wang 		,  		 			Lingshun Liu 		.  		2010. IEEE.  	 
\bibitem[Zhou Yijun ()]{b2}\label{b2} 	 		‘The Improved critical proportioning method used for self-tuning of PID parameters’.  		 			Zhou Yijun 		.  	 	 		\textit{Process Automation and Instrumentation},  				 (ess Automation and Instrumentation)  		2002. 1 p. .  	 
\bibitem[Tsoeu and Esmail (2011)]{b13}\label{b13} 	 		‘Unconstrained Model Predictive Control (MPC) and PID Evaluation for Motion Profile Tracking Application’.  		 			M S Tsoeu 		,  		 			M Esmail 		.  	 	 		\textit{The Falls Resort and Conference Centre},  				 (Livingstone, Zambia)  		September 2011.  	 
\bibitem[Gao et al. ()]{b9}\label{b9} 	 		‘Unmanned Vehicles Intelligent Control Methods Research’.  		 			Junyao Gao 		,  		 			Jianguo Zhu 		,  		 			Boyu Wei 		,  		 			Shilin Wang 		.  	 	 		\textit{The Ninth International Conference on Electronic Measurement \& Instruments ICEMI},  				2009. p. .  	 
\bibitem[Yang et al.]{b6}\label{b6} 	 		 			Suying Yang 		,  		 			Miaomiao Gao 		,  		 			Jianying Lin 		,  		 			Zhuohan Li 		.  		 IEEE 2010.  		\textit{The IP Core Design of PID Controller based on SOPC, International Conference on Intelligent Control},  				p. .  	 
\end{bibitemlist}
 			 		 	 
\end{document}
