Παρασκευή, 31 Οκτωβρίου 2014

Calculating Filters with Your TI

I've developed a small set of programs to calculate and graph simple first order low pass or high pass RC filters. These run on TI 89 or 92/92Plus / Voyage 200. I may convert them for the TI 84 Plus C too, though I think this calc is mostly used by high school students rather than engineers. (Although some of us have a not so modest collection of scientific/graphing calcs!)

I will not repeat the theory of RC filters here, you can find some excellent articles on the web, such as:

Download the set of programs here:


Quick Walk-through of the Program

Unzip the downloaded file and use TI Connect to send it to your calc. The program creates a folder called electron for its own use, so it won't mess with any of your variables in main. It will also attempt to backup any settings it changes during startup and restore them on exit.
To execute the program:





The program will then automatically setfold to electron where the other subprograms are stored. Next, the main menu is shown:




Design allows you to enter a frequency and either a resistor or capacitor. It will then solve for the other component. Analyze will perform a calculation of a filter based on the values of both components. Components and resistors may be selected from the standard E12 values or be of any other manually entered value.

Let's follow a path through the "Design Filter" option:




Using the first option, you enter a cut-off frequency and a resistor. Second option for entering Frequency and capacitor. Going ahead with the first option:




Entering a frequency in Hz (1000Hz for our sample calculation)




Select a resistor. Use option 2 for non-standard values. Going ahead with option 1, you will be presented with a dialog to select a value. A matching dialog is used for capacitors as well.




We have selected 1000Ohms for the resistor. The program will give us the first results:




The calculated capacitor is 159 nF. The program then asks for two values which are used to create tables and graphs. The frequency step here is used for the phase shift and gain tables that follow.




The last frequency corresponds to the last value shown on the phase shift / gain graphs. Up to this point, the calculations for both Low Pass and High Pass filters are the same.




Before entering the tables/graphs section we must actually select the type of filter we are designing. Let's assume a low pass filter.




In this table, x represents frequency (using the step we entered previously). The column labeled "1" is the phase shift (notice -45 degrees in the -3db point for the LPF) and "2" is the gain (-3db=0.707). You can move around the table using the arrows and explore the values. When ready, just press enter.




You now have the option to see the table results as a series of graphs or just exit to the same menu. Assuming the first option, we get the phase shift graph:




After graphing is complete, the trace cursor appears and you may move through the graph and note the phase shift value for each frequency. You may also directly type the desired frequency. When ready, press enter for the next graph.




Again, use the same techniques to explore the Gain graph. When ready, press Enter to return to the main menu.

If the program crashes for some reason (or if you break out of it without using the Exit option) some modes on your calculator may be changed. To return your calculator to the state it was before running the program, type the following commands in the home screen:

setfold(electron)
rclGDB gdb
initg(0)
setmode("14",modevar)
setfold(main)

If you happen to have misplaced your TI, you can always run these programs in an emulator. Tiemu is an excellent one and works in all major operating systems.

I hope you find this useful!