Author Topic: Presentation and help to choose logic analyzer  (Read 5515 times)

0 Members and 1 Guest are viewing this topic.

Offline jugosaliTopic starter

  • Newbie
  • Posts: 8
  • Country: gb
Presentation and help to choose logic analyzer
« on: December 02, 2016, 06:51:52 pm »
Hi all

I've been following Dave's adventures for loooong time, and registered earlier this year in the forum. Usually the answers to my questions are already here. A bit of search does the trick. Today I can't find the clues what I'm looking for, so I ask for some help.

Here is the story.

I have a system that consists in three hooked equipment working together.

-A printer

-A machine CNC like that moves the printer

-A computer that controls both machine and printer.

The bloody thing mostly works fine but hence a while it misses a label or duplicates the last one. The printer guy blames the machine one, and the machine guy blames the software developer and the software developer blames everyone else. And here I am in the middle trying to sort this out.

My plan is to log all the communication signals and events on the system and with that proof just put the people to work and get it fixed.

I have never used a logic analyzer and I have some questions before buying one to debug the thing:

I need to log:

-A trigger signal +15v (Print signal)

-An encoder signal +15v (Print speed)

-Sniff the printer serial port RS-232. (Label data)

Should I convert every signal to 5v for the analyser?

How long can I log continuously? Is an event that can happen once every hour or so. The amount of data in between is fairly small, a hundred or so events per hour. Also the speed is not high. 9600 for the serial port and around 20Khz max for the encoder.

Can I feed the 232 signal directly to the analyser or needs conversion as well?

Is better to get an MSO or maybe an Analog Discovery, Saleae or similar.

I've been playing with the demo of the Pulseview software and I wonder if the Rigol DS can feed the data into that software live. This looks convenient enough to me.

If you have read this completely, thanks in advance.
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: Presentation and help to choose logic analyzer
« Reply #1 on: December 02, 2016, 07:47:28 pm »
Can say I read it completely :)

Logic analyzers generally allow any signal to trigger reading in the states of all its inputs.  This can be rising, or falling edge, and can be multiple input conditions.
The limit of how much it can 'capture' is down to its memory, so the faster its input capture, the shorter the period it can capture. Because of this, often you want to run it at the slowest speed possible to capture the events you're interested in.  For example, serial, at 9600, then you could get away with 100us, but probably want 20-50us.  But if you suspect glitches that can be two rising edges that are meant to be synchronous, you can ramp up the speed and capture events in the range of nano seconds (depending on the max capture rate).

You mention several signals, most seems slow, so you might not need to capture in the MHz range, but if there is say 5 seconds between two events, then if you capture 8 channels at 1us.. in 5 seconds thats 5kbyte's. Often analyzers will have much greater memory than this but you see my point.  Most modern small analyzers simply capture and buffer the input states and send them to a PC - used as a nice GUI.  The PC can of course store this, and if the datarate between the analyzer and PC is faster than your capture rate, then the PC will capture *all* the data for however long you run it for.

In terms of voltages, whilst there are proper methods for scaling down voltages, not logic analyzers have fairly high input impedance, so you could probably get away with a simple resistor voltage divider on the inputs that are greater than 5V, or just a series resistor with diodes to clamp the input to 5V +/- 0.6V.  This can slow down edges but as you're not looking at anything particularly fast it shouldn't matter too much.  I imagine most analyzers will have input protection anyway, so you could get away with just series resistors - but this is no guarantee.  Best bet would be a simple NPN transistor with a pull up. This will invert the signals of interest, but does the job (and makes it easier to read RS232 bytes as they are inverted anyway).

Depending on how electronics savvy you are, it might be a better idea to use a microcontroller to capture the serial, the frequency and possibly duty cycle of the encoder, and log other trigger events.  Each time it captures any data (for the serial) and adds a time stamp.  Stream this to the PC so it can log all the events in a CSV/text file.  This doesn't actually solve any problems you may have, and would spit out very large files (read: lots of scrolling to find anything) but at least it will all be logged.  For the msot par though, I'm sure a logic analyzer would be the first port of call and I'm sure a Saleae is more than capable of continuously capturing events and storing to a file for later analysis.
 
