summaryrefslogtreecommitdiff
path: root/gr-sbhs/grc
diff options
context:
space:
mode:
authormanojgudi2013-12-24 21:07:36 +0530
committermanojgudi2013-12-24 21:07:36 +0530
commit576936961996253c5a7ea27b63e5bb2ce0bb01aa (patch)
treeb7b92b6025a04317ff7972e3a087b278468209a8 /gr-sbhs/grc
parentda744ab20441967db5bc7885fcd5224f7fd75100 (diff)
downloadgnuradio-576936961996253c5a7ea27b63e5bb2ce0bb01aa.tar.gz
gnuradio-576936961996253c5a7ea27b63e5bb2ce0bb01aa.tar.bz2
gnuradio-576936961996253c5a7ea27b63e5bb2ce0bb01aa.zip
Aded SBHS block
Diffstat (limited to 'gr-sbhs/grc')
-rw-r--r--gr-sbhs/grc/CMakeLists.txt30
-rw-r--r--gr-sbhs/grc/sbhs_controller.xml108
-rw-r--r--gr-sbhs/grc/sbhs_plant.xml71
3 files changed, 209 insertions, 0 deletions
diff --git a/gr-sbhs/grc/CMakeLists.txt b/gr-sbhs/grc/CMakeLists.txt
new file mode 100644
index 000000000..f53930884
--- /dev/null
+++ b/gr-sbhs/grc/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+install(FILES
+ sbhs_plant.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "sbhs_python"
+)
+
+install(FILES
+ sbhs_controller.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "sbhs_python"
+)
diff --git a/gr-sbhs/grc/sbhs_controller.xml b/gr-sbhs/grc/sbhs_controller.xml
new file mode 100644
index 000000000..a8729e9a0
--- /dev/null
+++ b/gr-sbhs/grc/sbhs_controller.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Add Block:
+## all types, 1 output, 2 to inf inputs
+###################################################
+ -->
+<block>
+ <name>sbhs_controller</name>
+ <key>sbhs_controller</key>
+ <category>controller</category>
+
+ <import>import gr_controller</import>
+ <make>gr_controller.sbhs_controller()
+self.$(id).set_parameters($P, $I, $d, $a, $b, $window)
+ </make>
+ <param>
+ <name>IO Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option><name>F32_F32</name><key>f32_f32</key></option>
+ <option><name>S32_S32</name><key>s32_s32</key></option>
+ <option><name>S16_S16</name><key>s16_s16</key></option>
+ <option><name>S8_S8</name><key>s8_s8</key></option>
+ </param>
+
+ <param>
+ <name>Num Inputs</name>
+ <key>num_inputs</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Delta T</name>
+ <key>a</key>
+ <value>1</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>P Value</name>
+ <key>P</key>
+ <value>1</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>I Value</name>
+ <key>I</key>
+ <value>1</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>D Value</name>
+ <key>d</key>
+ <value>1</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>Set Point</name>
+ <key>b</key>
+ <value>1</value>
+ <type>real</type>
+ </param>
+
+
+ <param>
+ <name>Window</name>
+ <key>window</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+
+
+ <!--
+ Check if number of inputs are greater than 0, and if vector length
+ is greater than 0.
+ -->
+ <check>$num_inputs &gt; 0</check>
+ <check>$vlen &gt; 0</check>
+ <sink>
+ <name>in</name>
+ <type>$(str($type).split('_')[0])</type>
+ <vlen>$vlen</vlen>
+ <nports>$num_inputs</nports>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>$(str($type).split('_')[1])</type>
+ <vlen>$vlen</vlen>
+ </source>
+ <doc>
+
+SBHS Controller Block
+> SBHS Controller Block to implement P I D Algorithms
+ </doc>
+</block>
diff --git a/gr-sbhs/grc/sbhs_plant.xml b/gr-sbhs/grc/sbhs_plant.xml
new file mode 100644
index 000000000..f6e9c34c1
--- /dev/null
+++ b/gr-sbhs/grc/sbhs_plant.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Add Block:
+## all types, 1 output, 2 to inf inputs
+###################################################
+ -->
+<block>
+ <name>sbhs</name>
+ <key>gr_sbhs</key>
+ <category>sbhs</category>
+
+ <import>import gr_sbhs</import>
+ <make>gr_sbhs.gr_sbhs()
+self.$(id).set_parameters($window)
+ </make>
+ <param>
+ <name>IO Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option><name>F32_F32</name><key>f32_f32</key></option>
+ <option><name>S32_S32</name><key>s32_s32</key></option>
+ <option><name>S16_S16</name><key>s16_s16</key></option>
+ <option><name>S8_S8</name><key>s8_s8</key></option>
+ </param>
+ <param>
+ <name>Num Inputs</name>
+ <key>num_inputs</key>
+ <value>2</value>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Window</name>
+ <key>window</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+ <!--
+ Check if number of inputs are greater than 0, and if vector length
+ is greater than 0.
+ -->
+ <check>$num_inputs &gt; 0</check>
+ <check>$vlen &gt; 0</check>
+ <sink>
+ <name>in</name>
+ <type>$(str($type).split('_')[0])</type>
+ <vlen>$vlen</vlen>
+ <nports>$num_inputs</nports>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>$(str($type).split('_')[1])</type>
+ <vlen>$vlen</vlen>
+ </source>
+ <doc>
+
+SBHS Serial block
+
+> Check if your scilab function requires multiple inputs
+> Make sure you have same n_input_items when you have multiple inputs
+ </doc>
+</block>