November 22, 2024, 02:39:40 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Selector Switch/POT Command

Started by Tim-M, January 07, 2008, 11:30:48 AM

Previous topic - Next topic

Tim-M

That makes sense.  I decided to use Cat-5 cable for the initial try, figuring that if any cable or wire had minimal and consistant capacitance characteristics, that had to be it.  I was just looking for a first impression and hoping that it would give enough of an indicator as to this working or not... would the method be worth pursuing or not, that kind of thing.

Tim

Tim-M

January 31, 2008, 07:29:28 AM #16 Last Edit: January 31, 2008, 07:39:02 AM by Tim-M
Something interesting here during testing...

When running the POT scaling utility within the editor, the Scale Factor does not change at all when my different selection choices, or resistances, are made.  It stays at 255.  It is described in help that you should see it vary.  To the effect of: 'Turn the pot to both extremes and note the smallest value in the Scale Factor box.'  Maybe the cap and resistor values being used do actually result in a Scale Factor of 255, and that would be fine, but I'd sure like to understand why this is the case.

Tim

JonnyMac

It's not likely.  If you're using 0.1 uF and a 10K max resistor, you should have a Scale value somewhere around 100.
Jon McPhalen
EFX-TEK Hollywood Office

Tim-M

January 31, 2008, 09:12:24 AM #18 Last Edit: January 31, 2008, 09:25:35 AM by Tim-M
OK then, back to basics...

All component values are verified.  Resistance is also tested and verified when the selector switch and cable are assembled... and at the other end of the cable.

Setup description:  The selector switch connects to the project via a terminal block mounted next to the Prop-1.  The 0.1 uf capacitor is within a 5" R/C style pigtail (under heat-shrink) that connects the other side of that terminal block to P7 on the Prop-1, and is wired as expected in series between the terminal and the white wire.

OK all looks good, so more testing...

NEW CLUE: Leaving the capacitor pigtail as is and with a 10K resistor installed directly at the terminal block in place of the selector switch/cable assembly, the POT Scale Factor changes to 105 as you expected Jon!

This would indicate that the capacitor pigtail arrangement is OK and that the cable length may be playing more of a role than first thought, since the resistance remains the same in either test.  Maybe the total capacitance is too high when the cable is included??  Drop the capacitor value to compensate, or just run with a Scale Factor of 255 as things were and call it good?

Edit:  I should mention that pins 1 and 18 have been removed from the ULN output driver IC so as not affect P7 on the Prop-1.


JonnyMac

What scale value were you using when you got the good test numbers mentioned earlier?  Did test that not include the cable?
Jon McPhalen
EFX-TEK Hollywood Office

Tim-M

Yes, the earlier test did include the switch and cable connected at the terminal block.  The scale value stays at 255 this way, and that is the value used during that test.

JonnyMac

In your application, it really doesn't matter as what you're looking for is enough difference in switch position values to be able to reliably discriminate between them. 

The scale is actually a divider; internally, the POT command comes up with a 16-bit value and the scale divides this down to eight-bits (the memory on the BS1 is limited).  When using a variable resistance, it's nice to have an output that goes from 0 to 255 at the extremes of the pot.  Again, this doesn't matter for you, and what is probably happening is that the cable resistance is contributing enough to force the scale to be maxed to get the value down within eight bits.

The internal workings of the POT instruction are explained in detail in this article by Scott Edwards:
-- http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol1/col/nv15.pdf
Jon McPhalen
EFX-TEK Hollywood Office

Tim-M

OK, Thanks for the input and the link Jon.  I'll read the article by Scott Edwards and learn what I can.  As you said... for this application, the results of the first test using a scale factor of 255 will be just fine as long as they are reliably repeatable.

Thanks again for your time and help with this,

Tim