Author Topic: PCB testing - automation/ PC assisted - ideas  (Read 5261 times)

0 Members and 1 Guest are viewing this topic.

Offline ZapTopic starter

  • Newbie
  • Posts: 9
  • Country: au
PCB testing - automation/ PC assisted - ideas
« on: July 24, 2012, 01:50:09 pm »
Hi eevblogers,

I am looking to simplify a boring task i have of testing PCB's. I should mention I have no experience in test automation or assistance but I would like to learn/play with it out of hours to familiarise myself, and for some fun.

Basically I need to send serial commands to a UUT and then measure the output on a cro ( is there a square wave present? and is its period about x) etc and so on.

there is about 50 commands then measurements and after a while there is a risk you become blasé and miss errors as well as the time taken to enter all these commands and then adjust a cro to measure the output.

I am toying with the idea of at least coming up with a GUI that has the commands as buttons ( saving they typing) and still doing the manual CRO settings and checks

however at best an interface to measure the output and pass fail each step would be nice.

what would be a good starting point, i was thinking python to build a PC gui? ( (i have limited programming in C++ mostly C for embedded micros, but willing to learn)

the measurement side is a pipe dream but is it even viable? would you then look to labview and such systems?

thanks for any direction, ideas or pointers
Forever learning
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2030
  • Country: au
Re: PCB testing - automation/ PC assisted - ideas
« Reply #1 on: July 24, 2012, 02:22:13 pm »
Because it's PC and you want a rich GUI, Visual Studio using c# would be a good way to do it.
They have an express edition which is free and I think it would have all you need.
If you are the only person using it, you could just run it in the debugger,  that makes it easy to find and fix your bugs.
I assume they have a usable serial api.
You can pump stuff out to files, databases and graphs fairly easily.


 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2817
  • Country: au
Re: PCB testing - automation/ PC assisted - ideas
« Reply #2 on: July 24, 2012, 09:33:58 pm »
I'm heading down the same path at present.  After getting a demo copy of LabVIEW I had the NI rep come out to discuss what we wanted to do.  I'm not convinced that LabVIEW can do what I want long term though.  As a Windows programmer (Delphi mainly) I have been thinking about writing my own GUI where you can place virtual controls on a panel and generate serial commands for the DUT.
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2030
  • Country: au
Re: PCB testing - automation/ PC assisted - ideas
« Reply #3 on: July 24, 2012, 11:47:06 pm »
I suppose there is no harm in trying it. I guess your project is what Labview is designed for.
My fears would be black box syndrome, you know it does something weird, I can't fix it, I'll have to email someone or find a work around.
It's also fairly slow I think.

I did some Delphi last century, I think it must've been the first decent IDE in history. Then I went on to VS 98 with COM and C++, it was like going back into the dark ages. These days Visual Studio is great, though they are managing to fill it up with junk. Express edition is probably better because you don't get all the junk.

I notice that Atmel Studio 6 is using the VS Core. I guess that's great if your on Windows, tough luck if you use Linux.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4997
  • Country: si
Re: PCB testing - automation/ PC assisted - ideas
« Reply #4 on: July 25, 2012, 08:48:41 am »
Yes go for Visual Studio, its a great eviorment that helps you along as you write the code, the live suggestions work so well that you usually just write the first 2 or 4 letters of a command or variable and hit enter to autocomplete and at what ever point you hit F1 it will come up with a help for the command your cursor is in and most commands have a tiny example code for it in the bottom.It also all works the same in C++,C# or VB since it all uses the same .net interpreter and its also surprisingly fast.

LabView i had to do various stuff in and it seams like its only good for signal processing, any sort of sequential programming gets really messy quite fast. But it does have a strong point in interfacing test equipment. You can get drivers for nearly any piece of test equipment that you can connect to a PC so that makes it really easy to grab a waveform from a scope and analyze it. You can also find standalone DLLs for talking to various test equipment from other programing languages but that might not be as simple.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27238
  • Country: nl
    • NCT Developments
Re: PCB testing - automation/ PC assisted - ideas
« Reply #5 on: July 25, 2012, 09:54:08 am »
Hi eevblogers,

I am looking to simplify a boring task i have of testing PCB's. I should mention I have no experience in test automation or assistance but I would like to learn/play with it out of hours to familiarise myself, and for some fun.

Basically I need to send serial commands to a UUT and then measure the output on a cro ( is there a square wave present? and is its period about x) etc and so on.

there is about 50 commands then measurements and after a while there is a risk you become blasé and miss errors as well as the time taken to enter all these commands and then adjust a cro to measure the output.
I usually implement a self test in the device itself. Together with a test rig which has signals, loads, etc a device can test and calibrate itself.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline ZapTopic starter

  • Newbie
  • Posts: 9
  • Country: au
Re: PCB testing - automation/ PC assisted - ideas
« Reply #6 on: July 25, 2012, 10:16:16 am »
Thanks everyone for the posts and ideas - it would seem I have a lot more to look at before deciding if I can undertake such a task.

It will give me something to play around with even if I am unable to implement it into the current work flow. My idea was it would reduce my test work load but it might be a case of moving it and more into developing the test software.

(i have downloaded Visual Studio and will have a look into it also)

Regards
Forever learning
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2030
  • Country: au
Re: PCB testing - automation/ PC assisted - ideas
« Reply #7 on: July 25, 2012, 12:09:55 pm »
It will be much more interesting to automate the testing than to actually do the testing. So automate what you can.
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: PCB testing - automation/ PC assisted - ideas
« Reply #8 on: July 25, 2012, 12:15:42 pm »
I don't know if this will be an issue with your software or not but beware that you cannot reliably do real time processing using .NET.  This is due to the use of a garbage collector that can kick in at any point during the execution of your application.

By the way, so far as Delphi and .NET (and C#) goes, the same person that developed Delphi also helped develop .NET and C#: Anders Hejlsberg.
 

Offline ZapTopic starter

  • Newbie
  • Posts: 9
  • Country: au
Re: PCB testing - automation/ PC assisted - ideas
« Reply #9 on: July 25, 2012, 01:01:12 pm »
As a first step, if I can turn a string of text sent to the UUT into a single click of a button, and I still use the cro to confirm the output - that will save me a tone of typing and speed things up.

If was able to integrate the wave form and have a automated test and measure then that would be even better however at this stage i think it would be beyond my ability given this will be my first shot at any form of automation/assistance/pc programming

it would be nice though
Forever learning
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4997
  • Country: si
Re: PCB testing - automation/ PC assisted - ideas
« Reply #10 on: July 25, 2012, 06:34:55 pm »
Well DSOs do cost money so if he doesn't have one its a tough one. But if you are dealing with any digital or other complex signals a DSO is worth its weight in gold so well worth getting one in this digital world

I am a windows user so i like to put a GUI on all my little test programs, especially if its something i keep reusing like the tool for turning binary files in to C arrays or making sine tables and such. With tools like visual studio its really quick to just draw up the GUI from common windows elements so i never even tried making a command line app with visual studio.
 

Offline Short Circuit

  • Frequent Contributor
  • **
  • Posts: 439
  • Country: nl
Re: PCB testing - automation/ PC assisted - ideas
« Reply #11 on: July 25, 2012, 08:08:10 pm »
The DSO is already there to verify the signal manually, so cost is hardly an issue.

Take one with GPIB/USB and you can send the settings to the scope, and also use the scope measurmenet functions to query the voltages, frequency, dutycycle, etc. Same as you can on the DSO user interface. Probably does not cover the entire test, but at least allows for some basic automation of signal testing.

edit:
here's a C snippet from some PCB testing application which uses a Keithley 2100 DMM (though VISA and USB), I assume working with a DSO will be quite similar.
Code: [Select]
DOUBLE DmmRead(BYTE vAc, FLOAT vRange)
{
BYTE      pStrout[64];             // Read in data buffer
BYTE      pStrin[64];             // Read in data buffer
ULONG    nRead = 0;

if(vAc == 2)
strcpy((CHAR*)pStrout, "CONF:FREQ");
else
sprintf((CHAR*)pStrout, "CONF:VOLT:%s %f,%f", vAc ? "AC" : "DC", vRange, vRange / 10000.0);
PviWrite_usb(m_instr_usbtmc, pStrout, (ULONG)strlen((CHAR*)pStrout)+1, &nRead);

strcpy((CHAR*)pStrout, "INIT");
PviWrite_usb(m_instr_usbtmc, pStrout, (ULONG)strlen((CHAR*)pStrout)+1, &nRead);

strcpy((CHAR*)pStrout, "READ?");
PviWrite_usb(m_instr_usbtmc, pStrout, (ULONG)strlen((CHAR*)pStrout)+1, &nRead);
PviRead_usb(m_instr_usbtmc, pStrin, 64, &nRead);
pStrin[nRead] = '\0';
DOUBLE val = atof((CHAR*)pStrin);
//printf("converted: %.4fmV\n", val * 1000);
return(val);
}
« Last Edit: July 25, 2012, 10:26:14 pm by Short Circuit »
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2817
  • Country: au
Re: PCB testing - automation/ PC assisted - ideas
« Reply #12 on: July 25, 2012, 09:10:01 pm »
As a first step, if I can turn a string of text sent to the UUT into a single click of a button, and I still use the cro to confirm the output - that will save me a tone of typing and speed things up.

I have already written some software where you can define serial strings, put them in a list and trigger them with a button click.  You can also add a time parameter so that the strings are sent in a slow sequence.  Sounds like what you want for the first part.
 

Offline ZapTopic starter

  • Newbie
  • Posts: 9
  • Country: au
Re: PCB testing - automation/ PC assisted - ideas
« Reply #13 on: July 26, 2012, 10:48:47 am »
Cost of equipment is not an issue as currently we use a laptop, a user (me) to type in text, then a Tektronix cro to measure - and change settings manually.  Test firmware is not an option as this is a final test to ensure the board is ready to use - and works as expected ( i understand test firmware would also do this - but its not an option i have)

I don't mind if its only for educational purpose, so I might try doing it at home with my Rigol and a simple set-up and if it works well then try and apply it to simplify my testing.

thank you for the ideas and help - i will search about and try and gather a better understanding

Edit : when i say cost is not an issue - i mean to buy a DSO, pc and user :) any further equipment or software / licence is an issue ( as this is basically a home project to learn and further my own skills in an area i have never ventured and it seems like a good way to spend my time)
« Last Edit: July 26, 2012, 10:53:26 am by Zap »
Forever learning
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27238
  • Country: nl
    • NCT Developments
Re: PCB testing - automation/ PC assisted - ideas
« Reply #14 on: July 26, 2012, 12:40:51 pm »
I mean that you could embed the test firmware into the final firmware. Setting a jumper puts the board into test mode.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf