Maker Pro
Maker Pro

How to ground unwanted AC from a metal case?

Mikael Lavoie

Jan 4, 2015
18
Joined
Jan 4, 2015
Messages
18
Hi,

To explain my problem, we have a cnc production machine in my shop that was overheating and the machine had no way to tell us except shutdowning for the time it was cooling itself. So i made a module that have a ds18b20 digital sensor connected directly in the hydrolic system that tell me the temperature in real time, and set off an alarm when a programmed temp is reach. Its perfect to prevent loss of production, but i have a problem with it. The lcd1602 that i use to output data is blowing every couple month. The first time it was my fault, i put no limiting resistor on the backlight. The second time, no sign of overheating except for the main chip on the lcd. Changed it again. This time, when the lcd died, i noted that the lcd was hot during the machine on time, and when i shutdown it to close the shop, the lcd was cold. So i took my multimeter and tried to seek any unwanted voltage, and i found that there is a 3,2V AC current coming from the case (stainless steel case). I removed the mounting and put a layer of rubber behind it and mounted it with plastic bolt to isolate it from the machine. But i still have a 2.4V AC coming from the machine, probably by some sort of induction from a motor inside. So my plan is to try to ground this AC to protect the module.

Now you have the background (which may help you find something i missed), i'm wondering if i can ground the case by connecting a wire from the Negative side of the wall wart, before the voltage regulator that power the module on the case. Will the ac go to the neutral of the shop electrical system ( that is connected to the earth ) ???. I dont know exactly how those wall wart do their jobs so i dont know if i can do it that way.

So thanks in advance for helping me with this situation. I'm getting tired if wiring new lcd to this module.

Mikael Lavoie
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Interesting problem Mike - I remember the module you made last year, it was quite good! The wall wart is converting mains to lower level ac or dc?
Some of the wall warts are simply step down AC transformers, taking, say 120VAC and stepping it down to commonly used AC like 24VAC. It could be overlooked, but if your wall wart is an AC/AC adapter, you might have filtered some of the AC to make a rough DC input that might have powered the device, but it may have had AC ripple behind it as well!
 

Mikael Lavoie

Jan 4, 2015
18
Joined
Jan 4, 2015
Messages
18
Interesting problem Mike - I remember the module you made last year, it was quite good! The wall wart is converting mains to lower level ac or dc?
Some of the wall warts are simply step down AC transformers, taking, say 120VAC and stepping it down to commonly used AC like 24VAC. It could be overlooked, but if your wall wart is an AC/AC adapter, you might have filtered some of the AC to make a rough DC input that might have powered the device, but it may have had AC ripple behind it as well!
I forgot some details it looks like. So the wall wart is a 120VAC 60Hz to 8VDC Converter. I have a AN7805 behind the plug that then provide regulated 5V to power all the component of the circuit.
Another detail i forgot to mention is that when i measured the unwanted voltage, i mesured the stainless steel case in relation to the negative of the wall wart plug. I measured from the sensor ans its well isolated, got nothing. Only 3,2VAC From the case. Only the machine was running, the module was unplugged before the reading.

Some picture for you to see the result of my work.
 

Attachments

  • 20150629_122321.jpg
    20150629_122321.jpg
    141.9 KB · Views: 91
  • 20150629_122331.jpg
    20150629_122331.jpg
    154.2 KB · Views: 87
  • 20150629_122404.jpg
    20150629_122404.jpg
    179 KB · Views: 82
Last edited:

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
A lot more info is needed.
Could you please show a diagram of your circuit and some pictures(of the wall-wart as well)?
What is the ambient temperature of the LCD?
Can you measure the voltages AC/DC on the LCD pins?

I assume there is a μC in it.
What is the physical distance (wire length)between the DS18B20 and the μC that drives the LCD?
 

73's de Edd

Aug 21, 2015
3,613
Joined
Aug 21, 2015
Messages
3,613
.


Sir Mikael Lavoie. . . . . . .


" i found that there is a 3,2V AC current coming from the case (stainless steel case). I removed the mounting and put a layer of rubber behind it and mounted it with plastic bolt to isolate it from the machine. But i still have a 2.4V AC coming from the machine"

I'm reading that as your measurement being between the meters case and the machine.

How about subjecting that voltage leakage that you are experiencing to the standard EIA industry's leakage test
protocol..

You do that by shunting your AC metering with 1500 ohms across it .
Then test and I'll just bet that it will drop to an infinitesimal value and is of no concern . . . just being a feeble static voltage .

If it HAPPENS to be of > 300 mv AC magnitude . . . . THEN you have some leakage

On your old post . . ..

https://www.electronicspoint.com/th...ayout-to-see-if-its-correct-plz.272090/page-2

Seems like it ended up nowhere . . . . am I correct that a "clean" supply probably solved the initial problem ?

73's de Edd


.


.
 
Last edited:

Mikael Lavoie

Jan 4, 2015
18
Joined
Jan 4, 2015
Messages
18
.

...
How about subjecting that voltage leakage that you are experiencing to the standard EIA industry's leakage test
protocol..

You do that by shunting your AC metering with 1500 ohms across it .
Then test and I'll just bet that it will drop to an infinitesimal value and is of no concern . . . just being a feeble static voltage .
...
.

Thanks for the info 73's de Edd. I'll do that test monday at work. For the old post, i had to add a voltage regulator to have a more clean power, and i had to play a lot with the oscillator circuit capacitor value to find the good one. I added some more filtering caps too. Seems like my board design was not good, i removed all the copper between the track and i think i got some induction from the other track that messed with the osc. I was my first design from scratch project and i did it as a learning project. I had a small base in electronic from my mechanic course, but i had to learn all the rest from the beginning, and i'm still learning from it 1 year later.
So if if i do the leakage test and get 200mV, i assume that it cannot mess with the lcd?
And i took the measurement between the stainless case(+) and the negative of the wall wart to have that 3,2VAC.

Dorke ,

I modified the diagram as best as can remember because i modified the original i had at the shop by hand. You should have all the info you need on it. As for the picture of the inside i took one, but i can't for the wall-wart its still at shop. Its the right chip of the lcd that is blowing every time. The wire lenght to the sensor is aproximately 2Meter or 6'. And what pin you want me to take voltage on? Only the 2 V+ input pin or all the data pin as well?? Let me know and i'll do it.

So thanks to you two for helping me with that issue.
 

Attachments

  • IMG_0148.JPG
    IMG_0148.JPG
    383.4 KB · Views: 84
  • IMG_0150.JPG
    IMG_0150.JPG
    376.1 KB · Views: 95
  • TrumphTempWatcherDesign1.jpg
    TrumphTempWatcherDesign1.jpg
    97.5 KB · Views: 62

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
I work with CNC machines and have seen machines overheating in the Hydraulic section. I wonder if you have looked at it from the other angle, Why is it overheating?
Rather than detect it when it does.
Often this is because the hydraulic pump is producing pressure continuously, even when not warranted, i.e. in between operations pump it is not unloaded .
A common method is to use a dump valve on the hydraulic pump output which diverts the oil directly back to the tank (no pressure).
If the system is designed to detect when any function is active, and if so close the dump valve and produce pressure until done etc.
So what happens now? Do you shut the machine down until cooled?
What type, make of machine?
M.
 
Last edited:

Mikael Lavoie

