PLC code lost

nbright

Member
Hello All,
 
I finally got my boards reinstalled after sending them in for FW upgrade to 03.02.17g and am still battling intermitant temp sensor failures.  I do not see the boards hanging as often anymore, but did have one where the PLC code editor was reset somehow to show the default message, "Please paste your PLC code here!".
 
Just a quick rundown of the setup:
 
WC8 mounted inside a grounded metal enclosure.
 
200w LED power supply feeds 12v to WC8 enclosure over two pairs in a cat5 cable about 30 feet.
 
regulated power supply is bucking the 12v to 9v inside wc8 enclosure.
 
one sheilded cat5 is connected to humidity and temp sensor inputs, with shield bonded to metal enclosure only at one end.
 
at the end (20' away) of the shielded cat 5 there is one two port telephone jack with one for temp and one for humidity.
 
Temp and humidity sensors have been crimped into rj-11 ends to plug into jacks.
 
 
This board has had no problem with humidity sensor, but the temp sensor is only up about half of the time.  I wrote a little piece of code with the sole purpose of checking sensor reliability and it worked ok, until the board lost the code, but did not reset completely, as the network settings were still as i set them.  Some times when I login to the board the temp sensor is unbound and I will have to send network config to remotely reboot.  Without a scope to check, I cant know for certain, but I suspect powerline noise to be the issue, as there is lots of equipment running in a small space.  I have however payed particular attention to powerlines and comm cables not running parallel too close.  My LED power supply has also been isolated from equipment grounds in the building, with the common negative side bonded to an isolated ground.
 
I was hoping to use the wc8 to control HVAC and lighting, but I will need to have a couple of months of monitoring data to prove reliability.
 
Any suggestions?
 
 
 
nbright said:
one sheilded cat5 is connected to humidity and temp sensor inputs, with shield bonded to metal enclosure only at one end.
at the end (20' away) of the shielded cat 5 there is one two port telephone jack with one for temp and one for humidity.
Temp and humidity sensors have been crimped into rj-11 ends to plug into jacks.
 
CAT5 cable is 4 pairs.
The humidity sensor is analog, using 3 wires. How have you split pairs to connect it?
The temperature sensor is a dallas one-wire (digital) protocol, also using 3 wires. How have you split pairs to connect it?
Have you added a 4K7 pullup resistor at the far end between the temperature sensor +5 pin and Data pin? (This often helps)
 
You should update the firmware to the latest one.
Code:
http://www.cainetworks.com/support/how-to-update.html
 
Ross,
 
I tried one config with data and ground on the same pair, 5v on a single from another pair.  The config that seemed to be a bit more reliable was to use 5v and data on one pair with ground on a single from another pair.  Humidity and temp grounds are using the same pair, one conductor each.  I will try the addition of a resistor as well. 
 
CAI,
 
I will be at the project site in the morning and will give that a try.
 
Thanks to all, I will let you know how it turns out...
Nick
 
You have plenty of conductors.
I'd use:
 
Pair1:  Ground , +5V to humidity sensor
Pair2: Ground, Output from humidity sensor
 
Pair3: Ground, +5V to temperature sensor
Pair4: Ground, data to/from temperature sensor
 
Additionally, I would add a 1uF or thereabouts (anything up to 10uF, low ESR or tag-tantalum) across the temperature sensor ground/+5V
And, 4K7 from temperature sensor +5V to temperature sensor data line.
 
This is perhaps somewhat overkill, but I think it'll give you the best chance of stability over the cable lengths you're mentioning.
 
Ok so I got one board working great, with the temp sensor 7994 times more "ok" than not.  That was with a 4.7k ohm resistor between +5v to data at the sensor end of the cable, and a 1uF tantalum from ground to +5v at the board end of the cable.
 
Copying this configuration on a second board has not worked so well for me, with the sensor "ok only about half of the time.  Firmware has been upgraded to 03.02.18b5 on both boards.
 
I did notice that the default 1wire timing has changed from my last firmware.  I had to change the timing to 5 for my sensor to even show up half time.  Any tips on dialing in timing when having issues?
 
I know  Ross said this may be overkill, but how can we maybe overkill it a little more?
 
Oh yeah, and I split the pairs up with a ground in each pair.
 
Should the capacitor be at the far end of the cable, or right at the board?
 
nbright said:
Ok so I got one board working great, with the temp sensor 7994 times more "ok" than not.  That was with a 4.7k ohm resistor between +5v to data at the sensor end of the cable, and a 1uF tantalum from ground to +5v at the board end of the cable.
 
That's a good start then. I'd personally put the tantalum at the sensor, where the current spikes are likely to be.
 
 
nbright said:
Copying this configuration on a second board has not worked so well for me, with the sensor "ok only about half of the time.  Firmware has been upgraded to 03.02.18b5 on both boards.
 
Disappointing. Perhaps adjusting the timing might help.
 
 
nbright said:
Oh yeah, and I split the pairs up with a ground in each pair.
Should the capacitor be at the far end of the cable, or right at the board?
 
Cap at far end, as stated above.
The point of using twisted pairs is that external fields should introduce the same voltage in both conductors equally - but with opposite polarities, in effect cancelling each other out. So running two grounds on one pair is largely wasted effort, but ground and data are a good match because the data is ground-referenced.
 
Once you updated firmware, it should not lost PLC code any more.
The 1-wire timing on the new firmware is 3, with longer cable, that number should be adjusted bigger if the board not finding the sensor.
 
CAI_Support said:
Once you updated firmware, it should not lost PLC code any more.
The 1-wire timing on the new firmware is 3, with longer cable, that number should be adjusted bigger if the board not finding the sensor.
 
anyhow a wiring scheme with multiple 1 wire lines starting from the board is evil- check out with Maxim
 
Efried said:
anyhow a wiring scheme with multiple 1 wire lines starting from the board is evil- check out with Maxim
 
It's not necessarily and universally "evil".
It may be sub-optimum, but it works fine if you remain within some practical constraints.
 
Ross,
 
I now have both boards in service with zero failure!  Thanks again!  I only have one sensor per board, but I am thinking when I add additional sensors, relocate the resistor and cap to the new end of the line? (sensor furthest from board)  Also, should I just tie the shield wire through to for additional sections of cable, with still just the board end bonded to ground.  I have some past experience with rs 485 networks, and we always made sure only one end of the cable shield was grounded, so as to not create a fault current path.  Since that would not be practical in my current circumstance, not to mention there is no equipment to have a fault at each sensor location, I would think tying the shields together and board end grounded would be sufficient.
 
CAI,
 
New firmware working well! No lost programs or reboots so far.  It seems that when I have adjusted the sensor timing, sometimes I have to restart the board a few times for over a minute for the change to really take hold.  I did on my board with the longest cable come back to the default setting of 3 as the most reliable, of coarse that is with the cap and resistor at the far end of the bus.
 
This obstacle being passed, I feel confident in the abilities of this hardware in my extremely noisy environment.  Now for integration with Openremote and the other systems I have already in place!  Anyone have some good resources for learning scripting languages for beginners?  I intend to poll various hardware for status and set various hardware accordingly based on rules written in Openremote, (which I guess would be jboss?)  Seems like I will have to call shell scripts and parse a few different types of status files from the different vendors hardware.  Anyways, that is obviously beyond the scope of this thread!
 
Thanks again all!
Nick
 
PS: Opinionated, undereducated posts are even more noxious than the misunderstood "evils" of relentless chest puffing!...Cheers!
 
nbright said:
Ross,
 
I now have both boards in service with zero failure!  Thanks again!
 
Glad it's all working for you.
 
nbright said:
 I only have one sensor per board, but I am thinking when I add additional sensors, relocate the resistor and cap to the new end of the line? (sensor furthest from board)
 
Yes, far (physical) end of the line.
 
nbright said:
 Also, should I just tie the shield wire through to for additional sections of cable, with still just the board end bonded to ground.
 
I'm largely of the view that grounding the shield at one end or the other, but not both, is the most appropriate. Sure, you could gain some additional conductor, but it does increase the risk of noise pickup, and of a short circuit if the cable gets damaged.
 
 
nbright said:
Anyone have some good resources for learning scripting languages for beginners?  I intend to poll various hardware for status and set various hardware accordingly based on rules written in Openremote, (which I guess would be jboss?)  Seems like I will have to call shell scripts and parse a few different types of status files from the different vendors hardware.  Anyways, that is obviously beyond the scope of this thread!
 
Shell scripts are quite straightforward and very powerful. There will be volumes on "shell scripts for beginners" out there, but "learning by doing" is hard to beat. Get a small machine - or even a virtual on one of your existing computers, or grab an inexpensive router/wap and put openWRT on it, and just play. Make it do something silly Break it. Fix it. Learn. Have fun. When you get totally frustrated, come back, post what you've done and what it isn't doing and I'm sure there are enough of us here to point you in the right direction.
 
I would appreciate a wiki on the CAI website featuring the wiring specifications, including the resistors etc.
For the scripting, there is a small chance getting JSON or SensoeML response from webcontrols., is someone invests leading this undertaking.
 
Efried said:
I would appreciate a wiki on the CAI website featuring the wiring specifications, including the resistors etc.
 
There isn't any one "correct" way to do it, because the "real world" throws so many variables.
Experience, backed up by a good understanding of what's going on, why things don't work as expected, and what you can get away with, will generally lead one to a working solution.
 
The complications of running sensors on the end of 100m of cable are just not necessary for a sensor attached via 1m of cable; the (previously declared 'EVIL') practice of a star-connected sensor array can be perfectly reliable under a different set of conditions. What you have to do in a noisy environment will be different to what you can get away with in a quiet environment, etc.
 
Ok, temp sensors are still very reliable, but I did lose the PLC program on one of my two running boards after about two weeks running strong.  Any Ideas what is causing this?  Suggestions and/or remedies?
 
Back
Top