Author Topic: Cheap signal generator with variable squarewave rise/fall time  (Read 400 times)

0 Members and 1 Guest are viewing this topic.

Offline Yannik

  • Supporter
  • ****
  • Posts: 8
  • Country: de
Cheap signal generator with variable squarewave rise/fall time
« on: November 03, 2017, 08:33:20 AM »
Hi everyone,

is there a cheap (<$150, probably chinese, or used?) signal generator which has variable square wave rise/fall time? I would really appreciate any tips.

Thanks!
« Last Edit: November 03, 2017, 08:52:16 AM by Yannik »
 

Offline rhb

  • Regular Contributor
  • *
  • Posts: 154
  • Country: us
Re: Cheap signal generator with variable squarewave rise/fall time
« Reply #1 on: November 03, 2017, 10:09:05 AM »
What speeds and rise times do you want?  What duty cycle requirement?  What voltage level?  Your question is so generic it's hard to answer.

One option is a low pass filter on the output with a corner frequency set at some multiple of the square wave fundamental.

Another option would be to feed a ramp to an MCU DAC.  That would be really cheap and easy if you don't need more than 3-5 V output. 

Most low cost arbitrary waveform generators should do what you want though they might be painful to program from the little reading I've done.
We all get what we deserve whether we want it or not, either as individuals or members of a group.  Sometimes this is as punishment and sometimes it's a blessing.  Which is always ambiguous and depends entirely upon what we do next.
 

Offline edavid

  • Super Contributor
  • ***
  • Posts: 2464
  • Country: us
Re: Cheap signal generator with variable squarewave rise/fall time
« Reply #2 on: November 03, 2017, 11:01:28 AM »
HP 8012A/B and Wavetek 801 come to mind.
 

Offline Yannik

  • Supporter
  • ****
  • Posts: 8
  • Country: de
Re: Cheap signal generator with variable squarewave rise/fall time
« Reply #3 on: November 03, 2017, 07:24:04 PM »
Thanks, HP 8012 is a good recommendation. I'll watch out for those. Any other tips?

@rhb 3-5Vpp is fine. A variable rise/fall time between maybe 15ns and 500ms.
 

Online bd139

  • Super Contributor
  • ***
  • Posts: 1624
  • Country: gb
Re: Cheap signal generator with variable squarewave rise/fall time
« Reply #4 on: November 03, 2017, 09:10:37 PM »
Watch out for the sliders on the 8012’s. They tend to die and are irreplaceable. Nice little boxes when they do work.
 

Offline rhb

  • Regular Contributor
  • *
  • Posts: 154
  • Country: us
Re: Cheap signal generator with variable squarewave rise/fall time
« Reply #5 on: November 04, 2017, 01:25:55 AM »
An STM32F429 Discovery board and a bit of programming and packaging would give you a touchscreen unit for under US$50.  You'd probably need to add an output drive stage, but it's got two 12 bit DACs

Any of the ARM dev boards should give you what you're looking for.  If you don't mind a USB dongle with a terminal as the control, Mecrisp forth with one of the many boards it supports would be especially easy to program.

There are so many cheap OEM dev boards now I can't keep up.  I know I've got some with 16 bit DACs, but can't remember which.  I know that there is a 16 bit audio DAC for the Teensy.  I've got one, but haven't messed with it because of some software issue which I've forgotten.
We all get what we deserve whether we want it or not, either as individuals or members of a group.  Sometimes this is as punishment and sometimes it's a blessing.  Which is always ambiguous and depends entirely upon what we do next.
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 2578
  • Country: us
  • [Personal Text]
Re: Cheap signal generator with variable squarewave rise/fall time
« Reply #6 on: November 04, 2017, 02:05:19 AM »
I have a (very) low cost (Feeltech FY3224 AWG -as little as $45 now) and one can use CSV file to generate custom waveforms. You need to write out a CSV file containing one complete cycle of the wave form and then load it. This would be less convenient than what you might be able to dial up with a better AWG but really cheap, and still quite usable.

Also, it would be scriptable so would lend itself to all sorts of automation. The software it comes with is for PCs but it runs fine under Wine. Also, there are Python tools so it can be used under any platform natively. You speak to it via a USB UART adapter it has internally.

Using Python it seems you can also create waveforms on the fly- see below (have not done this yet myself, the text below is from the readme and help output for the command line tools)

So, that means you can loop through any arbitrary values in scripts.

I've also attached a file that contains the communications specification.

All this probably also applies to the newer version.

However, if you plan on getting one you really must read up on the Feeltech's shortcomings, specifically a major issue with its power supply and leakage voltage. (which is easy to work around)

Otherwise you could zap your devices under test. Basically you need to attach a good ground to it and make sure it stays attached. Thats a small price to pay though.

I've found the feeltech to be very useful.


--------------

Here is some info on the python-feeltech tools  (development archive is on github):

python-feeltech$ cat README.md
# python-feeltech
Python library for controlling FeelTech FY32xx waveform generators

Install with

```
$ sudo pip3 install feeltech
```

## Library usage

To create FeelTech object

```
>>> import feeltech
>>> ft = feeltech.FeelTech("/dev/ttyUSB0")
>>> ft.type()
'FY3224S'
```

The two channels can then be accessed

```
>>> ft.channels()
[<feeltech.Channel object at 0x7f577b11fd10>, <feeltech.Channel object at 0x7f577b11fcd0>]
```

and to set various parameters

```
>>> c.frequency(30e3)
```

The calls can be chained like:

```
>>> c.frequency(30e3).amplitude(3.3)
```

Or even

```
>>> c.frequency(1e3).waveform(feeltech.SINE).sleep(3).waveform(feeltech.SQUARE)
```

To upload a waveform (decaying exponential):

```
>>> ft.upload_waveform(2, [int(e ** (-x / 1000) * 2 ** 12) for x in range(2048)])
>>> c.waveform(feeltech.ARB2)
```

![ds1054z-scope-display_2015-09-05_12-31-49](https://cloud.githubusercontent.com/assets/3966931/9698867/5316aea6-53ca-11e5-9fa5-effcb74e3c12.png)


## Commandline tool

```
$ fytool -h
usage: fytool [-h] [--port PORT] {type,set,sweep,frequency,counter,upload} ...

FeelTech FY32xx control utility

positional arguments:
  {type,set,sweep,frequency,counter,upload}
    type                display the device type
    set                 set channel properties
    sweep               Perform a frequency sweep
    frequency           Show frequency measured
    counter             Show counter value
    upload              upload arbitrary waveform

optional arguments:
  -h, --help            show this help message and exit
  --port PORT, -p PORT  serial por
```

To set channel 1 frequency to 1 MHz, waveform to triangle and amplitude to 1V:

```
$ fytool set -c 1 -f 1e6 -w triangle -a 1
```

![ds1054z-scope-display_2015-09-05_12-44-45](https://cloud.githubusercontent.com/assets/3966931/9698904/188551be-53cc-11e5-9e44-564130314562.png)

Reading the internal frequency counter

```
$ fytool frequency
1000010
$ fytool counter
545269
```

To perform a loagrithmic sweep from 1 kHz to 10 kHz, with period of 1 second and lasting for total of 50 seconds:

```
fytool sweep -s 1e3 -e 10e3 --period 1 --time 50 --type log --waveform square
```

## TUI

There is also a curses interface to control the device

```
$ fytui /dev/ttyUSB0
```
![ds1054z-scope-display_2015-09-05_12-55-57](https://cloud.githubusercontent.com/assets/3966931/9698935/ae043a7e-53cd-11e5-8dc2-c09d6f370b9c.png)
![tui](https://cloud.githubusercontent.com/assets/3966931/9698931/a54afdfa-53cd-11e5-9791-76b25dc3e66f.png)

There is a bunch of keyboard shortcuts:

```
m     -- take frequency measurement
n     -- take counter measurement
w     -- focus waveform
f     -- focus frequency
d     -- focus duty cycle
a     -- focus amplitude
q     -- exit
+/s   -- increments selected digit
-/x   -- decremenets selected digit
```

For `w/f/d/a` if the control is already focused, it focuses its counterpart in the other channel.
« Last Edit: November 04, 2017, 02:49:27 AM by cdev »
"What the large print giveth, the small print taketh away."
 

Offline rhb

  • Regular Contributor
  • *
  • Posts: 154
  • Country: us
Re: Cheap signal generator with variable squarewave rise/fall time
« Reply #7 on: November 04, 2017, 05:30:06 AM »
I have a (very) low cost (Feeltech FY3224 AWG -as little as $45 now) and one can use CSV file to generate custom waveforms. You need to write out a CSV file containing one complete cycle of the wave form and then load it. This would be less convenient than what you might be able to dial up with a better AWG but really cheap, and still quite usable.


Thank you! That's very useful as it's a easy way to load a saved scope trace into the AWG.  I'd have never looked at one of those.
We all get what we deserve whether we want it or not, either as individuals or members of a group.  Sometimes this is as punishment and sometimes it's a blessing.  Which is always ambiguous and depends entirely upon what we do next.
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 2578
  • Country: us
  • [Personal Text]
Re: Cheap signal generator with variable squarewave rise/fall time
« Reply #8 on: November 04, 2017, 05:34:30 AM »
I am going to upload an example of an arbitrary waveform file that I found somewhere (probably here in the big Feeltech thread) this is 10 cycles of a sine wave. This is an xls file, actually, and will give you an example of the file format.
"What the large print giveth, the small print taketh away."
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf