Digital out switching itself off (Interfacekit)

Technical Discussions on any InterfaceKits
zard
Phidgetsian
Posts: 6
Joined: Mon Jan 31, 2011 1:33 pm
Contact:

Digital out switching itself off (Interfacekit)

Postby zard » Fri Feb 03, 2012 3:52 am

Hi,
I have a simple script acting as thermostat, switching the heating on if the temperature is within certain bounds.

For that I am I am using an 8/8/8 InterfaceKit with the dual relay module to switch the heating (which has a control line with 20V on it) and couple of temperature sensors to measure the air temperature

All has been working well but from time to time the relay just switches itself off. When I check the status of the digital out I have set on just a few moments ago, it reads that the out is off.

At the moment I have resulted into a timer checking the status of the digital out and re-switching it on if needed. It works but I do not like the solution as it sometimes causes a little delay in the heating switch (if the heater is full on and then receives off and on signal within a short time, it has internal timeout preventing it from frequent state changes).

I am using python SDK on a linux machine.

Is it possible that the phidget just "crashes" without raising any exceptions and then reconnects again, losing the state of digital outs in the process? I am not watching the detach events, but there is another timer pulling the temperatures and that never raises any exceptions. Also the "reconnect" timer never raises any exception, its call to

Code: Select all

interfaceKit.setOutputState
goes through without any problem.


Thank you very much for your advice!

User avatar
Patrick
Lead Developer
Posts: 3091
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Digital out switching itself off (Interfacekit)

Postby Patrick » Fri Feb 03, 2012 12:23 pm

You may be getting a quick detach/attach. You should definitely watch and handle the detach/attach events anyways. You can also enable logging in the library and see what may be happening.

If you are getting detaches, it's probably either voltage related or EMI related. You can try using a thicker and/or shorter USB cable and/or one with ferrite beads.

-Patrick

zard
Phidgetsian
Posts: 6
Joined: Mon Jan 31, 2011 1:33 pm
Contact:

Re: Digital out switching itself off (Interfacekit)

Postby zard » Fri Feb 03, 2012 2:15 pm

Ok,
will do that. I did not know that I can get unnoticed detaches/attaches,
I am catching PhidgetException with all the actions just to be on the safe side but that's not enough as I see.

Regarding EMI, I have read the recommendations you have, I will try to get the beads somewhere. Are they important only on the USB cable or also on the sensor cables? One of them is rather long (around 8m). For the USB cable itself I have chosen the shortest (and thickest/most durable looking)I had (around 1m).

I used to have similar problems in other setup where I was able to trigger detach/attach by quickly switching an incandescent bulb on and off (about 5 times forced the reset). At the time I could monitor it easily as it was attached to my computer and I did the above steps using the default UI. This is not really feasible now as I see because the phidget is attached to a headless machine in another room and also the error happens after some minutes after connection (and I do not feel keen to sit there and watch if the UI flickers).

So in conclusion - I will try to monitor the detach/attach states and see if they are causing the problems.
If they indeed did and I was restoring the state on new attach, is there any "hardware" way to delay reaction to digital output change? e.g. can I keep the relay up even if the signal goes down for half a second? I have to admit that I know very little about the lower-level electronics but isn't this what capacitors or transformators do? Hold the signal for a moment and if it comes again within a certain period you do not get anything on the output. I realise that would introduce a general delay in both switching the relay on/off.

Thanks a million for your help!

User avatar
Patrick
Lead Developer
Posts: 3091
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Digital out switching itself off (Interfacekit)

Postby Patrick » Mon Feb 06, 2012 10:27 am

Hi,

Your problem definitely sounds like EMI. You can either buy the ferrites from Digikey or similar, or just buy a USB cable that has them built-in.

You should always handle detach/attach even if you don't expect them, but you should not expect them to happen from EMI - this should be addressable.

As for the digital outputs - on Attach, the firmware sets all outputs to a known state (low) - so there is no way of keeping them high.

I hope you kept your old thermostat connected inline set to a low temperature so your house doesn't freeze if the Phidget/program fail for a long period.

-Patrick

zard
Phidgetsian
Posts: 6
Joined: Mon Jan 31, 2011 1:33 pm
Contact:

Re: Digital out switching itself off (Interfacekit)

Postby zard » Wed Feb 08, 2012 3:54 am

Patrick wrote:I hope you kept your old thermostat connected inline set to a low temperature so your house doesn't freeze if the Phidget/program fail for a long period.

I did but it would not be much of a problem - it never gets below zero for long enough for the flat to freeze..

EMI has been confirmed - my log now states: (where the number is just unix time)
1328668312 ifkit detached!
1328668312 ifkit attached!
1328668841 ifkit detached!
1328668841 ifkit attached!

Now I need to get my hands on some of those ferrite beads - do I need them only for the USB cable or also for the sensor ones?

Do I understand it right that the computer receives too much interference via the USB connection and thus re-sets it? (with the InterfaceKit not having much to do with it?)

User avatar
Patrick
Lead Developer
Posts: 3091
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Digital out switching itself off (Interfacekit)

Postby Patrick » Thu Feb 16, 2012 3:20 pm

Yes - if too much interference is introduced into the USB cable, the computer just resets the USB device.

You don't need ferrites on the sensor cables, just USB.

-Patrick

zard
Phidgetsian
Posts: 6
Joined: Mon Jan 31, 2011 1:33 pm
Contact:

Re: Digital out switching itself off (Interfacekit)

Postby zard » Thu Feb 16, 2012 4:04 pm

ok, I understand it now. Thanks! I will hunt for some ferrite beads to clip onto the USB cable.

Is the occasional reset something happening to all our usb devices and only because I program with Phidgets on a bit lower level that I can see the reconnects?


Return to “InterfaceKits”

Who is online

Users browsing this forum: No registered users and 1 guest