Shop OBEX P1 Docs P2 Docs Learn Events
BS2 hangs due to mains switching! — Parallax Forums

BS2 hangs due to mains switching!

hcwonghcwong Posts: 38
edited 2005-08-29 22:31 in BASIC Stamp
I am currently working on a control system for a machine with a refrigeration system. The refrigeration system is controlled by a refrigeration controller. My controller on the other hand,·consists of a BS2 module, controls other parts of the machine. Both the refrigeration system and my BS2 module is sharing the same mains supply.

My problem arises when the refrigeration compressor switch on or·off. My BS2 sometimes·hang because of the compressor·switching. I have added a·Corcom mains filter to the power supply of the BS2 and the problem reduced but·the BS2·still hang after a few hours.

The machine supposed to operate 24 hours a day and 365 days a week. And this hang problem is really a pain in the neck.

Can any of our experts out there give me some pointers on how to resolve the·BS2 hang problem? Your kind assistance is much appreciated.

Thanks.

··

Comments

  • BeanBean Posts: 8,129
    edited 2005-08-18 10:56
    You need more filtering on the BS2 power supply, a coil in series and a cap to ground just before the supply hits the BS2 pin.

    Something easy might be a computer UPS. They can be bought for less than $50. Just make sure you only plug the BS2 into it.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "One experiment is worth a thousand theories"
    ·
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-08-18 11:32
    hcwong -

    With the sparse information you've provided, one can only guess at what might be causing the problem. I suspect you'll get better answers if you provide a schematic of the wiring, as well as a copy of the program.

    It's quite difficult to get a BS-2 program lost out in the tall grass, but it can be done. Having said that, it's much more likely that the Stamp may be resetting, due to one or more of the following problems.

    1. If when the compressor switches ON, a brown-out condiiton exists, the brown-out circuitry will kick in and cause the Stamp to reset, automatically and by design. You can prove this one way or the other, by inserting a DEBUG statement at the beginning of the program, such as the following:

    DEBUG "Program Starting"

    If you see that being displayed more than once during any iteration of the program, a reset is occuring. Use Bean's suggestion which will filter the line further, and add some transient power carry over, by use of the capacitor. If the brown out is not so transient, you may want to add a SuperCap in there, in lieu of just an ordinary capacitor to tide the Stamp over during the brown out condition. The SuperCap will act as a battery long enough to prevent the Stamp from seeing the brown out condition. As I suspect you are aware,
    some refrigeration compressors can really "hang" on the line dropping the mains voltage quite significantly until the head pressure is overcome and the power requirement drop to a more ordinary level.

    2. If you are driving any inductive loads (coils, relays, solenoids) from the Stamp, and haven't included a fly-back diode to prevent the back emf from hitting the Stamp pin port, you need to take that into consideration as well. The LIFE of the Stamp pin port may well depend on that protection. The Stamp may be resetting if such a ZAP is occuring.

    3. Calculate the total current load on each BS-2 Stamp pin carefully, and measure it with an ammeter during actual working conditions, if you can. This may be a good time to check that you're not nearing the current limits of the Stamp port pins, so please consider these current parameters.

    The current limit of each BS-2 Stamp pin is/are as follows: 20 mA sourcing, 25 mA sinking.
    Additionally, for each bank of 8 pins (0-7 and 8-15, taken separately) the total is as follows:
    40 mA sourcing and 50 mA sinking.

    Now take that total connected current and add 3 mA to it for the Stamp itself. How close are you to the total capacity of your power supply? If you're close, the power supply itself may be your problem.

    4. If none of the above proves to be the cause, I'd look to the environmental temperature in which the BS-2 Stamp is operating. The temperature limits for the BS-2 Stamp are: 0 - 70 degrees C (32 - 158 degrees F). It can get awfully hot inside a compressor galley! An industrial version of the BS-2 Stamp is available if a wider range of temperature is required.

    I hope one of those thoughts solves your problem.

    Regards,

    Bruce Bates
  • hcwonghcwong Posts: 38
    edited 2005-08-19 12:54
    Dear Bean,

    I am pretty weak in this field.

    Would you mind if I ask the following:

    1) Coil - What type of coil and what values·should I use?

    2) Capacitor - Which type of capacitor and what values should I use?

    Thanks in advance.


    Bean (Hitt Consulting) said...
    You need more filtering on the BS2 power supply, a coil in series and a cap to ground just before the supply hits the BS2 pin.

    Something easy might be a computer UPS. They can be bought for less than $50. Just make sure you only plug the BS2 into it.

    Bean.

    Post Edited (hcwong) : 8/20/2005 1:02:34 PM GMT
  • hcwonghcwong Posts: 38
    edited 2005-08-19 13:10
    Dear Bruce,

    I have not drawn out the schemetic yet so I cannot attach it in my last posting.

    Your suggestions are·very logical.

    1) I will try out Bean's suggestion with the coil and cap combination to filter the power supply noise. I will also try out your other suggestion of adding a supercap to the BS-2 power line to continue supplying power·during brown-out condition·when·the compressor kicks in. Compressor is krown to·draw a lot of current when switch on because of head pressure in compressor. This·may cause the powerline voltage to drop and affects the voltage supply to BS-2.

    2) I am using all solid state relays in my circuit thus will not have the inductive load problem.

    3) I am sure that the BS-2 current is not overdrawn. My circuit can continue to run for weeks without problem if I do not switch on the compressor.

    4) My circuit is placed away from the compressor and thus will not have the overheating problem.

    By the way, many thanks for your suggestions. I will be back once I have tried out your suggestions.

    Thanks.
    this one way or the other, by inserting a DEBUG statement at the beginning of the program, such as the following:

    DEBUG "Program Starting"

    If you see that being displayed more than once during any iteration of the program, a reset is occuring. Use Bean's suggestion which will filter the line further, and add some transient power carry over, by use of the capacitor. If the brown out is not so transient, you may want to add a SuperCap in there, in lieu of just an ordinary capacitor to tide the Stamp over during the brown out condition. The SuperCap will act as a battery long enough to prevent the Stamp from seeing the brown out condition. As I suspect you are aware,
    some refrigeration compressors can really "hang" on the line dropping the mains voltage quite significantly until the head pressure is overcome and the power requirement drop to a more ordinary level.

    2. If you are driving any inductive loads (coils, relays, solenoids) from the Stamp, and haven't included a fly-back diode to prevent the back emf from hitting the Stamp pin port, you need to take that into consideration as well. The LIFE of the Stamp pin port may well depend on that protection. The Stamp may be resetting if such a ZAP is occuring.

    3. Calculate the total current load on each BS-2 Stamp pin carefully, and measure it with an ammeter during actual working conditions, if you can. This may be a good time to check that you're not nearing the current limits of the Stamp port pins, so please consider these current parameters.

    The current limit of each BS-2 Stamp pin is/are as follows: 20 mA sourcing, 25 mA sinking.
    Additionally, for each bank of 8 pins (0-7 and 8-15, taken separately) the total is as follows:
    40 mA sourcing and 50 mA sinking.

    Now take that total connected current and add 3 mA to it for the Stamp itself. How close are you to the total capacity of your power supply? If you're close, the power supply itself may be your problem.

    4. If none of the above proves to be the cause, I'd look to the environmental temperature in which the BS-2 Stamp is operating. The temperature limits for the BS-2 Stamp are: 0 - 70 degrees C (32 - 158 degrees F). It can get awfully hot inside a compressor galley! An industrial version of the BS-2 Stamp is available if a wider range of temperature is required.

    I hope one of those thoughts solves your problem.

    Regards,

    Bruce Bates
  • hcwonghcwong Posts: 38
    edited 2005-08-20 13:06
    Dear Bean,

    Can I get an answer from you by this weekend with regards to the coil and capacitor?

    Thanks in advance.
  • BeanBean Posts: 8,129
    edited 2005-08-20 15:48
    It really doesn't matter what values. For the most part larger values are better (within reason).
    I would try something line 1 to 10uH coil and a 1,000 to 10,000uF cap.
    Be sure to watch the polarity of the cap.

    Wire it like this:
    ·································· ·coil
    POWER TO BS2
    ()()()----+
    TO BS2 PIN
    ··············································· |
    ··············································· +---|(-- TO COMMON GROUND
    ····················································· cap


    Good luck,
    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "One experiment is worth a thousand theories"


    Post Edited (Bean (Hitt Consulting)) : 8/20/2005 3:49:10 PM GMT
  • Alan BradfordAlan Bradford Posts: 172
    edited 2005-08-20 17:23
    Hi,

    Dont forget to put a .01 uf cap from the Atn pin (#3) to ground.
    I also use digital nose filters on all I/O lines and all 3 Serial lines (1-3). When I leave the pns 1-3 floating I have had treeible resettng and locking up problems.

    The Murata part number is DSS306-55Y5S471M100
    I get them from Mouser Electroncs Part #81-DSS306Y5S471M1

    The putting a capacitor on the input is also a good idea.
    What type of power regulator are you using?
    I always use an external 5 volt regulator on all my stamp projects. This way I can add capacitors before and after the regulator. II use 3,000 uf before the regulator and 300 uf after.

    I have never had a noise problem when using this type of noise suppresion.
    I have used this setup to control 200 KW Plasma Power suplies and miltiple 60,000 BTU refrigeration units. Plasma cutting power supplies start with an artificial lightning bolt and are verry noisey.
    The extra filtering costs a little more but, It is still cheaper than downtime, or Ruined product due a stalled chiller.

    Good Luck,
    Alan Bradford
    Plasma Technologies
    www.plasmatechnologies.com
  • Alan BradfordAlan Bradford Posts: 172
    edited 2005-08-20 17:27
    Hi Again,

    When using large capacitors on your porer supply, make sure that your power supply and/or rectifier circuit can take the inrush current of a large filter capacitor. If you show us a schematic of your power supply we can help with capacitor/filter selection.

    Alan Bradford
    Plasma Technologies
    www.plasmatechnologies.com
  • hcwonghcwong Posts: 38
    edited 2005-08-20 22:55
    Dear Alan,

    I am using a 5v, 3A switching power supply (SPS) as the power supply for the BS2. And this power supply only supplies to my control board with the BS2. I make sure that I have sufficient voltage/ current for my control board.

    I had earlier use my own homebrew power supply (transformer with bridge rectifier and a few capacitors) but the BS2 behave wierdly when in my machine. When I replace my homebrew power supply with the SPS·and mains filter, every is fine again except with the occasion hang.

    One thing I learn is that when your circuits is developed in the lab, every works fine. But once you install it in the machine, it will behave wierdly because of power supply noise in the machine. You have to do the relevant mains filter to eliminate the noise problem. Correct me if I am wrong.

    By the way, thanks for your comments.
    Alan Bradford said...
    Hi Again,

    When using large capacitors on your porer supply, make sure that your power supply and/or rectifier circuit can take the inrush current of a large filter capacitor. If you show us a schematic of your power supply we can help with capacitor/filter selection.

    Alan Bradford
    Plasma Technologies
    www.plasmatechnologies.com
  • hcwonghcwong Posts: 38
    edited 2005-08-20 23:14
    Dear Bean,

    Thanks for your info.

    I will try it out.
    Bean (Hitt Consulting) said...
    It really doesn't matter what values. For the most part larger values are better (within reason).
    I would try something line 1 to 10uH coil and a 1,000 to 10,000uF cap.
    Be sure to watch the polarity of the cap.

    Wire it like this:
    ·································· ·coil
    POWER TO BS2
    ()()()----+
    TO BS2 PIN
    ··············································· |
    ··············································· +---|(-- TO COMMON GROUND
    ····················································· cap


    Good luck,
    Bean.

  • Alan BradfordAlan Bradford Posts: 172
    edited 2005-08-21 11:39
    Hi,

    How are you controlling the regrigeration unit?
    Are you engaging the compressor contactor?
    Sometimes this can cause voltage spikes when the contactor energizes. The contacts can arc when the compressor motor starts up.
    I always use optically isolated solid state relays when controlling relays or contactors.
    I use the Opto-22 G4 series, or Grayhill Mini-Series (70M-OAC5).

    Another potential problem with regrigeration units is short cycling. Once the compressor cycles off at the low temperature set point, it cannot be restarted for 3-8 minutes. This is due to the pressure in the compressor. The motor starts easily when there is no pressure in the compressor, but right after it shuts off the pressure is high. It takes a few minutes for this pressure to dissapate. If the motor tries to start up it takes much more current to start. This causes excessive wear on the motor, and compressor. It can also cause the AC mains to drop excessivly to due to the high start current. This can cause a power reset on the stamp.
    Some refrigeration units have high pressure switches to prevent this, but many commercal and industrial units do not. They rely on the control system to provide the delay.

    How big is the unit? (BTU's or Tons)
    3 phase or single phase power?

    Hope this helps.

    Alan Bradford
    Plasma Technologies
    www.plasmatechnologies.com
  • hcwonghcwong Posts: 38
    edited 2005-08-21 13:09
    Dear Alan,

    Thanks for your quick reply.

    I am controlling the refrigeration unit using a standard refrigeration controller. The controller has its own output relay and input temperature sensor. I am not controlling the refrigeration unit using BS2. However, you have some good advice.

    As for the refrigeration compressor, the start delay is done by the refrigeration controller. It is set to 10 minutes on delay after restart.

    The refrigeration unit is only 1/3 hp cooling capacity and is using single phase power supply.

    Thanks for your assistance.
    Alan Bradford said...
    Hi,

    How are you controlling the regrigeration unit?
    Are you engaging the compressor contactor?
    Sometimes this can cause voltage spikes when the contactor energizes. The contacts can arc when the compressor motor starts up.
    I always use optically isolated solid state relays when controlling relays or contactors.
    I use the Opto-22 G4 series, or Grayhill Mini-Series (70M-OAC5).

    Another potential problem with regrigeration units is short cycling. Once the compressor cycles off at the low temperature set point, it cannot be restarted for 3-8 minutes. This is due to the pressure in the compressor. The motor starts easily when there is no pressure in the compressor, but right after it shuts off the pressure is high. It takes a few minutes for this pressure to dissapate. If the motor tries to start up it takes much more current to start. This causes excessive wear on the motor, and compressor. It can also cause the AC mains to drop excessivly to due to the high start current. This can cause a power reset on the stamp.
    Some refrigeration units have high pressure switches to prevent this, but many commercal and industrial units do not. They rely on the control system to provide the delay.

    How big is the unit? (BTU's or Tons)
    3 phase or single phase power?

    Hope this helps.

    Alan Bradford
    Plasma Technologies
    www.plasmatechnologies.com
  • hcwonghcwong Posts: 38
    edited 2005-08-22 10:41
    Dear Bean,

    Can I use a 220uH coil together with a 1000uF capacitor for your suggested circuit? It so happens that I have a 220uH coil with me.

    What is the implication if I use a larger e.g. 220uH coil·to the circuit? Will the filtering be better?

    Thanks for enlightening me.
    Bean (Hitt Consulting) said...
    It really doesn't matter what values. For the most part larger values are better (within reason).
    I would try something line 1 to 10uH coil and a 1,000 to 10,000uF cap.
    Be sure to watch the polarity of the cap.

    Wire it like this:
    ·································· ·coil
    POWER TO BS2
    ()()()----+
    TO BS2 PIN
    ··············································· |
    ··············································· +---|(-- TO COMMON GROUND
    ····················································· cap


    Good luck,
    Bean.

  • BeanBean Posts: 8,129
    edited 2005-08-22 11:01
    Sure go ahead and try it.
    Just make sure it's resistance isn't too high. In other words measure the voltage at the cap.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "One experiment is worth a thousand theories"
    ·
  • metron9metron9 Posts: 1,100
    edited 2005-08-22 13:13
    Another way to track or log the resetting.

    I don't know if you have a clock onboard, if so you can use it, for more exact time but if not, you could do this

    Use a data statement to zero out the first 9 bytes of memory DATA 0,0,0,0,0,0,0,0,0
    Set up a counter variable set in your program that gets inceremented about every second (with a clock every second)

    Store the value of the counter set in locations 0 thru 3 as lsb,msb
    store that same number in locations 4 thru 7. Now you have seconds running in both dword

    At the start of your code check location 8 for the value 255 if it's 255 your BS2 has reset 255 times and go to a flashing led routine (error routine)
    or show the number on the display as the error count (number of resets so far)
    check the value of the dword number at 0 thru 3,
    if its non zero then
    check it with the dword at 4 thru7
    if they are the same its the number of seconds your program has run before resetting
    if location 8 is less then 255 then
    Increment location 8
    if you dont have a display on the bs2 device you can hook it back up to your computer
    have some code at the start that displays the 9 bytes of data

    Note the data command only stores data when the program is loaded from the IDE, not on a reset
    so you have a way to keep track of resets.

    Its early and I just got up, but that's what I came up with for a way to track the problem. Now more coffee is necessary if I actualy code this routine....
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-08-22 15:41
    Bean's Circuit shows...
    ····································coil
    POWER TO BS2
    ()()()----+
    TO BS2 PIN
    ··············································· |
    ··············································· +---|(-- TO COMMON GROUND
    ····················································· cap

    This basically is a Low-Pass filter and is correct, but there is a little math involved to determine proper values.

    The cut-off frequency can be calculated as follows...

    F = 1 / ( 2 * Pi * SQRT ( L * C ) )

    For the suggested values of·· 220uH and 1000uF this works out to about 339Hz

    F = 1 / ( 2 * 3.14159 * SQRT ( .00022H·* .001F )
    F = 1 / ( 2 * 3.14159 * SQRT ( .00000022 )
    F = 1 / ( 2 * 3.14159 * .000469041 )
    F = 1 / ( 6.28318 * .000469041 )
    F = 1 / .002947
    F = 339.328 Hz

    Putting this through a Bode Plotter, using the values of 220uH and·500uH for the inductor and·470uF and 1000uF for the capacitor, the data looked like this...

          Frequency    Gain  L      C   
    below 126  Hz    0.00 dB 220uH  1000uF
          126  Hz    1.29 dB
          316  Hz   17.6  dB
            1 kHz  -19.7  dB
            2 kHz  -30.5  dB
            3 kHz  -38.7  dB
            4 kHz  -42.7  dB
    
          Frequency    Gain  L      C   
    below 222  Hz    0.00 dB 220uH  470uF
          222  Hz    1.54 dB
          501  Hz   32.8  dB
            1 kHz  -13.0  dB
            2 kHz  -23.7  dB
            3 kHz  -32.0  dB
            4 kHz  -36.1  dB
    
          Frequency    Gain  L      C   
    below  89  Hz    0.00 dB 500uH  1000uF
           89  Hz    3.26 dB
          222  Hz   19.7  dB
            1 kHz  -25.0  dB
            2 kHz  -37.8  dB
            3 kHz  -45.9  dB
            4 kHz  -49.9  dB
    
    

    ...for the values of·220uH and 1000uF, I would be concerned at 120 Hz because this is a·component of 60Hz.
    At 126 Hz these values had a slight gain of 1.29 dB on the output.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • BeanBean Posts: 8,129
    edited 2005-08-22 18:26
    If you are powering the stamp above 6 volts you could use a diode and capacitor solution.
    Just replace the coil with a diode. and use a large value cap (10,000uF ?).
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "One experiment is worth a thousand theories"
    ·
  • hcwonghcwong Posts: 38
    edited 2005-08-22 22:38
    Dear Beau,

    I am staying in Malaysia and we are using power which is 240V, 50Hz.

    Will I have a problem if I use the combination of 229uH and 1000uF in the suggested LC circuit?

    Please help me to do this analysis.

    Thanks in advance.
    Beau Schwabe (Parallax) said...
    Bean's Circuit shows...
    ····································coil
    POWER TO BS2
    ()()()----+
    TO BS2 PIN
    ··············································· |
    ··············································· +---|(-- TO COMMON GROUND
    ····················································· cap

    This basically is a Low-Pass filter and is correct, but there is a little math involved to determine proper values.

    The cut-off frequency can be calculated as follows...

    F = 1 / ( 2 * Pi * SQRT ( L * C ) )

    For the suggested values of·· 220uH and 1000uF this works out to about 339Hz

    F = 1 / ( 2 * 3.14159 * SQRT ( .00022H·* .001F )
    F = 1 / ( 2 * 3.14159 * SQRT ( .00000022 )
    F = 1 / ( 2 * 3.14159 * .000469041 )
    F = 1 / ( 6.28318 * .000469041 )
    F = 1 / .002947
    F = 339.328 Hz

    Putting this through a Bode Plotter, using the values of 220uH and·500uH for the inductor and·470uF and 1000uF for the capacitor, the data looked like this...

          Frequency    Gain  L      C   
    below 126  Hz    0.00 dB 220uH  1000uF
          126  Hz    1.29 dB
          316  Hz   17.6  dB
            1 kHz  -19.7  dB
            2 kHz  -30.5  dB
            3 kHz  -38.7  dB
            4 kHz  -42.7  dB
    
          Frequency    Gain  L      C   
    below 222  Hz    0.00 dB 220uH  470uF
          222  Hz    1.54 dB
          501  Hz   32.8  dB
            1 kHz  -13.0  dB
            2 kHz  -23.7  dB
            3 kHz  -32.0  dB
            4 kHz  -36.1  dB
    
          Frequency    Gain  L      C   
    below  89  Hz    0.00 dB 500uH  1000uF
           89  Hz    3.26 dB
          222  Hz   19.7  dB
            1 kHz  -25.0  dB
            2 kHz  -37.8  dB
            3 kHz  -45.9  dB
            4 kHz  -49.9  dB
    
    

    ...for the values of·220uH and 1000uF, I would be concerned at 120 Hz because this is a·component of 60Hz.
    At 126 Hz these values had a slight gain of 1.29 dB on the output.

  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-08-23 01:04
    hcwong,

    With an inductor value of 229uH and a capacitor of 1000uF, the peak/cutoff frequency is at about 330 Hz with 33.6dB.

    What this mean is that any frequency, spikes, etc with components above 330Hz will /should be ignored.


    BTW) This should be ok with 50 or 60 Hz...

    Frequency    Gain
    
     50.0 Hz     0.20 dB
     59.9 Hz     0.29 dB
    100.0 Hz     0.87 dB
    120.0 Hz     0.93 dB
    150.0 Hz     2.01 dB
    181.0 Hz     3.06 dB
    
    330.0 Hz    33.60 dB
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    640 x 480 - 66K
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2005-08-23 02:01
    HCWONG
    First I like to say to every one
    I would like to say is that I am a A/C and REFRIGERATION TECH
    and what going to point out is what i have seen before

    I DO NOT
    WANT TO MAKE THIS SOUND LIKE I KNOW EVERY THING OR SOUND LOUD
    I would like to point out few thing
    (1) you said
    ·"The refrigeration unit is only 1/3 hp cooling capacity and is using single phase power supply"
    IS this a refrigerator like one in your house or is this a commercal unit
    This might make diffrents depending how far the outlet is from the main
    breaker if this a commercal uint then would make a diffrents because it takes
    more LOCK ROATER AMP than an· refrigerator dose· and if you are a long ways
    from the main breaker panel and IF the WIRE SIZE IS TO SMALL (# 14 wire instead of # 10 ,# 10 wire need to be use for run LONER· then 15 feet
    you could have to much of voltage DROP to the compressor unit, also i have seen in commercal sites where the outlet that is 120 volts could be 110 volts
    or lower this in is NOT good because when a compressor starts with 100
    volts let say your voltage could go DOWN to as low 88 volts and with that the compressor would start the
    ·FRIST TIME WHEN COMPRESSOR WAS COLD but after that would have a hard time starting with out a HARD START KIT and even then it may have a hard time starting· and this even worst if the unit has a CAPTUBE because
    it can take a lot long time for the (HIGHSIDE OF THE COMPRESSOR TO· =
    LOWSIDE OF THE COMPRESSOR)· now you DID NOT SAY what TEMP you are
    using but· COLDER THAN 45*F· this could be some it to because· takes longer to
    (=)
    All right now saing that IF IT WHERE MY PROJECT· I would do this
    (1) I would run the bs2 ONLY on batterys power because of what i said before
    (a) You would not have to worry about what you line voltage was
    ·(b) you could use 6 volt @ 300 amp hr nicads (1\2 size AA batterys)
    You could use bigger batterys but if charge and discharge rate is small
    then using bigger would be wasting money because after these batterys
    have been there for 6 month it may only run for 5 min when you may have
    run test in the being they lasted· 1 to 3 hours

    (c) you could charge batterys with a 317 ic chip as a current reg @ 20 ma
    this will not over· charge them the only thing is that if the power is off for a long time you may want to have switch to a higher milamp like 100 for 30 min
    I have used (C) this in past to charge battery flashlight that are on charge
    ALL THE TIME and this works very well
    I hope that the· thoughts that i have given you here will·help solves your problem
    sam
  • hcwonghcwong Posts: 38
    edited 2005-08-23 20:41
    Dear Beau,

    Many thanks for the analysis.

    By the way, adding the coil and capacitor does not work. The BS2 still hangs.

    I guess I have to hit the path by adding a supercap. I had ordered it thru Newark, thus it will take a few days to arrive.

    Thanks folks for your recommendation.
    Beau Schwabe (Parallax) said...
    hcwong,

    With an inductor value of 229uH and a capacitor of 1000uF, the peak/cutoff frequency is at about 330 Hz with 33.6dB.

    What this mean is that any frequency, spikes, etc with components above 330Hz will /should be ignored.


    BTW) This should be ok with 50 or 60 Hz...

    Frequency    Gain
    
     50.0 Hz     0.20 dB
     59.9 Hz     0.29 dB
    100.0 Hz     0.87 dB
    120.0 Hz     0.93 dB
    150.0 Hz     2.01 dB
    181.0 Hz     3.06 dB
    
    330.0 Hz    33.60 dB
    
    

  • hcwonghcwong Posts: 38
    edited 2005-08-23 20:50
    Dear Sam,

    I am using a commercial refrigeration unit and the main breaker is rather far. The temperature setting is 15 deg Celcius. I guess the high amp·may be the problem.

    I am trying out with the supercap first to see it helps.

    Thanks for your recommendation.
    sam_sam_sam said...
    HCWONG
    First I like to say to every one
    I would like to say is that I am a A/C and REFRIGERATION TECH
    and what going to point out is what i have seen before

    I DO NOT
    WANT TO MAKE THIS SOUND LIKE I KNOW EVERY THING OR SOUND LOUD
    I would like to point out few thing
    (1) you said
    ·"The refrigeration unit is only 1/3 hp cooling capacity and is using single phase power supply"
    IS this a refrigerator like one in your house or is this a commercal unit
    This might make diffrents depending how far the outlet is from the main
    breaker if this a commercal uint then would make a diffrents because it takes
    more LOCK ROATER AMP than an· refrigerator dose· and if you are a long ways
    from the main breaker panel and IF the WIRE SIZE IS TO SMALL (# 14 wire instead of # 10 ,# 10 wire need to be use for run LONER· then 15 feet
    you could have to much of voltage DROP to the compressor unit, also i have seen in commercal sites where the outlet that is 120 volts could be 110 volts
    or lower this in is NOT good because when a compressor starts with 100
    volts let say your voltage could go DOWN to as low 88 volts and with that the compressor would start the
    ·FRIST TIME WHEN COMPRESSOR WAS COLD but after that would have a hard time starting with out a HARD START KIT and even then it may have a hard time starting· and this even worst if the unit has a CAPTUBE because
    it can take a lot long time for the (HIGHSIDE OF THE COMPRESSOR TO· =
    LOWSIDE OF THE COMPRESSOR)· now you DID NOT SAY what TEMP you are
    using but· COLDER THAN 45*F· this could be some it to because· takes longer to
    (=)
    All right now saing that IF IT WHERE MY PROJECT· I would do this
    (1) I would run the bs2 ONLY on batterys power because of what i said before
    (a) You would not have to worry about what you line voltage was
    ·(b) you could use 6 volt @ 300 amp hr nicads (1\2 size AA batterys)
    You could use bigger batterys but if charge and discharge rate is small
    then using bigger would be wasting money because after these batterys
    have been there for 6 month it may only run for 5 min when you may have
    run test in the being they lasted· 1 to 3 hours

    (c) you could charge batterys with a 317 ic chip as a current reg @ 20 ma
    this will not over· charge them the only thing is that if the power is off for a long time you may want to have switch to a higher milamp like 100 for 30 min
    I have used (C) this in past to charge battery flashlight that are on charge
    ALL THE TIME and this works very well
    I hope that the· thoughts that i have given you here will·help solves your problem
    sam
  • hcwonghcwong Posts: 38
    edited 2005-08-26 22:34
    I have tried with a 1F 5.5V Panasonic Supercap connected to the supplies of the BS2 but does not resolve the problem either.

    Anyone have a better suggestion how to resolve the problem?

    Thanks.
  • Alan BradfordAlan Bradford Posts: 172
    edited 2005-08-26 23:30
    Hi,

    It looks like you are not getting the reset from the power supply.

    How are you controlling the AC unit? The stamp I/O pin is driving something, that is driving something that is driving the AC Controller.

    I have had problems with noise getting in through the I/O lines. That is why I use the Murata Digital Noise filters on ALL I/O and Programming lines. MuRata Part Number DSS306-55Y5S471M100. Info in post from 8-20-2005.

    Are you leaving the serial programming cable attached while running the Stamp? I have had some problems when that is left connected.

    When all else fails...Look for a programming bug.. Do you have any nested loops? A stack over load is a common problem.

    If you do not find any..Let someone else look..I find I make the same mistakes over and over again. A new set of eyes can spot problems as they see from a diffrent perspective.

    I have attached a schematic for a StamPLC controller that is running a 10,000 volt 2 mhz spark gap Plasma Igniter. I have used this circuit many times in the· past. It lives in the same box as the Spark·Transformer. The prototype of ths circuit lasted 3 years until an earthquake, in Taiwan, wiped out the building it was in.

    I hope this helps you find your problem.

    Good Luck,

    Alan Bradford

    Plasma Technologies

    www.plasmatechnologies.com
  • Philip GamblinPhilip Gamblin Posts: 202
    edited 2005-08-29 04:46
    Alan mkes some really good suggestions, especially considering all the power supply work you have done. I agree with Alan that the root of the problem has not yet correctly been identified.
  • metron9metron9 Posts: 1,100
    edited 2005-08-29 11:50
    Somebody said...
    I agree with Alan that the root of the problem has not yet correctly been identified.

    Ditto, that's what I was responding too in the original question and I thought the assumption that the power was the problem should be confirmed by logging the time onboard the stamp and other debugging information. Using variables as counters in each subroutine and updating them in the eeprom during program execution you can layout a map of execution that can be read after the error condition presents itself. On a reset the program would know the reset had occoured because the data at loacation 0 would not be 0 anymore and the stamp would not simply restart.
  • hcwonghcwong Posts: 38
    edited 2005-08-29 22:31
    I manage to resolve the problem by adding the Ni-Cd Battery and charger circuit to the BS2 supply.

    The compressor is drawing to much current causing·voltage drop during start-up.

    Thanks folks for your kind assistance.
Sign In or Register to comment.