.

.

.

.

Meta-Instruments save money

Whether you are a home hobyist or the operator of a service shop, the time will come that you need sophisticated instruments, often with unusual capabilities. To get these unusual, sophisticated, instruments, you can invest many dollars to commision their purchase, or design and construction, or, you can invest your time, and a much lower buy-in, to configure a suite of Meta-Instruments that fulfill your requirements. A meta-instrument is a combination of a computer I/O device and control software to provide the functionality that once required thousands of dollars of dedicated hardware. Set yourself up with a voltmeter, a dual-trace oscilloscope, a spectrum analyzer, a signal generator, and a network response analyzer, for under $500 dollars.

The first steps

For this tutorial, you will need the free software from Syscomp. Get the control software package for the CGR CircuitGear, and anything else you feel will support your studies. You can begin things with just the free software, but, you cannot exercise the software without a CGR to interact with, so as soon as you are satisfied that you will continue this path, order your CGR and maybe a DVM too (if you need true RMS readings, the Mastech MS8226 from Syscomp does not do True-RMS, you need the MS8226T version, which can be a hassle, since you need to also other-source the Prolific rs232 to USB converter). If you are following along with the tutorial, you will want copies of the three waveform files we will be adding to the standard signal generator (distributed as CopyLeft files, the license is in the zip). There is some confusing commentary about needing to get a development version of tcl in order to do any development, but for our work we will be modifying the Syscomp application, and they built it to load and run without any other tcl interpreter, and use the source code files as live source, so any of our edits will be part of the application the next time it loads. If you decide to go on and develop other tcl applications, THEN you will want to obtain the full tcl/tk package.

Install the Syscomp GUI for the CGR, and start the GUI - The default screen opens showing an oscilloscope screen with a red trace and a blue trace, just straight lines across the middle. To the left of the oscilloscope screen are the channel controls, with value per division, buttons to increase or decrease the magnification (the plus button magnifies the scale, reducing the value per division); The options button opens a menu allowing you to hide the trace, or invert it. The radio button pair under the range box are to adjust the readout for a ten-to-one probe or a direct one-one input. The timebase and trigger controls are under the main scope screen. We can ignore the stuff along the bottom, that is for other instrumentation. To the right of the oscilloscope section is the signal generator section; The first slider is volume - 100% should give a peak-to-peak of just under seven volts, plenty for using the generator to drive a component curve-tracer. The second slider is output frequency - you can click the limit buttons at top and bottom, and get a dialog box to set new top and bottom limits, you also have a pair of radio buttons to select the slider slope as linear by Hertz or exponential. The last set of controls is the shape of the generated wave, offering Sine, Square, Triangle and Sawtooth, plus a button for "custom" and one for broad-band noise. Without a CGR connected, all we can do is play with the buttons.

This is a good time to also install the three custom waveforms, open the Syscomp "Source" folder and open the zip file, copy the three .dat files from the zip into Source (read the license if you feel like it, it's your reference copy of the standard GNU copyleft document, feel free to love it and use it for your stuff too) and close the zip and folder.

A bit of music audio theory

The provided waveforms have a lot of uses in testing audio electronics, the Sine is a pure single tone, with no partials (a partial is a discernable sub-part of a wave); the Square has sharp edges, a distinctive shape, and a collection of partials at three times the base frequency, five times the base frequency, seven, nine and so on up the band, every odd multiple. The Triangle wave has the same odd-multiple collection as the square, but falls off faster and has fewer other partials filling in between the main; The triangle looks good as a driver for that component curve tracer, just up and back down with linear slopes. The sawtooth only has one slope, once it reaches the limit, it jumps back and starts again, and the spectrum view of it's partials is a fine tooth comb. These are an excelent collection of waves, a good analog synthesizer, such as a Moog MultiMoog, will provide Sine, Square, triangle, sawtooth and a square/triangle mix as their base for voice creation, so we can use these generated waves to troubleshoot the filter modules of a modular synth, as well as feeding the square into an amplifier and using the scope to watch for distortion. One of the waveforms we will be adding to extend our test coverage is the staircase, created by adding a set of square waves that double in frequency and divide amplitude by half, so we get both odd and even partials; the staircase has clear edges, and a limited number of partials (as the number of steps increases, the staircase smoothes into the sawtooth). The other two waveforms will both be "C-Major chords", one the normal "C-E-G", the other using the G from the octave below, the "first inversion, G-C-E"; Musical chords have simple ratio relations, the ratio between a C and the next E is 4/5, and E to G is 5/6, while C to the G below is 4/3. The chord waveforms both sound to the ear as a richer C, but the C will be at four times the selected frequency. One form of distortion in an amplifier is called "intermodulation distortion", a frequency spectrum of the chord will show three clear spikes, evenly spaced, after intermodulation distortion there will be extra spikes both down near the origin and higher up the band (sum and difference "5-4, 6-4, 4, 5, 6, 4+5, 4+6, and 5+6").

We go on to live-test

Connect cables to your CGR so that the generator is connected to input A, and also to input B, but through some circuit you can adjust while watching the effects on the scope; Connect the CGR to your computer and start the GUI. Change the waveform selection and amplitude, drag the scope traces up and down, get familliar with the generator and scope controls; Then, select the "Custom" waveform - a "browse for file" box will open, select one of the three .dat files you copied into the application Source, and see how it compares to the waves in the standard set (you can also select one of the standard set of waveforms, just select sine.dat instead of staircase.dat). Again, click custom and select a waveform, do it a few more times with different waves, then go back to the preset waves, Sine, Square, etc. It is a lot easier to click Sawtooth than to click Custom and browse for staircase, but we want to use staircase because we can see changes in the edges and flats easier than the slope of Sawtooth; It is time to delve into the mysteries of tcl, and find a way to get our three waves included in the main list.

Editing the tcl source

Return to the Syscomp Source folder, and locate waveform.tcl, open with a decent text editor, DO NOT USE A WORD PROCESSOR, a word processor will add "format codes" and other non-tcl crud that will prevent the program from running, only use a "clean" text editor, such as Microsoft Notepad. Do a search for:

	button $wavePath.wave.sawtooth	\
		-text "Sawtooth"	\
		-command {::wave::programWaveform sawtooth.dat}

Copy the button code, and the blank line below it, then paste three copies of the button code (for our three buttons) right after the original, edit the copies to look like this-

	button $wavePath.wave.sawtooth	\
		-text "Sawtooth"	\
		-command {::wave::programWaveform sawtooth.dat}
		
	button $wavePath.wave.staircase	\
		-text "Staircase"	\
		-command {::wave::programWaveform staircase.dat}
		
	button $wavePath.wave.gce	\
		-text "G-C-E Chord"	\
		-command {::wave::programWaveform GCEChord.dat}
		
	button $wavePath.wave.cge	\
		-text "C-E-G Chord"	\
		-command {::wave::programWaveform CEGChord.dat}

If you save this, and reload the program, you will not see any changes, because we have instantiated the buttons, but not "shown" them. You need to go down the source just a little to:

	grid $wavePath.wave.waveDisplay -row 0 -column 0
	grid $wavePath.wave.freqDisplay -row 1 -column 0
	grid $wavePath.wave.sine -row 2 -column 0 -sticky we
	grid $wavePath.wave.square -row 3 -column 0 -sticky we
	grid $wavePath.wave.triangle -row 4 -column 0 -sticky we
	grid $wavePath.wave.sawtooth -row 5 -column 0 -sticky we
	grid $wavePath.wave.custom -row 6 -column 0 -sticky we
	grid $wavePath.wave.noise -row 7 -column 0 -sticky we

and edit it into this:

	grid $wavePath.wave.waveDisplay -row 0 -column 0
	grid $wavePath.wave.freqDisplay -row 1 -column 0
	grid $wavePath.wave.sine -row 2 -column 0 -sticky we
	grid $wavePath.wave.square -row 3 -column 0 -sticky we
	grid $wavePath.wave.triangle -row 4 -column 0 -sticky we
	grid $wavePath.wave.sawtooth -row 5 -column 0 -sticky we
	grid $wavePath.wave.staircase -row 6 -column 0 -sticky we
	grid $wavePath.wave.gce -row 7 -column 0 -sticky we
	grid $wavePath.wave.cge -row 8 -column 0 -sticky we
	grid $wavePath.wave.custom -row 9 -column 0 -sticky we
	grid $wavePath.wave.noise -row 10 -column 0 -sticky we

The result is, our three new buttons are inserted right after the sawtooth, pushing custom and noise down into 9th and 10th place; Save the edits, load the program, and see the results.

Buying a CGR from Syscomp, about $190, plus shipping and handling, the Measurements window provides a passable voltmeter, the Main window gives the signal generator and dual trace scope, other instrument windows give the Bode plotter and spectrum analyzer - and, to be complete, a pair of multimeters, with USB connectivity, adds $90 each, round it up for shipping and handling, $400 total, leaving us with $100 of our target budget for test leads and extras.

I have further ideas to pursue, and this project will be continued, check back for updates.

To create the three waveforms I worked in Microsoft Excel, first loading the standard Sine data file, then hand-copying every third value into a new column, when I reached the end, I took my short column and copied it 2 more times, giving a value list for a third harmonic sine.. in similar fashion I built fourth, fifth and sixth harmonic columns, then calculated a new column that was one third of the sum of the third, fourth and fifth harmonics and saved it as GCE - more time consuming than dificult.

If you need a specialized waveform set, Just Do It

.

Download this tutorial in .ePub format

Validate page mark-up Validate page style Last edited=