Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Simpleton needs help with FBv4

  1. #11
    Low Bitrate
    Join Date
    Jul 2009
    Location
    Squamish, BC
    Posts
    93
    Thanks for that info. I fell like I am getting there. Once finished I'll post a thread about what I learned.

    In the MDX, I have averaging switched off and the history value set to zero.

    In my own code, which is a Centrafuse plugin, I'm going to implement settling algorithms for each of these types

    Momentary - for things like volume, if I hold down then keep sending the signal
    Switch - for things like mute, once pressed wait for nothing pressed until it is safe to send another signal
    Value - just settle on a threshold (like mod 5) so that needles don't constantly twitch.
    Scale - only send a signal if the value has switched range (like the illumination control which is a set of values and we only want to trigger on a value change)

    I have a simple hardware question... The SWC resistance max is 4.7Kohms. I have used the same value resistor in my voltage divider. That gives me only a 50% range of numbers. If I switch to a lower value resistor then the range will increase and that should make the values more accurate. Is there a downside to using a lower resistor (i.e. draws more current and then USB power cannot support as many inputs)?
    Last edited by Petrie; 01-25-2012 at 01:35 PM.

  2. #12
    Low Bitrate
    Join Date
    Jul 2009
    Location
    Squamish, BC
    Posts
    93
    Thanks again for the help. I've got the SWC controls working great.

    1st thing is that I needed to wait for the nopress value to be detected because while Centrafuse is waking up the brain starts reading zeros first and then ramps up to the nopress which is the largest value. Only once I have received a nopress value do I start handing out signals.

    The timer fires every 0.1 seconds and I only see values in 5s (5, 10, 15 etc.). That's my threshold setting for this port.

    If the previously read value is not the same then I ignore the values because we are sliding to a value to settle on. Only once two consecutive values (within the threshold) have been detected do I update the actual signal value.

    Once a Mute or Mode value has been handed out (not just detected) then I don't hand out any more signals until a nopress has been detected. That makes it real simple to handle those two buttons. The user has to release the button and press it again for it to have any effect.

    Volume or Seek Up/Down keep handing out values if continually pressed.

    It's working like a charm. The response to a press is fast enough, the continuous press is not too fast and for Mute & Mode the length of time pressed does not cause a problem.

    Excellent.

  3. #13
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,045
    Congrats!
    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

  4. #14
    Low Bitrate
    Join Date
    Jul 2009
    Location
    Squamish, BC
    Posts
    93
    Could you answer this for me?

    The SWC resistance max is 4.7Kohms. I have used the same value resistor in my voltage divider. That gives me only a 50% range of numbers. If I switch to a lower value resistor then the range will increase and that should make the values more accurate. Is there a downside to using a lower resistor (i.e. draws more current and then USB power cannot support as many inputs)?

  5. #15
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,045
    Quote Originally Posted by Petrie View Post
    Could you answer this for me?

    The SWC resistance max is 4.7Kohms. I have used the same value resistor in my voltage divider. That gives me only a 50% range of numbers. If I switch to a lower value resistor then the range will increase and that should make the values more accurate. Is there a downside to using a lower resistor (i.e. draws more current and then USB power cannot support as many inputs)?
    If it is R1 then there will be more current. If it is R2, then no.

    +VCC --> R1 --> Centre Tap --> R2 --> GND
    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

  6. #16
    Low Bitrate
    Join Date
    Jul 2009
    Location
    Squamish, BC
    Posts
    93
    It is R1 so I expect that the more I draw on each port the less there is to hand out to the other ports.
    Going with the shortest range of values (higher R1 value) that I can is a good thing.

  7. #17
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,045
    Quote Originally Posted by Petrie View Post
    It is R1 so I expect that the more I draw on each port the less there is to hand out to the other ports.
    Going with the shortest range of values (higher R1 value) that I can is a good thing.

    To a point. If you go too high (100Kohm+) then you are going to start noticing the ADC impedance itself interfering with the signal.

    You can also just use a standard opamp with a gain of 2 (1 opamp and 2 feedback resistors minimally) to make your divided signal full scale again. As long as the opamp has good analogue linearity, it will work well.

    All the sensors share the same supply as does the microprocessor as well. So if you start sinking too much current, you will start to see randomness/bad-things on anything because the brain of the unit will be undervoltaging, potentially resetting, or potentially not having enough umph to drive output ports.
    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. #18
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,045
    If powering via USB, then you have 500mA to play with at most if your USB port can even supply that which some can't. That 500mA is for switching outputs on/off, driving LEDs, driving the micro, supplying the ports, everything. If you power via the 12v input (7vdc - 22vdc input, centre pin positive) then you can have about 1A to 1.2A to play with.
    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

  9. #19
    Low Bitrate
    Join Date
    Jul 2009
    Location
    Squamish, BC
    Posts
    93
    Would moving to a 12V power supply improve the speed of response from the brain &/or make the signals more stable?

    I have switched all buttons to require a nopress after sending an individual button press. The delay response was difficult to predict at times when CF was busy. Now it is consistent and predictable.

    I'm learning all the time.

  10. #20
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,045
    Quote Originally Posted by Petrie View Post
    Would moving to a 12V power supply improve the speed of response from the brain &/or make the signals more stable?

    I have switched all buttons to require a nopress after sending an individual button press. The delay response was difficult to predict at times when CF was busy. Now it is consistent and predictable.

    I'm learning all the time.
    The speed issue is all CF. Standalone software can poll at 200Hz+ with no problem. If you are seeing lag and averaging within CF, it is because of CF. The power change would only make things more stable if you were pulling near the maximum limit right now and something kicks it over the edge every now and then.
    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

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Simpleton
    By DarthTater in forum RR Skins
    Replies: 2
    Last Post: 05-24-2006, 01:41 PM
  2. simpleton
    By DarthTater in forum RR Skins
    Replies: 2
    Last Post: 04-19-2006, 04:40 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
  •