Jan 4, 2015
18
Joined
Jan 4, 2015
Messages
18
I work with CNC machines and have seen machines overheating in the Hydraulic section. I wonder if you have looked at it from the other angle, Why is it overheating?
Rather than detect it when it does.
Often this is because the hydraulic pump is producing pressure continuously, even when not warranted, i.e. in between operations pump it is not unloaded .
A common method is to use a dump valve on the hydraulic pump output which diverts the oil directly back to the tank (no pressure).
If the system is designed to detect when any function is active, and if so close the dump valve and produce pressure until done etc.
So what happens now? Do you shut the machine down until cooled?
What type, make of machine?
M.
Its a Trumph TC2020R CNC Punch. And it only overheat when we do lots of perforated plate non stop in hot summer days. And the problem is that the machine is pretty old and not have a temp sensor that we can read to know when to throttle the jobs. It only have a thermostat that shutdown the machine when the oil reach 55 degree C. So i calibrated my module to trip an alarm at 52C. It give us a warning to switch to job that have more tools setup on it to let it cool before re-starting intensive job. So the machine never stop this way, as we had to do the other jobs anyway, just a matter of managing with the machine capacity, what we were not able to do before. We could had installed a better fan or better radiator but the pieces cost for this machine is ridiculous, so i found another option, that cost us only like 60$ to make and do the jobs right.
 

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
Thanks for the info 73's de Edd. I'll do that test monday at work. For the old post, i had to add a voltage regulator to have a more clean power, and i had to play a lot with the oscillator circuit capacitor value to find the good one. I added some more filtering caps too. Seems like my board design was not good, i removed all the copper between the track and i think i got some induction from the other track that messed with the osc. I was my first design from scratch project and i did it as a learning project. I had a small base in electronic from my mechanic course, but i had to learn all the rest from the beginning, and i'm still learning from it 1 year later.
So if if i do the leakage test and get 200mV, i assume that it cannot mess with the lcd?
And i took the measurement between the stainless case(+) and the negative of the wall wart to have that 3,2VAC.

Dorke ,

I modified the diagram as best as can remember because i modified the original i had at the shop by hand. You should have all the info you need on it. As for the picture of the inside i took one, but i can't for the wall-wart its still at shop. Its the right chip of the lcd that is blowing every time. The wire lenght to the sensor is aproximately 2Meter or 6'. And what pin you want me to take voltage on? Only the 2 V+ input pin or all the data pin as well?? Let me know and i'll do it.

So thanks to you two for helping me with that issue.

About the measurments:
Please check all the LCD pins.

If you have a scope do it with a scope as well , when the μC is accessing the LCD.
Look for under-over shots on all the "interface" LCD lines.

Did you write the code for the LCD yourself?
Can it be you are creating a momentary conflict between an LCD read and the μC putting an output on any of the data line?

How are the 3 lines coming from the DS18B20 connected at the measuring point,
in particular the VSS ,is it floating or connected to the frame?

It looks like the 7805 doesn't have sufficient decoupling caps.

The layout and traces are far from optimal.

The 2 meter line is long enough to pick up all sort of electronic noise and interference from the "industrial arena" they may show up on all 3 pins from the DS18B20 and cause problems.maybe a shielded cable is needed.

TrumphTempWatcherDesign1.jpg
 

73's de Edd

Aug 21, 2015
3,613
Joined
Aug 21, 2015
Messages
3,613
.





I can see how that little puppy could get warm . . . .very WARM . . .particularly on the 3000 and 5000 . . .big brother . . . upgrades .
Is the machine nicknamed . . ." The Donald " . . .( Stateside . . .the bastard colonies . .. humour )





Look at the crew looking on . . . . . drop jawed . . . at what used to be their machining jobs.

I could also see a much simpler analog monitoring of the hydraulic fluid temperature..
And is there the possibility of insertion of immersion cooling rods within the hydraulic holding tank and the use of metered water flow cooling ?

73's de Edd

.
 
Last edited:

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
And is there the possibility of insertion of immersion cooling rods within the hydraulic holding tank and the use of metered water flow cooling ?
Exactly. I know Mikael stated that the parts where expensive compared to his investment of $60, but an intercooler by itself should increase the production capacity of the machine by virtue of more fluid reservoir. Not knowing the pressure of the fluid, it would be hard to comment on cost, since lines can get pricey, but retooling to stop a job and start another is hardly cost effective due to labor and mistakes - not to mention staging materials, potential for blanks to get swapped, etc. Just seems practically unjustifiable to go down that road.... potential for losing a customer or lawsuits from defective products or wrong materials....
 

Mikael Lavoie

Jan 4, 2015
18
Joined
Jan 4, 2015
Messages
18
Thanks for all the info guys, but we are a customs shop so we don't do lots of serie productions. The shop wont spend thousands on the machine for 6-8 shutdowns a years (thats itself last 2h30min to cool if let happen). Only a way to monitor the machine heat is plenty enough. And as we do almost only customs pieces we are really used to swap materials and tools, and how to do it efficiently, so letting a sheet finish knowing the machine i near its capacity and switching to another jobs is only a matters of 5-10 min max. We dont have to continually watch it run, so we do our setups while its running, we only need to swap some tools between each run. 95% of what we do with it make it run nowhere near the critical points. Its only when doing batch of perforated plate for 2 of our customers that the machine is overheating, and it take like half a day to reach the critical temp. Just switching to regular jobs for 30 min bring it back to normal temp, and you can start over for another half day.
I really appreciate the ideas though, we will probably take a closer look at some in the years to come. But at the moment i'm only looking to get my lcd to survive more then a couple months.

Dorke:

Why those value for the regulator? I had put this caps according to the datasheet of the regulator. And for the layout, as i already said its my first electronic project and i had to learn absolutely all from the uc programming to the board etching, so yeah i guess they are 'far from optimal'. But if you can explain i'm the kind of guy that love to learn why and how.
Yes i did all the code myself, modified some online snippet and add them to my code to do it.I can give you the code if you wanna take a closer look at it for something i missed. I did some python before but i'm pretty new to C.
I will take all the measurement tomorrow with the scope on the lcd pin and give you the results. I hope the dead lcd wont cause bad reading because i just ordered the new one and i will replace it next week when i will have it. The circuit is working, only the lcd is dead.
Can you answer me on my first question? Can i make a kind of 'faraday cage' by grounding the case to the negative side of the wall wart? It will probably not correct my situation that seems to be more of a hardware case from what i've read so far, but it wont hurt i guess if its feasable.
 

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
Making a Faraday cage doesn't require grounding at all.
Surrounding some volume with a closed metallic surface is enough.

How good a ground is the (-) of the wall wart is doubtful anyways.
Is the side of the TruePunch grounded?

The first thing to do is identify the cause for the blown LCD,only then a proper remedy should be found.

"The circuit is working, only the lcd is dead"
How can you tell? without the display showing the results of the temperature.
What does the uC do with a dead LCD?
Do you ever perform a "LCD read" with the uC?

The regulator values are from Fairchild datasheet of the LM78xx,you don't have the input cap at all.

The code can be a problem as well since you are controlling all the pins via GP I/o pins of the uC.
You can theoretically cause a conflict on the LCD data lines,or leave them floating .
The floating issue can be resolved by weak(say 10K) resistor pull-ups or downs on the datelines and control lines of the LCD.

About the layout and traces.
I can help ,but not just now,
It is a very important issue (and not a very easy one) with a lot of "thumb rules" ,
steaming from many EE theories and disciplines .
If done the wrong way it may cause a lot of problems ,in so many ways.




I
 
Last edited:

Mikael Lavoie

Jan 4, 2015
18
Joined
Jan 4, 2015
Messages
18
Thanks Dorke for the info.

Ok i won't continue on the case grounding idea.

The TruePunch is independently earthed with a ground rod near the machine, but i dont know if the rod respect the 8 foot deep standard of a earthing rod.

I Know the circuit is working and only the lcd is dead because i coded a test function to be able to try the alarm led and buzzer, or to show someone what to expect when the module trip and what to do if it happen. When you hold the buzzer Mute spst button for 3 seconds, the alarm is manualy tripped. Same things for going back to normal. When the lcd died i did it and it's still working.

For the values of the caps of the regulator, mine was according to the manufacturer of the chip. Its a AN7805 made by panasonic that i already had here. I had the first cap too i just forgot it when i corrected the circuit layout as the original is at the shop corrected by hand. So am i better to go with the real values?? I'm guessing yes. I linked the datasheet with the post. There is a range in the values, i put the lowest possible one, maybe it's not optimal.

I've checked my code and i do no read on the lcd, only write. I've linked the 2 main module as well. I've made copy as txt file to link them, just switch the extention back to .c if you wanna get the structure in a code reader.

So can i proceed with the reading of the lcd pins with the scope or the dead lcd will mess the result???

EDIT: I double checked my code and i think maybe there is something wrong, can you look at it. I'm pulling the signal line high and leave it that way. Can the chip send too much amps on the signal line??? And if yes, can i correct it by putting a resistor on that line only to limit the current drawn to protect the lcd?? Putting pullup on each line is a major rework of the module so if i can correct the situation with this mod it would be less invasive on the board. It's in the write and lcd_enable function.
 

Attachments

  • 5V REgulator.pdf
    502.2 KB · Views: 64
  • 1wire.txt
    1.7 KB · Views: 111
  • main5vpowered.txt
    7.2 KB · Views: 117
Last edited:

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
For the values of the caps of the regulator, mine was according to the manufacturer of the chip. Its a AN7805 made by panasonic that i already had here. I had the first cap too i just forgot it when i corrected the circuit layout as the original is at the shop corrected by hand. So am i better to go with the real values?? I'm guessing yes. I linked the datasheet with the post. There is a range in the values, i put the lowest possible one, maybe it's not optimal.



So can i proceed with the reading of the lcd pins with the scope or the dead lcd will mess the result???

EDIT: I double checked my code and i think maybe there is something wrong, can you look at it. I'm pulling the signal line high and leave it that way. Can the chip send too much amps on the signal line??? And if yes, can i correct it by putting a resistor on that line only to limit the current drawn to protect the lcd??

Putting pullup on each line is a major rework of the module so if i can correct the situation with this mod it would be less invasive on the board. It's in the write and lcd_enable function.

About the AN7805,
Looking at the datasheet (look at the notes on the bottom of each table on almost every page.),
You actually don't use the correct values and you should use Ci of 0.33uF and Co of 0.1uF if possible solder them directly on the regulator side you can do it on the bottom of the print-no need to modify a thing.
See this as well:
AN78XX caps-1.png
About the pull-ups:
You can actually do that with no modifications to the print by using a SIP resistor network with a common pin,they are 0.1" spaced ,solder them directly on the LCD pins.
like this ones.

I would also add a 0.1uF cap on the LCD module +5V and GND pins directly.

For the data-lines use a 9 pin (pin1 common) 8 resistors pulled-up to 5V.
For the 3 command lines:
E ,should be pulled down to GND (single resistor)
R/W and RS ,can be either up or down-if you only write the LCD I would favor R/W pulled to GND.

You can make a SIP network yourself like this(any values you need):
sip-manual.png

About probing the LCD:
I would test the with the blown one,it can "distort" the signals compared to a working one, but still is a good thing to check.
Please do that to the circuit as it is nowbefore any mods!
Preferably "on-site" connected with the working "puncher" .
All LCD pins are of interest with DMM and scope ,the VDD and GND as well.

I would prefer not going into the code ...time.

"I'm pulling the signal line high and leave it that way"
When you say "signal-line" do you mean the "E" line ?
Could you please link to the LCD datasheet.
 
Last edited:

Mikael Lavoie

Jan 4, 2015
18
Joined
Jan 4, 2015
Messages
18
Seriously i must say i Big thank you. Never been so well helped so far.

I'll do the measurement at shop then, i'll touch nothing this weekend.

In the code i'm pulling the E line high as a pull-up, so i'm constantly feeding the E pin 5V until i'm pulling it low to send the enable signal. Maybe this is the problem. And the way i'm doing it is the send data directly, so i maybe should put the pull-up and pull the line low instead of feeding the data 5V .This is the part of the code :

void write(char x)
{
output_C(x); //data send to PORTC
output_high(rs); //is data not command.
output_low(rw); //is write not read.
output_low(e); //pull low enable signal.
delay_ms(2); //for a while.
output_high(e); //pull high to build the rising edge.
}

//--------------------------------------
//lcd display setting
void lcd_enable()
{
output_low(rs); //is command not data
output_low(rw); //is write not read.
output_low(e); //pull low enable signal.
delay_ms(2); //for a while.
output_high(e); //pull high to build the rising edge
}

Thanks again for all the help.
 
Last edited:

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
Seriously i must say i Big thank you. Never been so well helped so far.

I'll do the measurement at shop then, i'll touch nothing this weekend.

In the code i'm pulling the E line high as a pull-up, so i'm constantly feeding the E pin 5V until i'm pulling it low to send the enable signal. Maybe this is the problem. This is the part of the code :

void write(char x)
{
output_C(x); //data send to PORTC
output_high(rs); //is data not command.
output_low(rw); //is write not read.
output_low(e); //pull low enable signal.
delay_ms(2); //for a while.
output_high(e); //pull high to build the rising edge.
}

//--------------------------------------
//lcd display setting
void lcd_enable()
{
output_low(rs); //is command not data
output_low(rw); //is write not read.
output_low(e); //pull low enable signal.
delay_ms(2); //for a while.
output_high(e); //pull high to build the rising edge
}

Thanks again for all the help.


I looked at the "lcd_enable" code ,it doesn't look right.
The state of the "E" signal should be normally low unless you are actually accessing the LCD.
For writhing, it is the falling edge of "E" that does the writing.

LCD write.png



Should be like this:

void lcd_enable()
{
output_low(rs); //is command not data
output_low(rw); //is write not read.
delay_ms(2); //for a while.
output_high(e); //pull high to build the rising edge
delay_ms(2); //for a while
.
output_low(e); //pull low to build the falling edge
delay_ms(2); //for a while.
}

I think a similar thing is needed in the other routine.
 
Last edited:

Mikael Lavoie

Jan 4, 2015
18
Joined
Jan 4, 2015
Messages
18
Alright, i modded the module to add a bypass cap at the lcd. I changed the regulator capacitor to match the spec sheet values. I modded the code to respect the timing better. I Also modded the code so that every communication pin is set to low between each com so no unwanted voltage is applied between each comm. I also added a timer so the main routine i done every 1 sec instead of as fast as the chip can do it. Maybe it will help to refresh every second instead of 10 time per second average. Less burden for the lcd. I polished the code overall while modding it, and found another flaw concerning the comm with the sensor, and corrected it. I also isolated the main case with a rubber pad behind and the mounting screw are now in plastics.

So now time will tell if i did my repair job right. I learned a lot in the process as usual. If what i've done is not enough, i'll go for the sip network and remod the code again.

So thanks a lot for your help Dorke.

73's de Edd for your water cooling rod, i will use your idea on our main compressor that tend to overheat in the summer when we do lot of sandblasting. I will help a lot. I'll start the project in the summer near the vacation. Thanks a lot for the idea.

Mikael
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
Just out of interest I always make a point of earth grounding any electronics supply in the machines I have retrofitted. Plus any metallic enclosure to conform with equi-potential bonding to the earth star point.
Some are PC based for motion control and as most know, the P.S. of a PC also has a the DC supply earth grounded at the DC output.
M.
 
Top