Announcement

Collapse
No announcement yet.

Tutorial - Air Ride Suspension

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tutorial - Air Ride Suspension

    Hardware

    So far, the only sensors we have data for are the Dakota Digital sensors.

    http://www.dakotadigital.com/index.c...rod/prd124.htm

    Code:
    150psi, 1/8-27 NPT
    
    PSI		R typical	R max		R min
    0		10		13		5
    14.5		31		35		27
    29		52		56		48
    43.5		70		74		66
    58		88		92		84
    72.5		106		111		101
    87		124		129		119
    101.5		140		150		130
    116		155		170		145
    130.5		170		185		155
    145		184		214		154
    
    Maximum 435 psi for 2 seconds only.
    Operating Temperature:  -13F - +212F (to +248F max. 1 hour) on
    connecting thread.


    Then, all you need to do is hook the air ride sensor up like so, knowing that the body of the sensor is grounded.

    As far as software, Nick will be along shortly to do that bit.

  • #2
    To Evaluate an Analogue Input as an Air Ride Sensor



    Configurator Designer File: http://www.fusioncontrolcentre.com/T...odule.designer
    Function XML File: http://www.fusioncontrolcentre.com/T...nsormodule.xml

    Put both into your Configurator's function directory.

    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <function>
      <input order="1">PressureInput</input>
      <return type="numeric">
      <operation type="subtract">
        <parameter1>
          <operation type="add">
            <parameter1>
              <operation type="subtract">
                <parameter1>
                  <operation type="multiply">
                    <parameter1>
                      <number>8.4879</number>
                    </parameter1>
                    <parameter2>
                      <operation type="multiply">
                        <parameter1>
                          <operation type="multiply">
                            <parameter1>
                              <variable do="get">PressureInput</variable>
                            </parameter1>
                            <parameter2>
                              <variable do="get">PressureInput</variable>
                            </parameter2>
                          </operation>
                        </parameter1>
                        <parameter2>
                          <variable do="get">PressureInput</variable>
                        </parameter2>
                      </operation>
                    </parameter2>
                  </operation>
                </parameter1>
                <parameter2>
                  <operation type="multiply">
                    <parameter1>
                      <number>27.568</number>
                    </parameter1>
                    <parameter2>
                      <operation type="multiply">
                        <parameter1>
                          <variable do="get">PressureInput</variable>
                        </parameter1>
                        <parameter2>
                          <variable do="get">PressureInput</variable>
                        </parameter2>
                      </operation>
                    </parameter2>
                  </operation>
                </parameter2>
              </operation>
            </parameter1>
            <parameter2>
              <operation type="multiply">
                <parameter1>
                  <variable do="get">PressureInput</variable>
                </parameter1>
                <parameter2>
                  <number>49.943</number>
                </parameter2>
              </operation>
            </parameter2>
          </operation>
        </parameter1>
        <parameter2>
          <number>18.313</number>
        </parameter2>
      </operation>
      </return>
    </function>
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

    Comment


    • #3
      To Use above code

      Insert this into your logic area (between "<logic>...</logic>". You obviously need to replace the analogue id with the id you declare in the io section "<io>...</io>". And you must reference the above code in a seperate function file in the "<require></require>" area.

      **Note: The "..." in the following code mean that there can/will be other non-related items between the code sections. Fusion Control Centre Uber Edition doesn't care about the order. It only cares about heirarchy. Meaning "<iochannel>...</iochannel>" must occur between the opening "<io>" and closing "</io>" tags. If it is not in there, FCC will skip right over it, and that input channel will never be created.

      Code:
      ...
      <require>
      ...
          <!-- Begin Function Instances -->
          <function file="content\config\AirRidePressureSensorModule" id="AirPressureSensor"></function>
          <!-- End Function Instances -->
      ...
      </require>
      ...
      
      ...
      <io>
      ...
        <!-- Begin Analogue Input Instances -->
            <iochannel id="RF Air" port="0" brain="TucciBrain2" type="analogue_input">
              <options history="10" auto_average="true"></options>
            </iochannel>
            <iochannel id="LR Air" port="1" brain="TucciBrain2" type="analogue_input">
              <options history="10" auto_average="true"></options>
            </iochannel>
            <iochannel id="LF Air" port="2" brain="TucciBrain2" type="analogue_input">
              <options history="10" auto_average="true"></options>
            </iochannel>
            <iochannel id="RR Air" port="3" brain="TucciBrain2" type="analogue_input">
              <options history="10" auto_average="true"></options>
            </iochannel>
        <!-- End Analogue Input Instances -->
      ...
        </io>
      ...
      
      ...
      <logic>
      ...
        <!-- Begin Variable Declarations -->
          <all_variables>
            <variable name="Variable_LeftFrontAir">50.0</variable>
            <variable name="Variable_LeftRearAir">50.0</variable>
            <variable name="Variable_RightFrontAir">50.0</variable>
            <variable name="Variable_RightRearAir">50.0</variable>
          </all_variables>
        <!-- End Variable Declarations -->
      
          <all_statements>
            <if fire_on="logic">
              <parameter1>
                <variable do="set" name="Variable_LeftFrontAir">
                  <evaluate function="AirPressureSensor">
                    <input order="1">
                      <analogue id="LF Air" time="0"></analogue>
                    </input>
                  </evaluate>
                </variable>
              </parameter1>
            </if>
            <if fire_on="logic">
              <parameter1>
                <variable do="set" name="Variable_LeftRearAir">
                  <evaluate function="AirPressureSensor">
                    <input order="1">
                      <analogue id="LR Air" time="0"></analogue>
                    </input>
                  </evaluate>
                </variable>
              </parameter1>
            </if>
            <if fire_on="logic">
              <parameter1>
                <variable do="set" name="Variable_RightFrontAir">
                  <evaluate function="AirPressureSensor">
                    <input order="1">
                      <analogue id="RF Air" time="0"></analogue>
                    </input>
                  </evaluate>
                </variable>
              </parameter1>
            </if>
            <if fire_on="logic">
              <parameter1>
                <variable do="set" name="Variable_RightRearAir">
                  <evaluate function="AirPressureSensor">
                    <input order="1">
                      <analogue id="RR Air" time="0"></analogue>
                    </input>
                  </evaluate>
                </variable>
              </parameter1>
            </if>
      ...
          </allstatements>
      ...
      </logic>
      Fusion Brain Version 6 Released!
      1.9in x 2.9in -- 47mm x 73mm
      30 Digital Outputs -- Directly drive a relay
      15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
      Buy now in the MP3Car.com Store

      Comment


      • #4
        2k1toaster,
        In what program does this have to be written in?
        and
        I see that this is an XML, Will I need to open this in a webpage? can I incorporate it to Streetdeck some how?
        Where is the <io></IO> section?
        My Car!

        Comment


        • #5
          Originally posted by dasaint80 View Post
          2k1toaster,
          In what program does this have to be written in?
          and
          I see that this is an XML, Will I need to open this in a webpage? can I incorporate it to Streetdeck some how?
          Where is the <io></IO> section?
          You can write this is any program that supports either xml (Dreamweaver, Word, Free XML Editors scattered around google), or in any plain text editor (Notepad and free ones too, just save the file as *.xml not *.txt).

          You do not need or have to open it in a web browser. You can if you want to view the xml if you have no editor (which if you run windows you do, Start-->Programs-->Accessories-->NotePad).

          This code is only understandable by Fusion Control Centre Uber Edition (FCC). Currently, the latest release of Uber is MDX (Managed DirectX) and downloadable as shown here: http://www.mp3car.com/vbulletin/docu...rsion-mdx.html

          To incorporate into StreetDeck, currently you must embed FCC into Streetdeck as an external program. I have been working on a COM object (I promise I have been, but it is slow going now because of how Vista changed COM objects) which will allow the Fusion Brain to be controlled via a plugin (DigitalMod I believe is the SD term). This COM functionality is not available yet, but I hope it will be before summer. Until then, embedding the program works well. You may have to run SD in "testmode" to enable usage while moving.
          Fusion Brain Version 6 Released!
          1.9in x 2.9in -- 47mm x 73mm
          30 Digital Outputs -- Directly drive a relay
          15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
          Buy now in the MP3Car.com Store

          Comment


          • #6
            Code:
              <require>
                <!-- Begin Function Instances -->
                <function file="content\config\AirRidePressureSensorModule" id="AirPressureSensor"></function>
                <!-- End Function Instances -->
                
                <!-- Begin Font Instances -->
                  <font name="LED50" originalSize="50" font_config="Content\config\fonts\FusionFontLED.xml"></font>
                <!-- End Font Instances -->
              </require>
            
              <graphics>
                
              
                <!-- Begin Global Graphic Settings -->
                <main_display designed_for_size="800,620" show_at_size="800,480" menubar="fixed" RunInSystemTray="False" MinimizeToSystemTray="False"></main_display>
            
                <background_image style="stretch" imagefilepath="Content\Images\Background_Air.png" page="0"></background_image>
                <!-- End Global Graphic Settings -->
            
                
            
            
                <button id="Left Front Fill" enabled="yes" function="trigger output" functionTargetID="Left Front Fill" vote="absolute" vote_opinion="on" vote_priority="low">
                  <images imagePrimary="Content\Images\ButtonUp.png" imageSecondary="Content\Images\ButtonUp.png" imageDisabled="Content\Images\ButtonUp.png" imagePushed="Content\Images\ButtonUp.png"></images>
                  <display size="56,56" location="100,212" page="0" z_order="0.0"></display>
                  <options imageScaling="stretch"></options>
                  <up_click up_click_function="trigger output" up_click_functionTargetID="Left Front Fill" up_click_vote_opinion="off" up_click_vote="absolute" up_click_vote_priority="medium"></up_click>
                </button>
                <button id="Left Front Dump" enabled="yes" function="trigger output" functionTargetID="Left Front Dump" vote="absolute" vote_opinion="on" vote_priority="low">
                  <images imagePrimary="Content\Images\ButtonDown.png" imageSecondary="Content\Images\ButtonDown.png" imageDisabled="Content\Images\ButtonDown.png" imagePushed="Content\Images\ButtonDown.png"></images>
                  <display size="56,56" location="242,212" page="0" z_order="0.0"></display>
                  <options imageScaling="stretch"></options>
                  <up_click up_click_function="trigger output" up_click_functionTargetID="Left Front Dump" up_click_vote_opinion="off" up_click_vote="absolute" up_click_vote_priority="medium"></up_click>
                </button>
                <button id="Left Rear Fill" enabled="yes" function="trigger output" functionTargetID="Left Rear Fill" vote="absolute" vote_opinion="on" vote_priority="low">
                  <images imagePrimary="Content\Images\ButtonUp.png" imageSecondary="Content\Images\ButtonUp.png" imageDisabled="Content\Images\ButtonUp.png" imagePushed="Content\Images\ButtonUp.png"></images>
                  <display size="56,56" location="100,412" page="0" z_order="0.0"></display>
                  <options imageScaling="stretch"></options>
                  <up_click up_click_function="trigger output" up_click_functionTargetID="Left Rear Fill" up_click_vote_opinion="off" up_click_vote="absolute" up_click_vote_priority="medium"></up_click>
                </button>
                <button id="Left Rear Dump" enabled="yes" function="trigger output" functionTargetID="Left Rear Dump" vote="absolute" vote_opinion="on" vote_priority="low">
                  <images imagePrimary="Content\Images\ButtonDown.png" imageSecondary="Content\Images\ButtonDown.png" imageDisabled="Content\Images\ButtonDown.png" imagePushed="Content\Images\ButtonDown.png"></images>
                  <display size="56,56" location="242,412" page="0" z_order="0.0"></display>
                  <options imageScaling="stretch"></options>
                  <up_click up_click_function="trigger output" up_click_functionTargetID="Left Rear Dump" up_click_vote_opinion="off" up_click_vote="absolute" up_click_vote_priority="medium"></up_click>
                </button>
                <button id="Right Front Fill" enabled="yes" function="trigger output" functionTargetID="Right Front Fill" vote="absolute" vote_opinion="on" vote_priority="low">
                  <images imagePrimary="Content\Images\ButtonUp.png" imageSecondary="Content\Images\ButtonUp.png" imageDisabled="Content\Images\ButtonUp.png" imagePushed="Content\Images\ButtonUp.png"></images>
                  <display size="56,56" location="500,212" page="0" z_order="0.0"></display>
                  <options imageScaling="stretch"></options>
                  <up_click up_click_function="trigger output" up_click_functionTargetID="Right Front Fill" up_click_vote_opinion="off" up_click_vote="absolute" up_click_vote_priority="medium"></up_click>
                </button>
                <button id="Right Front Dump" enabled="yes" function="trigger output" functionTargetID="Right Front Dump" vote="absolute" vote_opinion="on" vote_priority="low">
                  <images imagePrimary="Content\Images\ButtonDown.png" imageSecondary="Content\Images\ButtonDown.png" imageDisabled="Content\Images\ButtonDown.png" imagePushed="Content\Images\ButtonDown.png"></images>
                  <display size="56,56" location="642,212" page="0" z_order="0.0"></display>
                  <options imageScaling="stretch"></options>
                  <up_click up_click_function="trigger output" up_click_functionTargetID="Right Front Dump" up_click_vote_opinion="off" up_click_vote="absolute" up_click_vote_priority="medium"></up_click>
                </button>
                <button id="Right Rear Fill" enabled="yes" function="trigger output" functionTargetID="Right Rear Fill" vote="absolute" vote_opinion="on" vote_priority="low">
                  <images imagePrimary="Content\Images\ButtonUp.png" imageSecondary="Content\Images\ButtonUp.png" imageDisabled="Content\Images\ButtonUp.png" imagePushed="Content\Images\ButtonUp.png"></images>
                  <display size="56,56" location="500,412" page="0" z_order="0.0"></display>
                  <options imageScaling="stretch"></options>
                  <up_click up_click_function="trigger output" up_click_functionTargetID="Right Rear Fill" up_click_vote_opinion="off" up_click_vote="absolute" up_click_vote_priority="medium"></up_click>
                </button>
                <button id="Right Rear Dump" enabled="yes" function="trigger output" functionTargetID="Right Rear Dump" vote="absolute" vote_opinion="on" vote_priority="low">
                  <images imagePrimary="Content\Images\ButtonDown.png" imageSecondary="Content\Images\ButtonDown.png" imageDisabled="Content\Images\ButtonDown.png" imagePushed="Content\Images\ButtonDown.png"></images>
                  <display size="56,56" location="642,412" page="0" z_order="0.0"></display>
                  <options imageScaling="stretch"></options>
                  <up_click up_click_function="trigger output" up_click_functionTargetID="Right Rear Dump" up_click_vote_opinion="off" up_click_vote="absolute" up_click_vote_priority="medium"></up_click>
                </button>
             
            
            
            
               <text_label id="Left Front Air TextIndicator" text="00" auto_monitor="variable" auto_monitorTarget="Variable_LeftFrontAir">
                  <font font_id="LED50" font_size="35"></font>
                  <display location="165,165" page="0"></display>
                  <config decimals="0" max_size="70,40"></config>
                </text_label>
                <text_label id="Left Rear Air TextIndicator" text="00" auto_monitor="variable" auto_monitorTarget="Variable_LeftRearAir">
                  <font font_id="LED50" font_size="35"></font>
                  <display location="165,365" page="0"></display>
                  <config decimals="0" max_size="70,40"></config>
                </text_label>
                <text_label id="Right Front Air TextIndicator" text="00" auto_monitor="variable" auto_monitorTarget="Variable_RightFrontAir">
                  <font font_id="LED50" font_size="35"></font>
                  <display location="565,165" page="0"></display>
                  <config decimals="0" max_size="70,40"></config>
                </text_label>
                <text_label id="Right Rear Air TextIndicator" text="00" auto_monitor="variable" auto_monitorTarget="Variable_RightRearAir">
                  <font font_id="LED50" font_size="35"></font>
                  <display location="565,365" page="0"></display>
                  <config decimals="0" max_size="70,40"></config>
                </text_label>
            
            
            
            
            
            
            </graphics>
            
              <io>
              <!-- Begin Fusion Brain Instances -->
                  <brain id="micerebro">USB\VID_04D8&amp;PID_000C\6&amp;17EF8D69&amp;0&amp;4</brain>
              <!-- End Fusion Brain Instances -->
            
              <!-- Begin Timer Setup -->
                  <timer id="input" interval="100"></timer>
                  <timer id="output" interval="100"></timer>
                  <timer id="gui" interval="50"></timer>
                  <timer id="logic" interval="50"></timer>
              <!-- End Timer Setup -->
            
              <!-- Begin Digital Output Instances -->
                  <iochannel id="Right Front Fill" port="1" brain="micerebro" type="digital_output">
                    <defaults defaultstate="off"></defaults>
                  </iochannel>
                  <iochannel id="Right Rear Fill" port="2" brain="micerebro" type="digital_output">
                    <defaults defaultstate="off"></defaults>
                  </iochannel>
                  <iochannel id="Left Front Fill" port="7" brain="micerebro" type="digital_output">
                    <defaults defaultstate="off"></defaults>
                  </iochannel>
                  <iochannel id="Left Rear Fill" port="0" brain="micerebro" type="digital_output">
                    <defaults defaultstate="off"></defaults>
                  </iochannel>
                  <iochannel id="Right Front Dump" port="8" brain="micerebro" type="digital_output">
                    <defaults defaultstate="off"></defaults>
                  </iochannel>
                  <iochannel id="Right Rear Dump" port="9" brain="micerebro" type="digital_output">
                    <defaults defaultstate="off"></defaults>
                  </iochannel>
                  <iochannel id="Left Front Dump" port="10" brain="micerebro" type="digital_output">
                    <defaults defaultstate="off"></defaults>
                  </iochannel>
                  <iochannel id="Left Rear Dump" port="11" brain="micerebro" type="digital_output">
                    <defaults defaultstate="off"></defaults>
                  </iochannel>
              <!-- End Digital Output Instances -->
            
            
              <!-- Begin Analogue Input Instances -->
                  <iochannel id="RF Air" port="0" brain="micerebro" type="analogue_input">
                    <options history="10" auto_average="true"></options>
                  </iochannel>
                  <iochannel id="LR Air" port="1" brain="micerebro" type="analogue_input">
                    <options history="10" auto_average="true"></options>
                  </iochannel>
                  <iochannel id="LF Air" port="2" brain="micerebro" type="analogue_input">
                    <options history="10" auto_average="true"></options>
                  </iochannel>
                  <iochannel id="RR Air" port="3" brain="micerebro" type="analogue_input">
                    <options history="10" auto_average="true"></options>
                  </iochannel>
              <!-- End Analogue Input Instances -->
              </io>
            
              <logic>
              <!-- Begin Logging Setup -->
                <all_logging>
                </all_logging>
              <!-- End Logging Setup -->
            
              <!-- Begin Variable Declarations -->
                <all_variables>
                  <variable name="Variable_LeftFrontAir">50.0</variable>
                  <variable name="Variable_LeftRearAir">50.0</variable>
                  <variable name="Variable_RightFrontAir">50.0</variable>
                  <variable name="Variable_RightRearAir">50.0</variable>
                  
                      </all_variables>
              <!-- End Variable Declarations -->
                <all_statements>
                  <if fire_on="logic">
                    <parameter1>
                      <variable do="set" name="Variable_LeftFrontAir">
                        <evaluate function="AirPressureSensor">
                          <input order="1">
                            <analogue id="LF Air" time="0"></analogue>
                          </input>
                        </evaluate>
                      </variable>
                    </parameter1>
                  </if>
                  <if fire_on="logic">
                    <parameter1>
                      <variable do="set" name="Variable_LeftRearAir">
                        <evaluate function="AirPressureSensor">
                          <input order="1">
                            <analogue id="LR Air" time="0"></analogue>
                          </input>
                        </evaluate>
                      </variable>
                    </parameter1>
                  </if>
                  <if fire_on="logic">
                    <parameter1>
                      <variable do="set" name="Variable_RightFrontAir">
                        <evaluate function="AirPressureSensor">
                          <input order="1">
                            <analogue id="RF Air" time="0"></analogue>
                          </input>
                        </evaluate>
                      </variable>
                    </parameter1>
                  </if>
                  <if fire_on="logic">
                    <parameter1>
                      <variable do="set" name="Variable_RightRearAir">
                        <evaluate function="AirPressureSensor">
                          <input order="1">
                            <analogue id="RR Air" time="0"></analogue>
                          </input>
                        </evaluate>
                      </variable>
                    </parameter1>
                  </if>
                  
                </all_statements>
              </logic>
            How's this?
            will this monitor and stabilize itself?
            I don't have the car with me to test this. I'll get the car back in about 2 weeks.

            Thanks

            Steve
            My Car!

            Comment


            • #7
              Originally posted by 2k1Toaster View Post
              To Evaluate an Analogue Input as an Air Ride Sensor

              Code:
              <?xml version="1.0" encoding="utf-8" ?>
              <function>
                <input order="1">PressureInput</input>
                <return type="numeric">
                <operation type="subtract">
                  <parameter1>
                    <number>18.313</number>
                  </parameter1>
                  <parameter2>
                    <operation type="add">
                      <parameter1>
                        <operation type="subtract">
                          <parameter1>
                            <operation type="multiply">
                              <parameter1>
                                <number>8.4879</number>
                              </parameter1>
                              <parameter2>
                                <operation type="multiply">
                                  <parameter1>
                                    <operation type="multiply">
                                      <parameter1>
                                        <variable do="get">PressureInput</variable>
                                      </parameter1>
                                      <parameter2>
                                        <variable do="get">PressureInput</variable>
                                      </parameter2>
                                    </operation>
                                  </parameter1>
                                  <parameter2>
                                    <variable do="get">PressureInput</variable>
                                  </parameter2>
                                </operation>
                              </parameter2>
                            </operation>
                          </parameter1>
                          <parameter2>
                            <operation type="multiply">
                              <parameter1>
                                <number>27.568</number>
                              </parameter1>
                              <parameter2>
                                <operation type="multiply">
                                  <parameter1>
                                    <variable do="get">PressureInput</variable>
                                  </parameter1>
                                  <parameter2>
                                    <variable do="get">PressureInput</variable>
                                  </parameter2>
                                </operation>
                              </parameter2>
                            </operation>
                          </parameter2>
                        </operation>
                      </parameter1>
                      <parameter2>
                        <operation type="multiply">
                          <parameter1>
                            <variable do="get">PressureInput</variable>
                          </parameter1>
                          <parameter2>
                            <number>49.943</number>
                          </parameter2>
                        </operation>
                      </parameter2>
                    </operation>
                  </parameter2>
                </operation>
                </return>
              </function>
              First off i must say that because of this awesome piece of equipment the sky is the limit now. I understand the wiring concept of everything but its the software that is killing me. Ok so i copied this and saved it as an xml. Where do you place the file and how do you reference it in as a separate function file in the MDX configurator.

              Originally posted by 2k1Toaster View Post
              To Evaluate an Analogue Input as an Air Ride Sensor

              <require>
              ...
              <!-- Begin Function Instances -->
              <function file="content\config\AirRidePressureSensorModule" id="AirPressureSensor"></function>
              <!-- End Function Instances -->
              ...
              </require>
              ...

              ...
              <io>
              ...
              <!-- Begin Analogue Input Instances -->
              <iochannel id="RF Air" port="0" brain="TucciBrain2" type="analogue_input">
              <options history="10" auto_average="true"></options>
              </iochannel>
              <iochannel id="LR Air" port="1" brain="TucciBrain2" type="analogue_input">
              <options history="10" auto_average="true"></options>
              </iochannel>
              <iochannel id="LF Air" port="2" brain="TucciBrain2" type="analogue_input">
              <options history="10" auto_average="true"></options>
              </iochannel>
              <iochannel id="RR Air" port="3" brain="TucciBrain2" type="analogue_input">
              <options history="10" auto_average="true"></options>
              </iochannel>
              <!-- End Analogue Input Instances -->
              ...
              </io>
              ...

              ...
              <logic>
              ...
              <!-- Begin Variable Declarations -->
              <all_variables>
              <variable name="Variable_LeftFrontAir">50.0</variable>
              <variable name="Variable_LeftRearAir">50.0</variable>
              <variable name="Variable_RightFrontAir">50.0</variable>
              <variable name="Variable_RightRearAir">50.0</variable>
              </all_variables>
              <!-- End Variable Declarations -->

              <all_statements>
              <if fire_on="logic">
              <parameter1>
              <variable do="set" name="Variable_LeftFrontAir">
              <evaluate function="AirPressureSensor">
              <input order="1">
              <analogue id="LF Air" time="0"></analogue>
              </input>
              </evaluate>
              </variable>
              </parameter1>
              </if>
              <if fire_on="logic">
              <parameter1>
              <variable do="set" name="Variable_LeftRearAir">
              <evaluate function="AirPressureSensor">
              <input order="1">
              <analogue id="LR Air" time="0"></analogue>
              </input>
              </evaluate>
              </variable>
              </parameter1>
              </if>
              <if fire_on="logic">
              <parameter1>
              <variable do="set" name="Variable_RightFrontAir">
              <evaluate function="AirPressureSensor">
              <input order="1">
              <analogue id="RF Air" time="0"></analogue>
              </input>
              </evaluate>
              </variable>
              </parameter1>
              </if>
              <if fire_on="logic">
              <parameter1>
              <variable do="set" name="Variable_RightRearAir">
              <evaluate function="AirPressureSensor">
              <input order="1">
              <analogue id="RR Air" time="0"></analogue>
              </input>
              </evaluate>
              </variable>
              </parameter1>
              </if>
              ...
              </allstatements>
              ...
              </logic>
              Also can someone help me to understand this by giving me a general break down of this. The more detail the better but anything is better than nothing. Thanks

              Comment


              • #8
                Hi I noticed you PMed me too, so I will just post here so everyone can benefit from it.

                Originally posted by wrxyboy
                1st- In the function instance of air ride sensor file what do the numbers correspond to and is this function file only good for the 150psi sensors?
                The numbers are how to scale the voltage input to the pressure output. The brain only reads 0-5v, but the pressure is 0-150. By constructing a polynomial function (remember your basic high school math) you can model any function over a given range by using a sum of polynomials with specific coefficients. So a first order is y = mx + b. Second order is y = n*x^2 + m*x + b and so on. That is what the function above does and models the pressure sensor over the given 0-5v input range and 0-150psi output range. Outside of this range ( x < 0 or x > 5) then it all blows up and doesnt work.

                2nd- <variable name="Variable_LeftFrontAir">50.0</variable>

                What does the 50 mean. I got this from your air ride tutorial.
                Any value in the variable declaration, means the default value. When the program starts, that is what it is set to to begin with.

                3rd- I would like to How be able to have a set preset height and go to that preset with just a push of the button. I know to get those preset heights it will have to correspond to the pressure and will raise or lower the car by pressure. How is this written in code? Thanks
                You will need to split it up into when the pressure is above the threshold and another for when it is below the threshold. Then a button will change a variable to 1 from 0 when clicked. A logic block would then turn on an output if above threshold or turn on a different output if below the threshold to raise/lower it and the variable set by the button is 1. Then another block will monitor the pressure and if between 2 values close to around the threshold, it will turn that variable back off to 0. You have to use between or else it would never turn off because 3.14159 does not equal 3.14158 but it is probably close enough, so you want to make a hysteresis.
                Fusion Brain Version 6 Released!
                1.9in x 2.9in -- 47mm x 73mm
                30 Digital Outputs -- Directly drive a relay
                15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
                Buy now in the MP3Car.com Store

                Comment


                • #9
                  ok so i know where to add the function instance for the air pressure sending unit, is the logic correct in only getting a reading from the sensor unit and having it display the correct corresponding psi from each sending unit. Thanks



                  Comment


                  • #10
                    That logic function takes an analogue input "Front Left" and puts the actual value in a variable "Front Left Variable". That is it.

                    If you want to do something useful, like make Front Left Variable PSI not voltage, then you need to send the analogue input through the psi function then to th variable.
                    Fusion Brain Version 6 Released!
                    1.9in x 2.9in -- 47mm x 73mm
                    30 Digital Outputs -- Directly drive a relay
                    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
                    Buy now in the MP3Car.com Store

                    Comment


                    • #11
                      Originally posted by 2k1Toaster View Post
                      That logic function takes an analogue input "Front Left" and puts the actual value in a variable "Front Left Variable". That is it.

                      If you want to do something useful, like make Front Left Variable PSI not voltage, then you need to send the analogue input through the psi function then to to variable.
                      So the air sensor function that you posted above will convert the voltage to psi? Since there is no quick block for that in the configurator i would need to write that in with an xml editor correct. Thanks

                      Comment


                      • #12
                        when i open up my fusion center the program runs perfect but when i open up the configuator and try to open the xml file i get this error what does this error mean. Thanks

                        Comment


                        • #13
                          Originally posted by 2k1Toaster View Post
                          That logic function takes an analogue input "Front Left" and puts the actual value in a variable "Front Left Variable". That is it.

                          If you want to do something useful, like make Front Left Variable PSI not voltage, then you need to send the analogue input through the psi function then to th variable.
                          So does the function at the top convert it to psi and why does it go into the negatives when i add 5v on the virtual brain. Shouldnt the 5v indicate somewhere around 150psi if i am using the 150psi sending unit. Thanks for all the help you have done so far.

                          Comment


                          • #14
                            Originally posted by wrxyboy View Post
                            So does the function at the top convert it to psi and why does it go into the negatives when i add 5v on the virtual brain. Shouldnt the 5v indicate somewhere around 150psi if i am using the 150psi sending unit. Thanks for all the help you have done so far.
                            It goes negative because I made a typo. The 18.xx and the rest of the function is switched on the last subtract node. Just change those around so it looks like this:



                            Also, 5v gives you 600+ psi.

                            using a 100ohm resistor for R1 of a voltage divider, you get:

                            FB Voltage = 5 * (sensor/(sensor + 100))

                            The pressure function models this: y = 8.4879x^3 - 27.568x^2 + 49.943x - 18.313 where y is in pressure and x is in volts.

                            150psi ~= 3.29v
                            Fusion Brain Version 6 Released!
                            1.9in x 2.9in -- 47mm x 73mm
                            30 Digital Outputs -- Directly drive a relay
                            15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
                            Buy now in the MP3Car.com Store

                            Comment


                            • #15
                              Software post uptop is updated
                              Fusion Brain Version 6 Released!
                              1.9in x 2.9in -- 47mm x 73mm
                              30 Digital Outputs -- Directly drive a relay
                              15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
                              Buy now in the MP3Car.com Store

                              Comment

                              Working...
                              X