Generate a new channel based on data from other channels

Please refer to the post below for a more comprehensive description.


I’m recording the PWM signal sent to a stepper motor controller.

In this implementation, PWM duty cycle remains stable at ~50% but frequency changes from 127 to 500 Hz. Channel 0 captures steps and Channel 1 the direction.

I would like to display the frequency in an additional channel, for example as an analog measure just below. How to perform that?

Below is a mock-up with Frequency (Hz) corresponding to Channel 0.

I’ve recorded the trace: Session 0 - PWM.sal (28.4 KB)

Similar question if frequency remains constant but duty cycle changes.

Thank you!

2 Likes

I would absolutely love to see this type of capability too. An analog-ish ‘psudo-waveform’ showing RC-servo angles over time, for example. Or PWM duty cycle corresponding to motor power, etc. etc. Super super useful.

1 Like

I’ve created the idea Turn PWM metrics into additional channel.

Please click the upvote button!

3 Likes

There are other ideas on there. One of which I made. The general idea is that it’d be nice if one could take data from one or more existing channels and turn that into data for a generated channel. Most of us wanted to go the other way from what you want. As in, maybe take an analog signal and turn it into a digital signal with hysteresis. But, I think the general idea is still the same - take data from one place, transform it, place it in a new channel. So, my recommendation would be for Saleae to make a generic interface for data transforming that allows people to generate new channel data.

2 Likes

@Collin Yes, you are right. I like the idea of a broader implementation.

So I’ve changed the title of the thread from Turn PWM metrics into additional channel to Generate a new channel based on data from other channels.

I hope the new title reflects the general idea better.

the opening post just provided an example based on a real case. I went through the list of ideas but didn’t find a suitable entry so I added mine.

@joe_garrison @markgarrison @rani This means the Logic software would have now three kinds of channels:

  • logic, the historic foundation of Saleae,
  • analog, introduced with the + series of analysers,
  • virtual or calculated —whatever catchy name for marketing!—, based on data from other existing channels, to prepare the future.
3 Likes

I would like to see simple math formula for each point would be nice first step.

e.g. I am measuring a voltage with a 2:1 divider, so I would like to multiply all signals on that analog channel by 2.

Other uses are report current from a voltage that is a drop across a resistor. (using a current sense amplifier). I = V_in / G_amp / R_sense

i.e. Basic math operations on the channels from the scope.

1 Like

See https://ideas.saleae.com/b/feature-requests/analog-transformation-functions/ and https://ideas.saleae.com/b/feature-requests/arbitrary-scaling-factors-for-analog-channels/ on the ideas board. Lots of people are looking for this!

Thanks @rei_vilo for getting those idea posts up, and for linking this discussion.

@P.Jaquiery I agree. This is actually one of the more requested features since Logic 1.x. I’m sure that even getting basic math added in as a starting point would be very helpful. I added this discussion thread to those idea posts as well.

I’ll ping the software team about this.

Hi, I’m in a similar sittuation.

I have 3 ADCs on the same bus (among other devices). They are accessed by a onboard CS mux, so I don’t have direct access to the CS lines per ADC.

I would like to create a virtual CS channel with f.x. CS = Line1 AND Line2; Then use this virtual CS as input to a SPI analizer

Hi @stefan, thanks for letting us know your need for this! For your comment below:

I would like to create a virtual CS channel with f.x. CS = Line1 AND Line2; Then use this virtual CS as input to a SPI analizer

In that example, are you looking to only see data from ADC1 and ADC2, while ignoring (and not decoding) data from ADC3? In addition, I’m assuming that you also need to look at any other combination of data as well.

I added a comment for you in the idea post we are tracking for this:

We have a couple workarounds I can share:

  1. You can set the Enable line to “None” in the SPI analyzer settings. This means that all data on that bus will be decoded (and will ignore the CS/ Enable line state)
  2. You can add multiple SPI analyzers to the same SPI data bus, with each analyzer pointing to a different channel (i.e. different CS) for the Enable line. This will allow you to decode based on the CS line for that analyzer, and you can hide analyzers for the ADCs that you are not interested in at the moment.

Hi Timreyes
Here is my situation:

I have good access to the CA0 CA1 CA2 and DEMUX signals. But very difficult access to the nCS lines (requires jumping and soldering fine wires)

Preferably I would like to create virtual nCS signals and use them as CS in the analyzers in Saleaee. This way I could export CSV from each sensor…

Best regards
Stefan

2 Likes

Ahhh, that’s a cool usage! I would never have thought to make a feature like that in software but seeing your description it all sounds very reasonable. Yeah, this is another good reason why being able to make virtual channels would be handy.

This is fantastic! Thanks so much for sharing your schematic! It conveys your idea perfectly, and is an extremely useful and creative use case. I’m also a big fan of the channel usage efficiency (3 channels vs 8 channels) using this method.

Just added this information below:
https://ideas.saleae.com/b/feature-requests/analog-transformation-functions/

I’m glad the idea I posted some time ago is gaining traction with other use cases.

Virtual channels will nicely add to logic and analog ones.

Now good luck to the developers to turn this idea into a feature everyone can use!

2 Likes