The following users thanked this post: jugosali

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Presentation and help to choose logic analyzer
« Reply #2 on: December 02, 2016, 08:22:09 pm »
If it were me, I'd add some voltage conversion (resistor dividers for 15V signals, RS232->TTL UART adapter for RS232, and then use something like the Saleae LA.  Your data rate and measurement time means you almost certainly can't use a stand-alone option, the memory depth won't be anywhere near what you need.  One really nice thing about the Saleae units is the interface software compresses the data, so you can sample much faster than necessary but only use up the memory required for the actual data rate.  For example, if you have a 20kHz encoder, 20kHz trigger, and 9600 baud RS232 Tx/Rx, you could record over 3 Hr of data per GB of available RAM in your computer, even if you're sampling at 50 MHz (the high sample rate helps to catch irregular and narrow spikes).
 
The following users thanked this post: jugosali

Offline jugosaliTopic starter

  • Newbie
  • Posts: 8
  • Country: gb
Re: Presentation and help to choose logic analyzer
« Reply #3 on: December 02, 2016, 09:11:26 pm »
Thank you both for your replies.

I see it much clear now.

Is sad I cant use the Rigol + Pulseview software for this. There is not many occasions when the company gives you a blank check to buy the needed stuff. Money is not a problem though, is more that I need to justify the use.

Any advice about a good USB LA with scope that can record for long periods (maybe 5 min or so)? Or better going straight to a Saleae Pro 8 or Pro 16?

 
 

Offline Harrkev

  • Contributor
  • Posts: 38
  • Country: us
  • ASIC Design Engineer
Re: Presentation and help to choose logic analyzer
« Reply #4 on: December 02, 2016, 09:31:41 pm »
Any advice about a good USB LA with scope that can record for long periods (maybe 5 min or so)? Or better going straight to a Saleae Pro 8 or Pro 16?

Having used a Saleae Pro 16 (one on my desk right now), I can say that I am not a fan.  The analog stuff "works" but it is a poor substitute for a scope.  You get no graticules, so you have no idea what the voltage is without mousing over a sample to see the voltage.  If the shown signal between 3.3 and 0V, or is it between 0.5 and 0V?  Hard to tell at a glance.  Also, unless you are sampling, you have NO indication of what the current logic levels are on any of the lines (HP logic analyzers always show you high/low conditions of all lines).

With that being said, a Saleae would actually work for what you need (if you add RS-232 -> TTL converters).  If you intend to use whatever you buy later, look a Analog Discovery.  If it can sample at a low rate for a long period of time (no experience, to check first), then that would be a great choice.

Or, as another poster mentioned, use any handy micro that you have lying around.  More work with this method though, and you don't get a shiny new toy.
 
The following users thanked this post: jugosali

Offline jugosaliTopic starter

  • Newbie
  • Posts: 8
  • Country: gb
Re: Presentation and help to choose logic analyzer
« Reply #5 on: December 02, 2016, 09:38:05 pm »
Thanks

I also had a look to the analog discovery and it bundles more features, bum I'm not sure about the LA software side.

Have some dev boards, a raspberry pi and such, but the  boss is keen to expend some money... I'm not loosing this chance.
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Presentation and help to choose logic analyzer
« Reply #6 on: December 02, 2016, 09:53:48 pm »
Having used a Saleae Pro 16 (one on my desk right now), I can say that I am not a fan.  The analog stuff "works" but it is a poor substitute for a scope.  You get no graticules, so you have no idea what the voltage is without mousing over a sample to see the voltage.  If the shown signal between 3.3 and 0V, or is it between 0.5 and 0V?  Hard to tell at a glance.
Yes, the analog portion of the Logic Pro is absolutely no replacement for a scope.  I view it as a logic analyzer "plus", meaning its primary duty is as a LA, and the analog sampling is only there to support that (eg: temporarily turn on analog sampling so you can verify the signal is going all the way to logic 1 or 0, versus floating around the detection threshold).  Beyond that, the analog sampling is mostly useless.  For analog work one should be using an actual scope, no questions asked.  For actual LA duty though, I find the Saleae units hard to beat.
 
The following users thanked this post: jugosali

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Presentation and help to choose logic analyzer
« Reply #7 on: December 02, 2016, 11:02:40 pm »
This might work, quite cheap, works off Saelae software (free download).

You would have to scale voltages. The advertised data rate I am not so
sure solution can meet. but "normal" serial/parallel PC port stuff should be OK.

This is just one of many similar on ebay -

http://www.ebay.com/itm/New-Set-USB-Logic-Analyzer-Device-USB-Cable-24MHz-8CH-24MHz-for-ARM-FPGA-/261926397359?hash=item3cfc07a5af:g:FRwAAOSw3xJVelPR




Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: jugosali

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Presentation and help to choose logic analyzer
« Reply #8 on: December 03, 2016, 12:59:09 am »
For a first cut, I would split out the RS232 and run a separate signal to another PC that receives and stores the traffic.
I might use puTTY on Windows or just 'cat' on Linux.  After the 'glitch', you will know exactly what was sent.  That cuts the problem in half.
If you wish, you could just take the serial output away from the machine control and read it back on the same PC (maybe), or another PC.  There is no reason to have the machine hooked up unless you thing electro-mechanical interference is a problem.

Spending money is good!  But it might not help you solve this particular problem.

 
The following users thanked this post: jugosali

Offline jugosaliTopic starter

  • Newbie
  • Posts: 8
  • Country: gb
Re: Presentation and help to choose logic analyzer
« Reply #9 on: December 03, 2016, 03:04:56 pm »
This might work, quite cheap, works off Saelae software (free download).

You would have to scale voltages. The advertised data rate I am not so
sure solution can meet. but "normal" serial/parallel PC port stuff should be OK.

This is just one of many similar on ebay -

http://www.ebay.com/itm/New-Set-USB-Logic-Analyzer-Device-USB-Cable-24MHz-8CH-24MHz-for-ARM-FPGA-/261926397359?hash=item3cfc07a5af:g:FRwAAOSw3xJVelPR

Regards, Dana.

Thanks.

I´ve just orderded one to try.
 

Offline jugosaliTopic starter

  • Newbie
  • Posts: 8
  • Country: gb
Re: Presentation and help to choose logic analyzer
« Reply #10 on: December 03, 2016, 03:17:00 pm »
For a first cut, I would split out the RS232 and run a separate signal to another PC that receives and stores the traffic.
I might use puTTY on Windows or just 'cat' on Linux.  After the 'glitch', you will know exactly what was sent.  That cuts the problem in half.
If you wish, you could just take the serial output away from the machine control and read it back on the same PC (maybe), or another PC.  There is no reason to have the machine hooked up unless you thing electro-mechanical interference is a problem.

Spending money is good!  But it might not help you solve this particular problem.

Thanks for your approach. I have a RS-232 sniffer and putty at hand all times. It solves a lot of questions.

But the thing is more complex than this.

-First the software sends the job to the CNC, which has a buffer.

-Now the software listens to the machine returning an specific label command to know when is processed and then sends the right label information to the printer.

-After the return command has been send another command activates the printer head module at the machine and sends a trigger signal to the printer + a pulse stream to sync the speed.

-Now the printer know what label to print (RS232 from the software). When to print it (trigger from the machine). And the print speed (pulse stream from the machine).

As you can see there are several things happening at the same time, an one of them is not right sometimes. And this is the real issue, this happens very randomly and was a small nuisance at the beginning. But after some months of this, a lot of wasted time has been added up. Somebody is not happy.





« Last Edit: December 03, 2016, 03:28:09 pm by jugosali »
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Presentation and help to choose logic analyzer
« Reply #11 on: December 03, 2016, 11:16:34 pm »
This might work, quite cheap, works off Saelae software (free download).

You would have to scale voltages. The advertised data rate I am not so
sure solution can meet. but "normal" serial/parallel PC port stuff should be OK.

This is just one of many similar on ebay -

http://www.ebay.com/itm/New-Set-USB-Logic-Analyzer-Device-USB-Cable-24MHz-8CH-24MHz-for-ARM-FPGA-/261926397359?hash=item3cfc07a5af:g:FRwAAOSw3xJVelPR

Regards, Dana.

Thanks.

I´ve just orderded one to try.

Please don't use the Saelae software with that. Especially if your company would have paid for the actual Saelae hardware...

They release their software for free and it's meant to work with their hardware, not cheap Chinese clones. Unfortunately, there's no way for them to easily prevent this.

They're a small company trying to make a living off this. If you want to use their software, please support them by purchasing their hardware.
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 
The following users thanked this post: jugosali

Offline jugosaliTopic starter

  • Newbie
  • Posts: 8
  • Country: gb
Re: Presentation and help to choose logic analyzer
« Reply #12 on: December 04, 2016, 11:43:12 am »
This might work, quite cheap, works off Saelae software (free download).

You would have to scale voltages. The advertised data rate I am not so
sure solution can meet. but "normal" serial/parallel PC port stuff should be OK.

This is just one of many similar on ebay -

http://www.ebay.com/itm/New-Set-USB-Logic-Analyzer-Device-USB-Cable-24MHz-8CH-24MHz-for-ARM-FPGA-/261926397359?hash=item3cfc07a5af:g:FRwAAOSw3xJVelPR

Regards, Dana.

Thanks.

I´ve just orderded one to try.

Please don't use the Saelae software with that. Especially if your company would have paid for the actual Saelae hardware...

They release their software for free and it's meant to work with their hardware, not cheap Chinese clones. Unfortunately, there's no way for them to easily prevent this.

They're a small company trying to make a living off this. If you want to use their software, please support them by purchasing their hardware.

Sure I wont.

I just paid this one with my money and plan to try the Pulseview software, that I understand is opensource. Just for the fun of learning a bit more.

Of course, whatever solution I choose, the company pays the full bill. Even If I got a Rigol at the end, I´m not bothering to hack it.

I fully understand the difference between a home "educational - hobbyist"  or professional for profit use. I appreciate you raising the point, and would like to extend it to anybody else reading this.
 

Offline jugosaliTopic starter

  • Newbie
  • Posts: 8
  • Country: gb
Re: Presentation and help to choose logic analyzer
« Reply #13 on: December 04, 2016, 11:49:57 am »
The bloody thing mostly works fine but hence a while it misses a label or duplicates the last one.

"Duplicates the last one"? Without really knowing what your setup and function is I can only be surprised that sending data twice could be anything other than a software issue. Particularly in conjunction with "misses a label". I am assuming a label is a set of data and printable location that the printer is moved to.

You don't make any mention of errors positioning the printer, but "misses a label" may include omiting positioning in addition to just not printing when positioned correctly.

Since it "mostly works fine" that suggests to me that the communications are OK and the software is failing to generated print data or doubling up on occasion. Sounds like a software bug. At least that is where I would start. Making sure the data sent is correct before moving on to verifying correct data is received correctly.

A couple of possibilities without a logic analyser would be to send the data to a file if that is possible or to another PC via the RS232 link. From there you can see what was sent.

If you have a true RS232 link then voltages will be both positive for a zero bit and negative for a one bit and cheap logic analysers will typically decode TTL UART signals upon which the RS232 protocol is encoded. The voltages in that case would be 0-5V.

The Digilent Analog Discovery might be a better choice (get the BNC adapter too) if you must go that route.

Thanks for your brain squeeze into this.

The printer has a buffer that retains the last label, if no new label is received it duplicates the last one as soon as a trigger and encoder signals are received.

As you say I'm heavily inclined to a software bug, but until I cannot demonstrate with facts I have three people blaming each other. That is why I just want to collect all the data and collate it together.

You mention the analyser just getting comms at UART level. That points to me I will need a 232 decoder (max232 or similar) at the sniffer end? I'm only interested into the computer TX side, so no need to decode TX from the printer.
 

Offline ieast

  • Newbie
  • Posts: 4
  • Country: us
Re: Presentation and help to choose logic analyzer
« Reply #14 on: December 04, 2016, 05:11:24 pm »
Quote
Thanks for your approach. I have a RS-232 sniffer and putty at hand all times. It solves a lot of questions.
RealTerm is far superior to Putty for investigating most kinds of serial comm.  You might want to check it out if you haven't already.
http://realterm.sourceforge.net/

If you're using a Saelae or similar logic analyzer, you'll probably want to keep voltages to 5v or less.
http://support.saleae.com/hc/en-us/articles/208667006-Explanation-of-Supported-IO-voltages-Voltage-Thresholds-and-Over-Voltage-Protection

You could probably use a MAX3232 transceiver to convert RS232 into 3.3v or 5v TTL logic.  There are a lot inexpensive breakout boards available since these are commonly used by the Arduino/RaspberryPi/BeagleBone/etc... community.  For example:
https://www.sparkfun.com/products/11189
« Last Edit: December 04, 2016, 06:12:57 pm by ieast »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf