Shop OBEX P1 Docs P2 Docs Learn Events
Stall Sensors anyone? — Parallax Forums

Stall Sensors anyone?

ElectroHackElectroHack Posts: 13
edited 2008-12-06 08:46 in General Discussion
Has anyone every on this board implemented a stall sensor on a robot before?·I'm still kinda new to this and I'm looking for some ideas.

Thanks
PC

·

Comments

  • SRLMSRLM Posts: 5,045
    edited 2008-12-06 02:47
    What sort of stall are you thinking of? A motor stall, a motion stall (like in an airplane), something else? For the motor stall, you can just use encoders on the wheels. If the encoders aren't reading any motion, but you are pumping the gas to the motor, then you can infer that it has stalled.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-12-06 02:52
    PC -

    What you want to do is to measure the current. The STALL CURRENT will be the ABSOLUTE HIGHEST CURRENT THAT YOU WILL SENSE. I suppose you will need some sort of peak detector, but I'm out of my league here, since I'm primarily a software guy.
    You MAY be able to measure the voltage drop across a resistor, as an alternative to the peak detector.

    From a programming point of view, if you have a digital signal, you're usually good to go. If you end up with an analog signal, you MAY be able to use the RCTIME instruction, or possibly you MAY need to implement an analog to digital converter (ADC) to process that analog signal.

    I suspect one of the analog circuitry guys will chime in on this message.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.
  • T ChapT Chap Posts: 4,223
    edited 2008-12-06 04:20
    There is a chip I really like for monitoring current, AD628. It has programmable gain and an output reference input so that you can simultaneously amplify the difference (across a sense resistor, I always use 1.2ohm 3W in most cases), plus set the output to fit within your voltage range where you are sending it to be used.

    The typical solution is to read across the sense resister on the power input of the board or motor being powered. The higher the current, the higher the voltage across the resister. Take the output of the chip and run it to a comparator, also send the comparator a reference voltage to know when to trip. If the comparator doesn't already have a Schmitt trigger output (most don't), then I'd advise using a gate with a fixed trip point(4049, 4050 etc) to clean up the comparator output.

    You measure with a meter the typical output of the AD628 while not stalled, and set the ref input to the comparator just above the max current in normal use. To test, just grab the motor and try to stop it, see the voltage increase on the meter, when the voltage hits the reference you set with a trim pot, an output on the comparator occurs, which is connected to the processor. Make the code respond accordingly.

    Shown below is a circuit I am using on a motor driver board (27volts powers the board) which works very nicely. The output ranges from 1.5 volts with no motion to 3.3V, a stall is somewhere around 2.5 volts on this board. You will need to tweak the values for gain, plus adjust the ref output to suit your needs for the output.

    There is not enough information about your robot to offer suggestions for non-current monitoring ideas. The alternatives include using some device to determine motion, like an optical encoder on the motor, or a small magnet placed on a moving part of the robot (motor shaft in non-servo), with ahall sensor near where the magnet passes by. The hall sensor output when a magnet is near it.

    More information about your project will get more specific answers.

    search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=AD628AR-ND

    Post Edited (TChapman) : 12/6/2008 9:31:36 AM GMT
    485 x 296 - 8K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-06 04:46
    I wish I could say that motor current, in and of itself, is a reliable indicator of stall; but some recent experience (which I cannot detail here) has shown that not to be the case. The problem is where to set the threshold. A "stall" current in one situation may be equal to a "working hard but still moving" current in another. And running the motors from an unregulated supply (e.g. batteries) compounds the problem further still, requiring an additional reading of the motor's voltage in order to obtain its power consumption. Even wheel encoders have their limitations, since a bot may be stalled (in the sense that it's not moving) even though its wheels are still turning — i.e. slipping. I've seen all of these situations. Combining both approaches with, perhaps, an accelerometer to detect both lateral acceleration (e.g. speed ups, slow downs, bumps, etc.) and tilt (e.g. "I'm going uphill, so the extra motor current and slow wheel rotation speed are okay.") This is an exercise in what's called "sensor fusion", which means combining data intellegently from several sensors in order to make correct infererences about your internal or external environment.

    So where to start? I'd be most inclined to begin with wheel encoders and expand from there as the need arises.

    -Phil
  • SRLMSRLM Posts: 5,045
    edited 2008-12-06 05:44
    I was thinking about a movement sensor idea. I guess this is as good a spot as any to post my thoughts.

    This sensor would determine the speed that a robot is moving along a line: forward or backward, in effect. It is composed of two or more (three most likely) QTI sensors or color sensors. These are mounted in a row on the forward-backward axis of the robot, pointing down. As the robot moves, it passes over terrain of differerent colors, some of which are very drastic (such as a line in concrete). The first sensor to pass over the line records a value (or we could involve some simple calculus here: the slope change over time) and stores it, and passes it on to the next. The next records how long it takes before it sees the same pattern. The distance between the sensors over the time taken to get the identical readings is the speed of the robot.

    attachment.php?attachmentid=57149

    Naturally, this method requires ground that has fairly sharp contrasts in color, and like other sensors should probably be fused. Yet, a reading would probably be very reliable due to the fact that the factors that affect readings are very small (namely color). Vibration, wheel slip, speed, and motor current don't matter at all.
    450 x 450 - 12K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-06 06:59
    Nice idea. Something very similar is the principle used for optical computer mice.

    -Phil
  • SRLMSRLM Posts: 5,045
    edited 2008-12-06 07:09
    Now that you mention it, that reminds me of a related post in the DIY Drones forums. Perhaps that was a subconscious prompt for what I had... Anyway, on the forum, it was mentioned off hand that some people had modified a certain mouse so that it gave ground speed from the airplane. My guess was that they made a new lens for it, but I don't know.

    A hacked mouse might be good for this project (or a speed sensor in general). I think the hardest part would be getting the range up to a couple of inches. Once that happens, if would be a simple matter to interface it to the propeller as a regular mouse object, and read the motion. Some limitations present themselves (that I can think of), the main one being that the mouse has a maximum speed to scroll at. So it's not perfect, but perhaps worth a try...
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-12-06 08:46
    Optical rodents are almost "cheap as dirt" these day at most electronics surplus houses. Last one I purchased was under $10.00. There was shipping, but I bought it with a larger order, so the shipping charges were apportioned over a large number of items.

    I'd look to one of the surplus lens houses. The name of the one most often mentioned is a division of Edmund Scientific. Here is a link to Anchor Optics's web site: http://www.anchoroptics.com/

    These folks sell seconds for experimenters. You will probably find almost any lens you can imagine, and at reasonable prices.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.
Sign In or Register to comment.