📄 tutorial.lyx
字号:
\end_inset scope probes\begin_inset Quotes erd\end_inset \layout StandardAt this point, Halscope is ready to use. We have already selected a sample rate and record length, so the next step is to decide what to look at. This is equivalent to hooking \begin_inset Quotes eld\end_inset virtual scope probes\begin_inset Quotes erd\end_inset to the HAL. Halscope has 16 channels, but the number you can use at any one time depends on the record length - more channels means shorter records, since the memory available for the record is fixed at approximately 16,000 samples.\layout StandardThe channel buttons run across the bottom of the halscope screen. Click button \begin_inset Quotes eld\end_inset 1\begin_inset Quotes erd\end_inset , and you will see the \begin_inset Quotes eld\end_inset Select Channel Source\begin_inset Quotes erd\end_inset dialog, figure \begin_inset LatexCommand \ref{fig:Halscope-demo-3}\end_inset . This dialog is very similar to the one used by Halmeter. We would like to look at the signals we defined earlier, so we click on the \begin_inset Quotes eld\end_inset Signals\begin_inset Quotes erd\end_inset tab, and the dialog displays all of the signals in the HAL (only two for this example).\layout Standard\begin_inset Float figurewide falsecollapsed false\layout Standard\align center \begin_inset Graphics filename halscope-demo-3.png\end_inset \layout Caption\begin_inset LatexCommand \label{fig:Halscope-demo-3}\end_inset Select Channel Source dialog\end_inset \layout StandardTo choose a signal, just click on it. In this case, we want to use channel 1 to display the signal \begin_inset Quotes eld\end_inset X_vel\begin_inset Quotes erd\end_inset . When we click on \begin_inset Quotes eld\end_inset X_vel\begin_inset Quotes erd\end_inset , the dialog closes and the channel is now selected. The channel 1 button is pressed in, and channel number 1 and the name \begin_inset Quotes eld\end_inset X_vel\begin_inset Quotes erd\end_inset appear below the row of buttons. That display always indicates the selected channel - you can have many channels on the screen, but the selected one is highlighted, and the various controls like vertical position and scale always work on the selected one. To add a signal to channel 2, click the \begin_inset Quotes eld\end_inset 2\begin_inset Quotes erd\end_inset button. When the dialog pops up, click the \begin_inset Quotes eld\end_inset Signals\begin_inset Quotes erd\end_inset tab, then click on \begin_inset Quotes eld\end_inset Y_vel\begin_inset Quotes erd\end_inset . \layout StandardWe also want to look at the square and triangle wave outputs. There are no signals connected to those pins, so we use the \begin_inset Quotes eld\end_inset Pins\begin_inset Quotes erd\end_inset tab instead. For channel 3, select \begin_inset Quotes eld\end_inset siggen.0.triangle\begin_inset Quotes erd\end_inset and for channel 4, select \begin_inset Quotes eld\end_inset siggen.0.square\begin_inset Quotes erd\end_inset .\begin_inset Notecollapsed true\layout StandardThe siggen component now uses 0 as the starting number, so these screenshots need to be updated.\end_inset \layout Standard\begin_inset ERTstatus Collapsed\layout Standard\backslash clearpage\end_inset \layout SubsectionCapturing our first waveforms\layout StandardNow that we have several probes hooked to the HAL, it's time to capture some waveforms. To start the scope, click the \begin_inset Quotes eld\end_inset Normal\begin_inset Quotes erd\end_inset button in the \begin_inset Quotes eld\end_inset Run Mode\begin_inset Quotes erd\end_inset section of the screen (upper right). Since we have a 4000 sample record length, and are acquiring 1000 samples per second, it will take halscope about 2 seconds to fill half of its buffer. During that time a progress bar just above the main screen will show the buffer filling. Once the buffer is half full, the scope waits for a trigger. Since we haven't configured one yet, it will wait forever. To manually trigger it, click the \begin_inset Quotes eld\end_inset Force\begin_inset Quotes erd\end_inset button in the \begin_inset Quotes eld\end_inset Trigger\begin_inset Quotes erd\end_inset section at the top right. You should see the remainder of the buffer fill, then the screen will display the captured waveforms. The result will look something like figure \begin_inset LatexCommand \ref{fig:Halscope-demo-4}\end_inset .\layout Standard\begin_inset Float figurewide falsecollapsed false\layout Standard\align center \begin_inset Graphics filename halscope-demo-4.png\end_inset \layout Caption\begin_inset LatexCommand \label{fig:Halscope-demo-4}\end_inset Captured Waveforms\end_inset \layout StandardThe \begin_inset Quotes eld\end_inset Selected Channel\begin_inset Quotes erd\end_inset box at the bottom tells you that the green trace is the currently selected one, channel 4, which is displaying the value of the pin \begin_inset Quotes eld\end_inset siggen.1.square\begin_inset Quotes erd\end_inset . Try clicking channel buttons 1 through 3 to highlight the other three traces.\layout Standard\begin_inset ERTstatus Collapsed\layout Standard\backslash clearpage\end_inset \layout SubsectionVertical Adjustments\layout StandardThe traces are rather hard to distinguish since all four are on top of each other. To fix this, we use the \begin_inset Quotes eld\end_inset Vertical\begin_inset Quotes erd\end_inset controls in the box to the right of the screen. These controls act on the currently selected channel. When adjusting the gain, notice that it covers a huge range - unlike a real scope, this one can display signals ranging from very tiny (pico-units) to very large (Tera-units). The position control moves the displayed trace up and down over the height of the screen only. For larger adjustments the offset button should be used (see the halscope reference in section \begin_inset LatexCommand \ref{sec:Halscope}\end_inset for details).\layout SubsectionTriggering\layout StandardUsing the \begin_inset Quotes eld\end_inset Force\begin_inset Quotes erd\end_inset button is a rather unsatisfying way to trigger the scope. To set up real triggering, click on the \begin_inset Quotes eld\end_inset Source\begin_inset Quotes erd\end_inset button at the bottom right. It will pop up the \begin_inset Quotes eld\end_inset Trigger Source\begin_inset Quotes erd\end_inset dialog, which is simply a list of all the probes that are currently connected (Figure \begin_inset LatexCommand \ref{fig:Halscope-demo-5}\end_inset ). Select a probe to use for triggering by clicking on it. For this example we will use channel 3, the triangle wave.\layout Standard\begin_inset Float figurewide falsecollapsed false\layout Standard\align center \begin_inset Graphics filename halscope-demo-5.png\end_inset \layout Caption\begin_inset LatexCommand \label{fig:Halscope-demo-5}\end_inset Trigger Source Dialog\end_inset \layout StandardAfter setting the trigger source, you can adjust the trigger level and trigger position using the sliders in the \begin_inset Quotes eld\end_inset Trigger\begin_inset Quotes erd\end_inset box along the right edge. The level can be adjusted from the top to the bottom of the screen, and is displayed below the sliders. The position is the location of the trigger point within the overall record. With the slider all the way down, the trigger point is at the end of the record, and halscope displays what happened before the trigger point. When the slider is all the way up, the trigger point is at the beginning of the record, displaying what happened after it was triggered. The trigger point is visible as a vertical line in the progress box above the screen. The trigger polarity can be changed by clicking the button just below the trigger level display. Note that changing the trigger position stops the scope, once the position is adjusted you restart the scope by clicking the \begin_inset Quotes eld\end_inset Normal\begin_inset Quotes erd\end_inset button in the \begin_inset Quotes eld\end_inset Run Mode\begin_inset Quotes erd\end_inset box.\layout StandardNow that we have adjusted the vertical controls and triggering, the scope display looks something like figure \begin_inset LatexCommand \ref{fig:Halscope-demo-6}\end_inset .\layout Standard\begin_inset Float figurewide falsecollapsed false\layout Standard\align center \begin_inset Graphics filename halscope-demo-6.png\end_inset \layout Caption\begin_inset LatexCommand \label{fig:Halscope-demo-6}\end_inset Waveforms with Triggering\end_inset \layout Standard\begin_inset ERTstatus Collapsed\layout Standard\backslash clearpage\end_inset \layout SubsectionHorizontal Adjustments\layout StandardTo look closely at part of a waveform, you can use the zoom slider at the top of the screen to expand the waveforms horizontally, and the position slider to determine which part of the zoomed waveform is visible. However, sometimes simply expanding the waveforms isn't enough and you need to increase the sampling rate. For example, we would like to look at the actual step pulses that are being generated in our example. Since the step pulses may be only 50uS long, sampling at 1KHz isn't fast enough. To change the sample rate, click on the button that displays the record length and sample rate to bring up the \begin_inset Quotes eld\end_inset Select Sample Rate\begin_inset Quotes erd\end_inset dialog, figure . For this example, we will click on the 50uS thread, \begin_inset Quotes eld\end_inset fast\begin_inset Quotes erd\end_inset , which gives us a sample rate of about 20KHz. Now instead of displaying about 4 seconds worth of data, one record is 4000 samples at 20KHz, or about 0.20 seconds.\layout Standard\begin_inset Float figurewide falsecollapsed false\layout Standard\align center \begin_inset Graphics filename halscope-demo-7.png\end_inset \layout Caption\begin_inset LatexCommand \label{fig:Halscope-demo-7}\end_inset Sample Rate Dialog\end_inset \layout Standard\begin_inset ERTstatus Collapsed\layout Standard\backslash clearpage\end_inset \layout SubsectionMore Channels\layout StandardNow let's look at the step pulses. Halscope has 16 channels, but for this example we are using only 4 at a time. Before we select any more channels, we need to turn off a couple. Click on the channel 2 button, then click the \begin_inset Quotes eld\end_inset Off\begin_inset Quotes erd\end_inset button at the bottom of the \begin_inset Quotes eld\end_inset Vertical\begin_inset Quotes erd\end_inset box. Then click on channel 3, turn if off, and do the same for channel 4. Even though the channels are turned off, they still remember what they are connected to, and in fact we will continue to use channel 3 as the trigger source. To add new channels, select channel 5, and choose pin \begin_inset Quotes eld\end_inset stepgen.1.dir\begin_inset Quotes erd\end_inset , then channel 6, and select \begin_inset Quotes eld\end_inset stepgen.1.step\begin_inset Quotes erd\end_inset . Then click run mode \begin_inset Quotes eld\end_inset Normal\begin_inset Quotes erd\end_inset to start the scope, and adjust the horizontal zoom to 5mS per division. You should see the step pulses slow down as the velocity command (channel 1) approaches zero, then the direction pin changes state and the step pulses speed up again. You might want to increase the gain on channel 1 to about 20m per division to better see the change in the velocity command. The result should look like figure \begin_inset LatexCommand \ref{fig:Halscope-demo-8}\end_inset .\layout Standard\begin_inset Float figurewide falsecollapsed false\layout Standard\align center \begin_inset Graphics filename halscope-demo-8.png\end_inset \layout Caption\begin_inset LatexCommand \label{fig:Halscope-demo-8}\end_inset Looking at Step Pulses\end_inset \layout SubsectionMore samples\layout StandardIf you want to record more samples at once, restart realtime and load halscope with a numeric argument which indicates the number of samples you want to capture, such as\layout LyX-Codehalcmd:\series bold loadusr halscope 80000\layout Standardif the \family typewriter scope_rt\family default component was not already loaded, halscope will load it and request 80000 total samples, so that when sampling 4 channels at a time there will be 20000 samples per channel. (If \family typewriter scope_rt\family default was already loaded, the numeric argument to halscope will have no effect)\the_end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -