{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 17:Advanced Electdrical Controls For Fluid Power Systems"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Example 17.1 pgno:610"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "  Results:  \n",
      "\n",
      " The repeatable error of system is  in. 0.00138\n"
     ]
    }
   ],
   "source": [
    "# Aim:To determine the system accuracy of electrohydraulic servo system\n",
    "# Given:\n",
    "# servo valve gain:\n",
    "G_SV=0.15; #(in^3/s)/mA\n",
    "# cylinder gain:\n",
    "G_cyl=0.20; #in/in^3\n",
    "# feedback transducer gain:\n",
    "H=4; #V/in\n",
    "# weight of load:\n",
    "W=1000; #lb\n",
    "# mass of load:\n",
    "M=2.59; #lb.(s^2)/in\n",
    "# volume of oil under compression:\n",
    "V=50; #in^3\n",
    "# system deadband:\n",
    "SD=4; #mA\n",
    "# bulk modulus of oil:\n",
    "beta1=175000; #lb/in^2\n",
    "# cylinder piston area:\n",
    "A=5; #in^2# Solutions:\n",
    "# natural frequency of the oil,\n",
    "om_H=A*(((2*beta1)/(V*M))**0.5); #rad/s\n",
    "# value of open-loop gain,\n",
    "open_loop=om_H/3; #/s\n",
    "# amplifier gain,\n",
    "G_A=open_loop/(G_SV*G_cyl*H); #mA/V\n",
    "# repeatable error,\n",
    "RE=SD/(G_A*H); #in\n",
    "\n",
    "# Results:\n",
    "print\"\\n  Results:  \"\n",
    "print\"\\n The repeatable error of system is  in.\",round(RE,5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 17.2 pgno:610"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "  Results:  \n",
      "\n",
      " The repeatable error of system is  cm. 0.00352\n"
     ]
    }
   ],
   "source": [
    "# Aim:To determine the system accuracy of in SI units\n",
    "# Given:\n",
    "# servo valve gain:\n",
    "G_SV=2.46; #(cm**3/s)/mA\n",
    "# cylinder gain:\n",
    "G_cyl=0.031; #cm/cm**3\n",
    "# feedback transducer gain:\n",
    "H=4; #V/cm\n",
    "# mass of load:\n",
    "M=450; #kg\n",
    "# volume of oil:\n",
    "V=819; #cm**3\n",
    "# system deadband:\n",
    "SD=4; #mA\n",
    "# bulk modulus of oil:\n",
    "beta1=1200; #MPa\n",
    "# cylinder piston area:\n",
    "A=32.3; #cm**2\n",
    "from math import ceil\n",
    "# Solutions:\n",
    "# natural frequency of the oil,\n",
    "om_H=(A*10**-4)*(((2*beta1*10**6)/(V*10**-6*M))**0.5); #rad/s\n",
    "# value of open-loop gain,\n",
    "open_loop=om_H/3; #/s\n",
    "# amplifier gain,\n",
    "G_A=open_loop/(G_SV*G_cyl*H); #mA/V\n",
    "# repeatable error,\n",
    "RE=SD/(G_A*H); #cm\n",
    "# rounding off the above answer,\n",
    "RE=round(RE)+(round(ceil((RE-round(RE))*100000))/100000); #cm\n",
    "\n",
    "# Results:\n",
    "print\"\\n  Results:  \"\n",
    "print\"\\n The repeatable error of system is  cm.\",RE"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Chapter 17.3 pgno:612"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "  Results:  \n",
      "\n",
      " The tracking error of system is  in. 0.104\n",
      "\n",
      " The tracking error of system in SI Unit is  cm. 0.264\n"
     ]
    }
   ],
   "source": [
    "# Aim:Refer Example 14-3 for Problem Description\n",
    "# Given:\n",
    "# servo valve current saturation:\n",
    "I=300.; #mA\n",
    "# amplifier gain:\n",
    "G_A=724.; #mA/V\n",
    "# feedback transducer gain:\n",
    "H=4.; #V/in\n",
    "# feedback transducer gain in metric units\n",
    "H1=1.57; #V/cm# Solutions:\n",
    "# tracking error,\n",
    "TE=I/(G_A*H); #in\n",
    "# tracking error,\n",
    "TE1=I/(G_A*H1); #cm\n",
    "\n",
    "# Results:\n",
    "print\"\\n  Results:  \"\n",
    "print\"\\n The tracking error of system is  in.\",round(TE,3)\n",
    "print\"\\n The tracking error of system in SI Unit is  cm.\",round(TE1,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}