Shop OBEX P1 Docs P2 Docs Learn Events
Strange findings when exploring the boe-bot with an oscilloscope — Parallax Forums

Strange findings when exploring the boe-bot with an oscilloscope

realitybiasrealitybias Posts: 16
edited 2007-07-24 14:10 in General Discussion
Hello everyone. We are preparing to teach classes next quarter that will include using oscilloscopes to visualize what is going on in our boe-bots. Using a circuit that uses a 220 ohm resistor and a capacitor, we write the following program:

Do
High 6
pause 10
Low 6
pause 15
Loop

The program is simple enough. We give the capacitor 10 seconds to charge, and then we let the capacitor discharge for 15 seconds. I direct your attention to Exhibit 1, which is a picture of the circuit we are using...

circuitryfw0.jpg

This picture shows the oscilloscope leads attached to two sides of a resistor. Whenever the capacitor is charging, you should be able to see it on an oscilloscope as a logarithmic increase. Whenever the capacitor is discharging, you should see it as an exponential decrease. It is basic capacitor education. What we found in practice, however, surprised us greatly! Upon the activation of the program, we were met with exhibit 2 on our oscilloscopes:

diagram1hw5.jpg

Marked on this diagram are the positions of what I will call for the remainder of this topic A, B, C, and D. Though it may look reasonably close to a square wave function, there is a whole lot more going on here. This picture of our oscilloscope represents a zoomed out version of the periodic charging and discharging of our capacitor. However, it appears that somehow, we are losing a charge whenever we are pausing 10, and we are gaining a charge when we are pausing 15. Let me go into detail on each portion of this diagram.

A) A in our program matches up with our "pause 15" duration. As you can see, we are somehow gaining a charge whenever, theoretically, there is no connection to a high voltage.
B) B in our program matches up with our High 6. What you cannot see yet, is that B is actually a logarithmic charge. Our capacitor charges VERY fast, but when zoomed up, it has the characteristic logarithmic charging of a capacitor.
C) C in our program matches up wouth our low 10. As you can see, we are somehow losing a charge whenever, theoretically, there is a constant high voltage applied.
D) D in our program matches up with our Low 6. What you cannot see yet, is that D is actually an exponential discharge. Our capacitor discharges VERY fast, but when zoomed up, it has the characteristic exponential discharging of a capacitor.

I am going to direct you to exhibit 3, which will make things a lot more clear. Zoomed up very close, you can See that A and C are indeed discharging and charging like a capacitor. Each of the letters in exhibit 3 match up with the letters in exhibit 2.

diagram2ly1.jpg

So to confirm our suspicions, we eliminated the pause duration, and zoomed up VERY close. And here is what we found... the classic capacitor charge and discharge. Exhibit 4

diagram3uk1.jpg



Our program for this was...

Do
High 6
High 6
High 6
High 6
High 6
High 6
low 6
pause 1
loop

A and C do not appear in exhibit 4, because the pause durations are eliminated. The final pause duration could be replaced with 6 low signals, but we are only interested in the time it takes for the capacitor to charge and discharge, so it does not matter. We zoomed up close, with the pause duration charging and discharging of A and C eliminated, and found that B and D also look like capacitors charging and discharging.


So I know I may have lost a lot of people with all of this, but for those of you that have read to this point, here is what I'd like to find out...

1) Why the oscilloscope read the (or a) capacitor as discharging during the pause 10 duration, whenever the circuit was supposed to be high?
2) Why the oscilloscope read the (or a) capacitor as charging during the pause 15 duration, when the circuit was supposed to be low?
3) Why there are apparently two distinct capacitors at work here?

My theory was that this was the action of the voltage regulator capacitor built into the board of education. We were using 6 volts worth of batteries, while the regulator dumps it down to 5 volts. It seems like it would match up, because it charges or discharges only about a little more than half a volt. What do you guys think?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-23 20:55
    You didn't give the capacitor value you're using nor did you give a circuit diagram. There are two resistors involved and it looks like one is across the capacitor. That'll affect the charge/discharge cycle and the peak charge voltage, particularly if the one across the capacitor is another 220 ohm one.

    The main issue is that your timings are all off. The PAUSE statement provides a delay in milliseconds. Your first program sets the I/O pin to high, then waits 10ms and sets the pin to low, then waits 15ms. Your second program sets the I/O pin to high for about 800us, then low for about 1200 us, then repeats. Obviously, in your second program, the on/off time is on the order of the RC time for the parts values involved.
  • realitybiasrealitybias Posts: 16
    edited 2007-07-23 21:03
    The resistance values are both 220 ohm.
    The capacitor is .1 microfarads for the first two pictures, and 10 microfarads for the last picture.

    The pause durations are not relevant and the only reason I included them was to show that during a pause duration, a second capacitor was at work.

    A and C are a charge and discharge cycle (A is exponentially discharging, C is logarithmically charging)
    B and D are also charge and discharge cycles, much more inline with our .01 microfarad capacitor (B is logarithmically charging, D is exponentially discharing)

    To show this, we took out the pause duration entirely. But in Exhibit 2, if you were to zoom up VERY close with the oscilloscope, you would see that it is indeed a logarithmic charge and an exponential discharge. There are two capacitors at work here, it seems, and only 1 of them is the .01 microfarad capacitor.


    The BIG anomoly, though, is A and C, because While A is discharging, we have a HIGH 6. While C is charging, we have a LOW 6. This is very strange.

    Post Edited (realitybias) : 7/23/2007 9:38:57 PM GMT
  • realitybiasrealitybias Posts: 16
    edited 2007-07-23 21:23
    Here is a better picture than Exhibit 2. This picture is GROSSLY out of proportion, as B and D are much more defined than they are in exhibit 2, but it really shows what I'm trying to say. Whenever you zoom up, you see B and D look exactly as I have drawn them here:

    2capacitoreu5.png
  • phil kennyphil kenny Posts: 233
    edited 2007-07-24 14:10
    Two suggestions:

    1) Change the scope coupling from AC to DC. Then the waveforms
    at A and C will be flat.

    2) Calibrate the scope probe trimmer capacitor by connecting
    it to the built in 1 kHz square wave oscillator. Adjust for no
    undershoot or overshoot.

    Then look at the boe-bot waveforms.

    phil
Sign In or Register to comment.