Page 16 of 23 FirstFirst ... 67891011121314151617181920212223 LastLast
Results 151 to 160 of 223

Thread: Beginning of an Automatic Climate Control System, all juiced up on Fusion

  1. #151
    FLAC
    Join Date
    Oct 2006
    Location
    Las Vegas
    Posts
    1,286
    Aha!!!! make 1 function, kind of like a multiple 'or'. where it evaluates 1 variable == a number of variables (maybe 5). so the function will have like 6 inputs and a boolean output, it cleans things up, and is reusable.

  2. #152
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Ah the wonders of functions

    Well I need to get to bed at a reasonable time today since I have to be in class at 8am on Monday and after uni, work doesnt end until 10pm.

    I'll check back in the morning I am sure you will have some serious progress at this pace.
    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

  3. #153
    FLAC
    Join Date
    Oct 2006
    Location
    Las Vegas
    Posts
    1,286
    thanks for your help.

  4. #154
    FLAC
    Join Date
    Oct 2006
    Location
    Las Vegas
    Posts
    1,286
    Functions are cool!!!!



    This is the same as the root function above, but much easier to understand.

  5. #155
    FLAC
    Join Date
    Oct 2006
    Location
    Las Vegas
    Posts
    1,286
    I'm getting close to having control of 6 digital outputs (used as inputs to the DAC). Each output looks at a numeric variable that is from 0-26. Two root functions are associated with each output. Based on a table of binary values for each voltage associated each numeric value of the controlling variable, each pair of root functions decides when to turn the output on or off (in this case it can get a little confusing because logical 1 is 'output off' and logical 0 is 'output on'). Opposite values will be found in either of the two pairs (the root function that turns the output on represents the 'else' case to the root function that turns the output off (logical 1)) of root functions for each output.

    I can see where if the same values are allowed in the on and off loops, there can be instability. I've made sure that they are, in fact, mutually exclusive.

    But I have instability, nonetheless. It appears that in the loops where I have employed my new compare 5 function, outputs will randomly switch states. In the two most significant bit ouputs the logic was simple enough not to use the new function (if x is less than y and greater than z).

    So I've been looking at the new function. But it the xml code, it's hard to follow. While editing the function in the configurator, I can't tell the names of the inputs and outputs.

    Right clicking an input gives a menu with the options 'about' and 'delete'.



    Selecting About just reveals that it is an input, with a generic, help-like annotation.



    It would be helpful if I could see the name of the input here.

    2K1Toaster, I know your schedule is filling up, but if you could take a look at my files and see the problem and what's really going on, I would appreciate it. I've been picking through this for hours now.

  6. #156
    FLAC
    Join Date
    Oct 2006
    Location
    Las Vegas
    Posts
    1,286
    There's definately a problem with the Compare 5 function I made. I replaced it with logic in the root functions for one of the outputs that was randomly flickering, and it's stable now.

    Here's the function code:
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <function>
      <input order="1">Variable Input</input>
      <input order="2">Compare Value #1</input>
      <input order="3">Compare Value #2</input>
      <input order="4">Compare Value #3</input>
      <input order="5">Compare Value #4</input>
      <input order="6">Compare Value #5</input>
      <return type="boolean">
      <boolean_operation type="or">
        <parameter1>
          <boolean_operation type="or">
            <parameter1>
              <boolean_operation type="or">
                <parameter1>
                  <boolean_operation type="or">
                    <parameter1>
                      <boolean_operation type="equal to">
                        <parameter1>
                          <variable do="get">Variable Input</variable>
                        </parameter1>
                        <parameter2>
                          <variable do="get">Compare Value #1</variable>
                        </parameter2>
                      </boolean_operation>
                    </parameter1>
                    <parameter2>
                      <boolean_operation type="equal to">
                        <parameter1>
                          <variable do="get">Variable Input</variable>
                        </parameter1>
                        <parameter2>
                          <variable do="get">Compare Value #2</variable>
                        </parameter2>
                      </boolean_operation>
                    </parameter2>
                  </boolean_operation>
                </parameter1>
                <parameter2>
                  <boolean_operation type="equal to">
                    <parameter1>
                      <variable do="get">Variable Input</variable>
                    </parameter1>
                    <parameter2>
                      <variable do="get">Compare Value #3</variable>
                    </parameter2>
                  </boolean_operation>
                </parameter2>
              </boolean_operation>
            </parameter1>
            <parameter2>
              <boolean_operation type="equal to">
                <parameter1>
                  <variable do="get">Variable Input</variable>
                </parameter1>
                <parameter2>
                  <variable do="get">Compare Value #4</variable>
                </parameter2>
              </boolean_operation>
            </parameter2>
          </boolean_operation>
        </parameter1>
        <parameter2>
          <boolean_operation type="equal to">
            <parameter1>
              <variable do="get">Variable Input</variable>
            </parameter1>
            <parameter2>
              <variable do="get">Compare Value #5</variable>
            </parameter2>
          </boolean_operation>
        </parameter2>
      </boolean_operation>
      </return>
    </function>
    and here's the designer file:

    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <function_designer>
      <module type="INPUT" location="22,17" input_reference_id="Variable Input">
        <link from_node="0" module="3" node="0"></link>
      </module>
      <module type="OUTPUT" location="928,106">
      </module>
      <module type="INPUT" location="25,91" input_reference_id="Compare Value #1">
        <link from_node="0" module="3" node="1"></link>
      </module>
      <module type="EQUAL TO" location="144,45">
        <link from_node="0" module="4" node="0"></link>
      </module>
      <module type="OR" location="259,53">
        <link from_node="0" module="11" node="0"></link>
      </module>
      <module type="INPUT" location="27,167" input_reference_id="Variable Input">
        <link from_node="0" module="7" node="0"></link>
      </module>
      <module type="INPUT" location="29,243" input_reference_id="Compare Value #2">
        <link from_node="0" module="7" node="1"></link>
      </module>
      <module type="EQUAL TO" location="137,202">
        <link from_node="0" module="4" node="1"></link>
      </module>
      <module type="INPUT" location="31,326" input_reference_id="Variable Input">
        <link from_node="0" module="10" node="0"></link>
      </module>
      <module type="INPUT" location="32,415" input_reference_id="Compare Value #3">
        <link from_node="0" module="10" node="1"></link>
      </module>
      <module type="EQUAL TO" location="130,360">
        <link from_node="0" module="11" node="1"></link>
      </module>
      <module type="OR" location="370,63">
        <link from_node="0" module="15" node="0"></link>
      </module>
      <module type="INPUT" location="289,298" input_reference_id="Variable Input">
        <link from_node="0" module="14" node="0"></link>
      </module>
      <module type="INPUT" location="293,372" input_reference_id="Compare Value #4">
        <link from_node="0" module="14" node="1"></link>
      </module>
      <module type="EQUAL TO" location="405,329">
        <link from_node="0" module="15" node="1"></link>
      </module>
      <module type="OR" location="508,85">
        <link from_node="0" module="19" node="0"></link>
      </module>
      <module type="INPUT" location="482,403" input_reference_id="Variable Input">
        <link from_node="0" module="18" node="0"></link>
      </module>
      <module type="INPUT" location="484,488" input_reference_id="Compare Value #5">
        <link from_node="0" module="18" node="1"></link>
      </module>
      <module type="EQUAL TO" location="601,442">
        <link from_node="0" module="19" node="1"></link>
      </module>
      <module type="OR" location="697,106">
        <link from_node="0" module="1" node="0"></link>
      </module>
    </function_designer>

  7. #157
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    If you click the second to last button on the right (left button right aligned) it should show the names of the inputs below them. I will take a look at the code.
    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

  8. #158
    FLAC
    Join Date
    Oct 2006
    Location
    Las Vegas
    Posts
    1,286
    Quote Originally Posted by 2k1Toaster View Post
    If you click the second to last button on the right (left button right aligned) it should show the names of the inputs below them. I will take a look at the code.
    The red "show ID" button didn't make anything appear. It toggles, becoming semi-transparent itself, and the function blocks flicker once, but no ID's appear.

    I've been looking at the code myself, but nothing looks wrong to me, assuming it treats multiple instances of the same external node reference works ok.

    Thanks for taking a look at it. If you want the whole thing, to see it in context, just let me know.

  9. #159
    FLAC
    Join Date
    Oct 2006
    Location
    Las Vegas
    Posts
    1,286
    I've got to re-do this logic; right before I fell asleep, I realized that I'm not thinking about all of the possibilities here:

    -I'm only accounting for whole numbers here, not including all of the real numbers in-between. I only accounted for ranges of real numbers where I used >= and <= to simplify the logic for groups of consecutive whole numbers.

    -If I were apply the >= && <= method to account for this, the logic will be huge.

    -I am limiting the control possibilities for the fan speed and temperature by mimicing only the values obtained by the potentiometer's 'detent values'. The controller in the control head will except the in-between numbers, with exception of the minimum fan speed setting, which is .5V. Instead of ensuring that values to the fan go 0, 0.5, x, y, z, ... with the loops that drive the outputs directly, I can accomplish this with controlling the allowed decimal values of the fan-speed variable in that area. This is a more universal approach where a minimum fan speed setting can be implemented. I should focus in on keeping the 'wrapper' functions that I'm doing now, seperate from the functions and rest of the skin that may be utilized for possible use by others.

    -This allows me to setup the driving functions for the analog loops using a more standard decimal to binary conversion method for each bit. I can use 0-63 as my new range for both fan control and temperature control this way, and possibly use a human friendly 0-100 on top of that. And since my method of driving the output bits will account for all real number possiblities in the 0-63 range, converting a 0-100 variable to a 0-63 variable before driving the output-bit-functions shouldn't cause any problems.

    -This allows me to mathmatically drive the controlling variables for automatic control.
    ---As it stands, if the controlling variable is X.5 or some other fractional number, I don't think the logic will react, unless 2.5, for any bit, happened to fall in a consecutive range that I have replaced several X==Y statements with a X>=y && X<=Z, and for those cases the output would be unpredictable and problematic.

    I now intend to fully cover all of the black and white areas, not just one possibility within each area.


    ugh, it feels kind of like I forgot to carry the 1.

    Now I just have to get smart with how to simplify the binary conversion using the available functions. Or make the functions I need out of the availble, function-building building blocks (which are essentially the same).

    (e.g. for the LSB I can say: if X is even y=0 else y=1, but even that isn't readily available, and it gets harder from there. I can work with repetative division, maybe. I'll take a look again at colin's suggestion to see if there's something there I can use)

    for those of you not very familiar with the configurators function-building capabilities, I have the following available for expressions:
    -AND, OR, NOT, NAND, NOR, XOR
    -ADD, SUBTRACT, MULTIPLY, DIVIDE
    -==, !=, <, <=, >, >=
    -the abiltiy to utilitze any positive integer (double?) [need to use 0 -subtract- X to create negatives, but that's not a big deal]
    -the ability to use custom functions comprised of the above building blocks.
    -inputs, variables* and outputs* may be referenced, as function inputs or *as function outputs, allowing functions, which are essentially all IF statements, to be used a assignment functions, not neccessarily needing a then statement.
    -At the current time, only then statements (multiple statements ok) are provided.

    So these are my tools, the fundamental basics. I'm less worried about function complexity now, as the functions will be commonly useful. I would like to know if there is something programmatically wrong with the compare 5 function (using multiple references to the same input) though, as that would be the prefferred way to do this, since I can re-use the functions for all 3 dials, and later they may prove useful for driving other DAC applications.

    On a happy note, I did replace all instances of the compare 5 function in my root functions, and have 0-26 variable control of one of my DAC's, the output works great 0-4.75V, I have limiter functions for the variable and up and down, whole number control of the variable with up and down incrementing buttons on my test page.



    I also have an idea for hold to raise/lower control of these controlling variables(y), by using yet another variable(x), and the downclick and upclick properties of a button.

    downclick: y=1
    upclick:y=0

    if y=1,x= x+1(x-1)
    if y=0,x= x or omit

    use of yet another variable could allow variable rate of change, where the longer you hold the button, the faster it increases/decreases.

    Maybe?
    Any more suggesitons on the binary conversions would not go unappreciated.

  10. #160
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    I havent the time at the moment to read it all since I am in class (will tonight) but for the compare, make a function and it will be a little neater. Ill be back later for the rest, got to do some circuits!
    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

Similar Threads

  1. AIMEE Climate Control POLL
    By Danceheaven in forum Software & Software Development
    Replies: 25
    Last Post: 01-14-2010, 09:38 AM
  2. Replies: 85
    Last Post: 07-09-2007, 04:44 AM
  3. Digital dash and climate control???
    By yamathegreat in forum General Hardware Discussion
    Replies: 3
    Last Post: 10-31-2005, 04:41 PM
  4. System control wire on amp
    By dudah85 in forum General Hardware Discussion
    Replies: 3
    Last Post: 09-13-2001, 08:09 AM
  5. Replies: 22
    Last Post: 08-13-2001, 01:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •