Shop OBEX P1 Docs P2 Docs Learn Events
BS2p40 and USB2SER Question — Parallax Forums

BS2p40 and USB2SER Question

Bill ChennaultBill Chennault Posts: 1,198
edited 2008-04-07 04:18 in BASIC Stamp
All--

I have a rather complicated setup involving five Stamps. The main one is a BS2p40. My problem MIGHT be simple, so I will give a shot at providing the symptom to see if anyone recognizes it.

All the logic on my robot is mounted on a big Jameco breadboard. The BS2p40 is powered from VDD off a BS2-OEM. The BS2p40 turns on the twelve volt system and gives commands to the other Stamps. The problem is that the BS2p40 often does not "reboot" after power is removed and restored. It simply does nothing. To get it to crank up, I only have to plug in an active USB connection. I do not have to download the program. In fact, I do not even have to have the IDE up and running.

The BS2p40 module is inserted in the breadboard and powered (as I mentioned) by a BS2-OEM. I also built the serial interface for the USB2SER. Although I suspect the serial interface I built may be flaky, I am not positive this is the problem since it does not explain why the BS2p40 will start when an active USB connection is applied to the USB2SER. Even then, it is kinda weird.

The first thing the BS2p40 does is power on an SSR which has an LED. The SSR brings up the 12 volt system. When I plug in an active USB connection to the USB2SER on the BS2p40, the LED blinks 7 times and I can hear the fans on the two HB-25s starting very momentarily and shutting down in time with the LED on the SSR. Then the program runs normally.

My power leads from the 7.2 volt batteries to the breadboard are several inches long. No capacitors are involved in the power connection. (Is this an issue?) All grounds are tied together between the 7.2 volt system and the 12 volt system.

Ideas?

Thanks!

--Bill

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-04-05 23:07
    Perhaps the startup code would be helpful. Is there any significance to the number seven? Do you have a pulldown resistor on the VDD power lead of the OEM?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-05 23:08
    Bill,
    This is too complicated for a simple written description. Please come up with a schematic and post it as an attachment to a message. Obviously, the BS2p40 isn't getting proper power under some circumstances. The USB2SER adapter may be providing a little bit of power through "sneak" paths through data lines and protective diodes, enough to get things started.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-04-05 23:29
    Stephen and Mike--

    First, thank you very much for trying to help me. My ignorance is definitely NOT bliss!
    Is there any significance to the number seven?
    Stephen, there is no significance of which I am aware. It is simply what I counted.
    Do you have a pulldown resistor on the VDD power lead of the OEM?
    No! But, if you tell me the resistor value to use, I can have one there very quickly. (Vdd-resistor-Vss?)

    I THINK I have attached the BS2p40 code as an attachment (Straight Master.bsp)

    Mike, I will work on the schematic. I believe I can draw one that specifies the power and serial interface and accurately implies the connections to the other Stamps. I'll probably have to use Paint to draw it. (It might be Monday. SHE WHO MUST BE OBEYED rules my weekends.)

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-04-06 00:50
    Stephen and Mike--

    Gee. In drawing the schematic on paper--which turned out to be far easier than I anticipated--I found A problem. It might be THE problem. As you MIGHT remember, I am communicating in a rather unconventional manner. I am using pin to pin (pin-1megaohm-pin) communications to avoid the delays inherent in SERIN/SEROUT. In the beginning, I decided that I required a five bit instruction length to perform all the communications, including 15 speeds forward and 15 speeds reverse, plus a few others, I would need to make the robot perform as desired.

    I quickly learned (experience is a great teacher!) that I did not need all those speeds. In fact, just one or two would work fine. I implemented "half fast" and "slow." Everything worked fine. Ugly Buster did as told. Next, I implemented the optical encoders included in the gearmotors. Of course, there is a BS2-OEM dedicated to each encoder. After I figured out how to use HALF of the quadrature encoders to simply count encoder events, all was still fine and I was feeling good!

    In the meantime, Mike suggested using a Futurlec SSR to place the 12 volt system under BS2p40 (Master) control. What a great idea! It works truly elegantly. (Thank you again, Mike.)

    As I began more and more experimenting, I decided I needed DIFFERENT speeds, not more speeds . . . just different ones. So, since I had already wired and coded for 15 forward and 15 reverse, I started using two different ones. NOW WE GET TO THE PROBLEM I DISCOVERED JUST A FEW MINUTES AGO!

    In drawing the schematic, I discovered that the BS2p40 pin that controls the SSR ALSO is a pin in a group of slave encoder bits. But, how could this be and everything still work perfect? Ha! It was because I had not implemented the BS2-OEM dedicated to the optical encoder that used the pin on the Master which was also common to the SSR.·When I did, that one BS2p40 pin raised the SSR high and raised one of the pins on slave BS2-OEM that was dedicated to watching an encoder high. Later, when the encoder sent its encoder event to the Master using that pin it made it an output pin instead of an input pin. Thank goodness for that 1 megaohm resistor! (What's the abbreviation? I am tired of writing it out!) In any case, no telling what happened to the encoder event counting handler which is the Master's ENTIRE personality at this time.

    Like I said, this IS a problem, but I do not know if it is THE problem. I will know when I move a wire.

    Despite all this, Stephen, I would sure like to know the value of that pulldown resistor and whether it goes between Vdd and Vss.

    I will finish the schematic . . . in its fixed format (as described above) and attach it in a soon-to-be post.

    Thank you for helping me.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-04-06 01:45
    (What's the abbreviation? I am tired of writing it out!)

    megohm --

    [noparse][[/noparse] to make the Omega character: hold down the Alt-key, then type 234, then let go of the Alt-key ]
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-04-06 01:49
    PJ--

    Thanks!

    Do you know the value and position of that pulldown resistor Stephen mentioned, above?

    I am busy using/learning ExpressSCH to draw Ugly Buster's schematic.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • FranklinFranklin Posts: 4,747
    edited 2008-04-06 02:23
    Bill I'm not sure you need one actually. It was a shot at the fact the device was not reseting and possibly the pin was floating rather than turning off. When you get the schematic done it might be obvious if you need something there or not.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-04-06 02:29
    Franklin--

    Thanks for the clarification.

    I am drawing the schematic in ExpressSCH right now. Currently, I am looking for something that might represent an optical encoder.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-04-06 18:37
    Stephen and Mike--

    I have created the first draft (the final one?) of Ugly Buster's brains. It is attached as a jpg. Although I had to invent a couple symbols and adapt a couple more (a BS2-OEM is a 20 pin ribbon cable connector), I believe the schematic looks pretty good . . . but I could be way wrong!

    I am REALLY open to everyone's criticism not only of the schematic logic, but of the schematic itself. What can I or should I do differently? I created it with ExpressSCH.

    I was surprised that the jpg was uploaded from my computer to this web site rather than linked from my web site. Thanks, Parallax!

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
    2040 x 1541 - 233K
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-04-06 23:43
    Stephen and Mike and All--

    Here is a link to the schematic of my robot's logic which shows the Futurlec SSR that Mike suggested--and I promptly implemented--on the correct pin, which is not mistakenly shared on another pin with a different function.

    I provided a link instead of uploading it to the forum because I am not sure of the protocol in using Parallax's disk space.

    Ugly Buster's Brains

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-07 01:14
    Bill,
    The only SSRs that I see on Futurlec's website are for switching AC. They can't be used to switch 12VDC. They can be triggered by 12VDC, but they are designed only for use with an AC load. Here's one from Panasonic that'll switch 4A at 12+VDC. You can get them from DigiKey for $9 each: pewa.panasonic.com/pcsd/product/pmos/pdf_cat/aqz10_.pdf.

    You might be better off just using a power MOSFET (like the IRL510) to switch the ground lead on the motor and driving the gate from the Stamp pin.
    (Don't forget a protective diode across the motor!)
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-04-07 03:35
    Mike--

    Maybe you looked for the wrong part numbers? Take a look here. (Part number SSRDC100V40A.)

    Plus, you might take a glance at the datasheet, as well. I have the version that will handle up to 40 amps at 100 vdc. Additionally, the SSR is clearly marked accordingly.

    You suggested this device and it has always worked perfectly. The problem is not your recommendation or the device itself, it is due to the fact that I have a pin dedicated to signalling a Stamp that also controls the SSR. The last schematic shows the fix . . . the first one did not indicate the problem and the text said the problem was due to the pin being shared between a BS2-OEM dedicated to an encoder and the SSR. In reality, the pin is shared between a BS2-OEM dedicated to gearmotor control and the SSR. This makes it rather obvious that it is the problem. Well, as obvious as it can be without actually testing it! [noparse]:)[/noparse]

    I have changed the wiring--moved the SSR control to BS2p40 pin A15 (X15 in the schematic above)--but have not tested it yet.

    Your opinion is extremely valuable to me despite my seeming confidence that I am correct. (Long, long ago in a land far away, you hellped make my very successful career!)

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-07 03:55
    Bill,
    Thanks for the link. It sure looks like it can do the job! I'm glad you found the problem.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-04-07 04:01
    Mike--

    I am not sure I found THE problem. However, I did find A problem! [noparse]:)[/noparse]

    As usual, your help is very, very much appreciated.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2008-04-07 04:18
    All--

    Here is the schematic.

    Ugly Buster's Brains.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
Sign In or Register to comment.