Re: REMOTING SIX SENSORS ON ONE TWISTED PAIR - PART 10

Post any questions you may have about our current range of USB data loggers
Post Reply
Glovisol
Advanced User
Advanced User
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

Re: REMOTING SIX SENSORS ON ONE TWISTED PAIR - PART 10

Post by Glovisol »

Typical Switch Mode PSU noise on output terminals
Typical Switch Mode PSU noise on output terminals
10. RS485 SYSTEM TESTING & RESULTS

The plan is to periodically report System testing and results in this Part 10 as replies. All tests have been carried with the coaxial cable simulator set at 3300 ft.

10.1 SLAVE BAREFOOT WITH EXT. PSU AND NO USB CONNECTED PC

One thing is to test this RS485 COMM System in the lab with Master and Slave units a foot from each other, another thing is to have it working reliably in the field. Last week I was worried at the idea of testing with an external supply connected to the Slave and in fact I popped one Modem in the blink of an eye, because I had not joined the modems with the ground conductor. System use with external supplies poses several problems which we will analyse in this section.

RECOMMENDATIONS FOR NOT BLOWING THE MODEMS
The modems are based on the Half Duplex MAX485 chip and I have uploaded the System schematic, from the Modem point of view. The MAX485 chip is a differential & balanced type communicator, but unfortunately it is not galvanically decoupled from the plus and minus supply terminals. Furthermore the chip data sheet does not provide any clue on stray voltage handling capability of the device, thus great care must be used in this respect, considering we are using a high sensitivity semiconductor chip. With reference to the schematic, as far as stray danger potentials are concerned, signal terminals A & B are at the same potential, being terminated by an internal 120 Ohm resistor. I advise adding a second 120 Ohm resistor across the terminals of each modem. Therefore there is no danger of damaging stray voltages between A and B.

The danger is represented by voltage differentials between the Master and the Slave grounds, which will make a relatively large current flow beween the ground pin of one Modem and the ground pin of the other while they are joined together by the twisted pair signal line. A transient capacitive current can also flow at switch-on when using an external supply for the Slave. These problems can be solved by using a third conductor joining the ground pin of each Modem and the common terminal of the PSU, but only if this common terminal does not reach external ground. This conductor will keep Master and Slave at the same ground potential. Chip failure modes are of two types: just blow and become totally inoperative or, much more insidious, the receiver portion will de-sensitise and all of a sudden OOS warnings will start to appear erratically.

Modems must be handled with care. They come in an anti-static envelope and must be kept there before use. They should be mounted on sockets, so there is no risk of damage with soldering and/or statics from the soldering iron and test/replacemen becomes quick and easy. When placing them on the Master or Slave assembly, the assemblies must be disconnected from USB lines, signal lines and external supplies, if used: this minimizes the danger of statics.

EXTERNAL SLAVE SUPPLY
Once the sketch has been uploaded thru the USB port, ideally the Slave should work barefoot. This mode of operation requires an independent + 9V supply. Several different switch mode supplies were tested for this job and with all of them the OOS count climbed up from zero to significant levels. Switch modes are noisy and the enclosed Picoscope Screen shows what to expect: noise peaks exceeding 5 V at the output. That the System could still work in these conditions proves the quality of the Modem noise rejection, but obviously a small linear PSU is the solution, considering that the Slave unit draws less than 90 mA @ 9V, or less than 1 W. I have enclosed PC screens and Photos. Will produce guidance for a miniature linear supply in next post.

With the already downloaded sketches, sketch_MASTER_485_7_5_b and sketch_SLAVE_485_7_2, no provision is made for temporary shutdown of mains at the Slave. This problem & its solution will be discussed in one of the next posts.
Attachments
Revised Ver. 1.6 of Modems schematic
Revised Ver. 1.6 of Modems schematic
Complete RS485 COMM System.JPG
Slave temporarily fed by a lab Linear PSU/Calibrator for testing
Slave temporarily fed by a lab Linear PSU/Calibrator for testing
Last edited by Glovisol on Sat Mar 05, 2016 7:57 am, edited 4 times in total.

Glovisol
Advanced User
Advanced User
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

Re: REMOTING SIX SENSORS ON ONE TWISTED PAIR - PART 10

Post by Glovisol »

"Clean" line pulse train with Linear PSU
"Clean" line pulse train with Linear PSU
10.2 SLAVE EXTERNAL LINEAR +9V PSU

This linear supply has a total noise / 100 Hz ripple output of +/- 10 mV and does not degrade System performance.
Attachments
Very low Linear PSU ripple/noise compared to the Switch Mode PSU
Very low Linear PSU ripple/noise compared to the Switch Mode PSU
Small 2W linear PSU for remote Slave running barefoot
Small 2W linear PSU for remote Slave running barefoot
"Dirty" line pulse train with switch mode PSU
"Dirty" line pulse train with switch mode PSU
Linear PSU built around a subminiature A.C. Transformer and a Regulator IC
Linear PSU built around a subminiature A.C. Transformer and a Regulator IC

Glovisol
Advanced User
Advanced User
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

Re: REMOTING SIX SENSORS ON ONE TWISTED PAIR - PART 10

Post by Glovisol »

Simple RC filtering works well with the 1012!
Simple RC filtering works well with the 1012!
10.3 ENTERS THE PICOLOG 1012 DA - SIMPLIFIED MASTER PWM OUTPUT CIRCUITRY

FILTERING
The 1012 has a notably better than anticipated noise tolerance, which allows a radical simplification of the System PWM output circuitry. In fact the 1012 tolerates DC signal inputs with 10% ripple and PWM output filtering can be achieved with a simple RC network, eliminating the Active Lowpass Filters and the negative supply. An added benefit is the elimination of possible line interference by the square wave negative supply.

Micro output pins 3-11 and 9-10 have a PWM ouput frequency of 470 Hz and pins 5-6 an output frequency of 975 Hz. At the RC network cut-off frequency, signal amplitude is halved (-6 dB). At one tenth the cutoff frequency, signal amplitude is down to 10%, or 20 dB. To summarise, attenuation increases by 20 db/decade. The Picolog 1012 tolerates a D.C. input with 10% ripple. Components for 10% and 1% ripple are calculated below.

For 10% ripple – attenuation 20 dB
Fc = 470 Hz
Factor = 0.1 (10%, or 20 db attenuation)
Fa = 470 * 0.1 = 47 Hz
R = 33KOhm
C (uF) = (10^6)/(2*PI*Fc*R) = (10^6)/(2*3.14*470*33000) = 0,1 uF or 100 nF



For 1% ripple – attenuation 40 dB
Fc = 470 Hz
Factor = 0.01 (1%, or 40 db attenuation)
Fa = 470 * 0.01 = 4.7 Hz
R = 33KOhm
C (uF) = (10^6)/(2*PI*Fc*R) = (10^6)/(2*3.14*4.7*33000) = 1 uF


At the PWM output frequency of 975 Hz ripple will be even less. In the range 0 -2.5V output ripple is of course zero @ 0V and @ 2.5V and maximum at 1.25 V. The enclosed PC screen, as anticipated, shows 1% ripple (20 mV) @ 1.25 V output.

The Micro Reference voltage is now 2.5 V, but the PWM square wave is still 0 to 5V and we need a 2:1 voltage divider before RC filtering. The new, simplified Master schematic is enclosed.

The COMM system works with zero OOS down to 30 Millis Recycle Time with a path length of 3300 ft. This Recycle time corresponds to 40 mS, or a frequency of 25 Hz approx. and the 10% ripple RC network can be used. For longer Recycle times the 1% ripple RC network is recommended.


CALIBRATION

The Master and Slave Reference circuits must be left on for at least 24 hours before final calibration to 2500 mV with an accurate standard.

The Micro output pins show a small offset at Zero output, which would degrade accuracy near Zero output. Here Picolog comes to the rescue and two different calibration methods can be used for each of the six channels. Remember that resolution is 10 mV approx., so accuracy will always be +/- 10 mV worst case.

Equation

a) With the System in operation and the 1012 connected, first input 2500 mV at Slave and find parameter k in the equation: X*k in Picolog to read 2500 mV.
b) In Picolog write equation : X*k.

c) Now input 0 mV at Slave and note offset h. It will typically be: h = 15 mV. Add h to the equation as follows: (X*k) – h.

d) Now go back to 2500 mV at Slave: you will find that the value shown by Picolog will be too low: slightly increase k to correct and check 0V again.

e) After two or three iterations the complete COMM / DA system will be within the 10 mV resolution across the full 0 – 2500 mV range.

f) A typical equation could be : (X * 1043) – 14.96

Table

g) Make a list of measurements every 250 mV from Zero to 2500 mV. This is the table to be inserted in Picolog.
Attachments
OOps...I forgot. Here is the new Master schematic!
OOps...I forgot. Here is the new Master schematic!
RS 485 - 11.PLW
0 - 2500 mV Test PLW File
(19.4 KiB) Downloaded 468 times
Complete System performance @ 1000 mV
Complete System performance @ 1000 mV
Complete System performance @ 2500 mV
Complete System performance @ 2500 mV
Last edited by Glovisol on Mon Mar 21, 2016 10:17 am, edited 1 time in total.

Glovisol
Advanced User
Advanced User
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

Re: REMOTING SIX SENSORS ON ONE TWISTED PAIR - PART 10

Post by Glovisol »

Screen illustrating automatic System setting with OOS/A.C. power outages
Screen illustrating automatic System setting with OOS/A.C. power outages
10.4 ENTERS THE DrDAQ - NEW FUNCTIONS NECESSARY WHEN SLAVE WORKS BAREFOOT

The DrDAQ works well with the RS485 System, but only if the Buffer is employed, the reason being that the filtered PWM outputs are high impedance and must be terminated into a high impedance, while the bare EXT. inputs of the DrDAQ have pull-ups which need to be "pulled down" to whatever voltage is delivered by the Micro. In fact the Buffer/DrDAQ combination exhibits better precision near Zero Volts than the 1012, because the Op Amps in the Buffer are capable of pulling the Ext. inputs even below Zero Volts.

Calibration procedure is as previously described and, as an example, the equation for the EXT. 1 channel of my DrDAQ is: (X*1020) - 11.4.

NOTE: what follows is valid for any Data Logger, not for the DrDAQ alone!

When the Slave works off the USB line of a laptop PC, A.C. mains outages do not represent a problem: the Slave carries on working off the laptop's internal battery. Another story with the Slave working barefoot off the linear PSU. In this case the Sketches and the Micro must keep the situation under control. The Sketches have been modified to ensure the following functions.

a) If OOS (Out OfSync) conditions happen during normal operation, the System stops, records the number of OOS and then automatically resumes operation. When the programmed number of Iterations is reached, System stops and the total number of OOS's displayed.

b) If A.C. mains fail and the Slave stops working, the Master will record the OOS happening, if any, while thePSU output voltage is dropping towards zero, then will set the PWM outputs at any desired resting level (in the PC screens this level is set at 127, corresponding to 1250 mV) and finally will stop iterating.

c) As soon as A.C.power comes back and the Slave re-starts operation, the Master turns on, brings the PWM output levels to the actual levels transmitted by the Slave and resumes Iterations until another A.C. power outage or until the end of the programmed iterations.

In the next post the new sketches will be uploaded.
Attachments
Many A.C. Mains outages in a 30 minutes run
Many A.C. Mains outages in a 30 minutes run
RS485 COMM System + DrDAQ under test
RS485 COMM System + DrDAQ under test

Post Reply