Semi-autonomous shopping cart - need help

Discussion in 'The Projects Forum' started by sharkfire, Feb 24, 2008.

  1. sharkfire

    Thread Starter Member

    Feb 13, 2008
    23
    0
    Our project is a semi-autonomous shopping cart that will just follow it's user while shopping in a supermarket. We limit it to be used by senior citizens only since that some of them find it hard to carry shopping baskets or push a loaded shopping cart.

    Our prototype is almost done. Our problem now is the circuits and the programming. We chose PIC16f84 as the micro controller and assembly language for programming.


    Here are the modules that we proposed to use:

    1. Transmitter and Receiver
    A transmitter will be attached at the back of the user. We used IR LEDs. Thiswill transmit IR pulses that will receive by the receiver. We used the photo diode this time (I'm uncertain if photo diode is the right name for that part. But we made a circuit for the receiver and it's working). Do you think this is advisable? Currently, we used about 40 IR LEDs for the transmitter alone, arranged in a curve so that the receiver will still receive IR pulses even when the user turn right or left (Imagine how you pick goods from the shelves and put it inside the cart). It's quite bulky for a transmitter. Do you know how wide can an IR LED transmit IR pulses? I'm really not good in finding data sheets. Or do you have a better suggestion on what transmitter-receiver module should we use. Some parts may not be available here in Philippines.

    2. Controlling Direction
    We're about to use the Futaba Servo s3003 for controlling the direction since it only turn 180 degrees. But the problem is that it's not that powerful. So we used the DC motor since it has a high torque (I'm confused what torque is). It turns 360 Degrees. Can you help me how to program this using PIC16f84 and using assembly language? What should I use, DELAY of the WatchDog Timer?

    3. Acceleration
    We also used a DC Motor. It's working somehow when connected directly to the battery. (I forgot what battery is that. I'll update this later).

    I'm really not good at circuits. Any help you would give is highly appreciated.
     
  2. scubasteve_911

    Senior Member

    Dec 27, 2007
    1,202
    1
    I'm not a big fan of your method to detect the user.. At the very least, you should be modulating these in order to positively detect the user. 40 IR leds is excessive! That's probably about 1.5W continuous power consumption, which means that you will have to use bigger batteries than necessary.

    Two ideas come to mind for this application. First, you can get the user to wear a reflector on their back. Then, you can send light from the cart and recieve it. This will eliminate the need for the user to wear the pack and will consolidate your battery needs. A much more elegant and less embarrassing solution (not wearing a big reflector or a massive array of LEDS) is to use a small image sensor. The user would wear a particular shape that you can read on the sensor. So, if shape gets bigger, then it means the person is close, if shape gets skewed, then the user is turning.

    You may need to get a more powerful servo, or a DC gear motor. Torque is "torque (τ) is a vector that measures the tendency of a force to rotate an object about some axis "

    You need to apply servo control pulses. I believe null position is 1.5mS and reverse is ~1mS and forward 2mS. Basically, you give it around 60-90 pulses per second, with the widths that determine desired servo position. (don't quote me on these specs, I'm working from memory)

    You should really learn about the basic physics involved. In order to determine dynamic properties of the cart, you need to make a dynamic model for it. This takes a bit of math know-how, but there should be examples somewhere if you search.

    Steve
     
  3. sharkfire

    Thread Starter Member

    Feb 13, 2008
    23
    0
    Thanks for the reply. It's very informative.

    I'll just search more about image sensor and I'll ask you again for suggestions.

    Do you know how to program the DC motor using assembly language? Should I use delays or the watchdog timer?
     
  4. mrmeval

    Distinguished Member

    Jun 30, 2006
    833
    2
    Just put a go switch on it like a lawn mower. One on the right and one on the left, squeeze both and it goes forward, with left or right alone controlling turns.
     
  5. scubasteve_911

    Senior Member

    Dec 27, 2007
    1,202
    1
    I advise against using simple on/off control for the cart, it will give you poor control. You really should be using a PI or PID control for the cart, which can be done quite easily with a microcontroller such as the PIC. You may need to use one with more power, especially if you want a decent response and are using an image sensor.

    http://classshares.student.usp.ac.fj/en433/Resources/PID on PIC.pdf

    You should be able to get away with using a lower resolution black and white cmos image sensor. Maybe something along the lines of the following link.

    http://rocky.digikey.com/weblib/Kodak/Web Data/KAC-9618LongSpec[1].pdf

    But, the issue is, now you need to find a suitable lens that will give you the field of view you are looking for.

    All of this really depends on how well you want this thing to work, how hard you are willing to work on it, and if it is meant for production. Obviously, if you want to go production on this, then you need to minimize costs. The image sensor route should give you a high performance system, but will cost a lot more than some infrared emitters and photodetectors.

    For controlling a DC motor, you need to ask yourself a couple of questions. Do you need it to reverse or just go forwards? If you want it to reverse, then you need a bridge configuration. You can use a linear bridge or an h-bridge of FETs. Since it is battery operated, then using an h-bridge is much smarter since it is more efficient. You can control the h-bridge in two common ways:bipolar or unipolar. Bipolar control is simpler, but it has more harmonic content, which isn't an issue in your circumstance. I would stick to basic bipolar (pwm and direction) control.

    Definitely stick to using servos for controlling the direction and DC motors for the forward/reverse power. Using a differential arrangement would be very awkward for the cart and it will scuff up the floors!

    Good luck!

    Steve
     
  6. kender

    Senior Member

    Jan 17, 2007
    263
    0
    This is a bad choice that is likely to cause a failure of your project. Switch to C or some other high level language. Your device will have a fairly complex behavior, which will require a lot of code and a lot of changes to it. Assembly is unreasonably hard to maintain and debug. Besides, the industry avoids using assembly at all cost. To quote my mentor: "If somebody working for you writes in assembly, fire him to keep your own job."
     
  7. scubasteve_911

    Senior Member

    Dec 27, 2007
    1,202
    1
    I partially agree with Kender, for something as high level as this, avoid low-level programming.

    I do not think it will cause problems in your actual implementation, it will just cause you to take a really long and frustrating time finishing the project. I have done many programs in assembly, which gives you complete understanding of what is happening, which is a really good thing:) But, it doesn't feel good knowing that your two pages of code could have been made with four lines of C.

    Assembly does lend itself to routines that must be executed with high speed, which you can call from C. Sometimes this is important, especially during interrupt routines and time critical events.

    Steve
     
  8. thingmaker3

    Retired Moderator

    May 16, 2005
    5,072
    6
    How will you keep this thing from running over grandma? What is your method for judging distance to the user?

    Viewing angles for LEDs can be as little as 15 degrees or as much as 150 degrees. Depends on the LED. If the value is not in the data-sheet, try experimenting with your photodiode, a protractor, and the LEDs you have.
     
  9. RiJoRI

    Well-Known Member

    Aug 15, 2007
    536
    26
    Avoid using the watchdog timer for anything but stopping runaway code. Most modern micros have (non-watchdog) timers in them -- use those.

    Also, remember that the cart will move more slowly as it gets filled up, and be harder to slow down -- due to inertia.

    Here in the U.S., we have small electric scooters with (small!) baskets in the front for use by those who find it hard to walk around (handicapped or elderly).

    Incidentally, have you asked the customers what their preference (following cart, motorized cart, scooter) is?

    --Rich
     
  10. HarveyH42

    Active Member

    Jul 22, 2007
    425
    5
    What would happen if there are two of these carts in close proximity? Would the infrared signals get a little confused? What about all the bright white and metallic surfaces common to most stores, would reflections be a problem?

    Considering the sorts of people I general see using the motorized carts at Walmart (should require some sort of training, and testing), I would think if they walked a little more, pushing the cart, they most likely wouldn't have need of them (get some exercise people). Electric scootors for the elderly and handicapped aren't that expensive with insurance anymore. Most people can get one with their doctor's help pretty easy these days. The Walmart carts are mostly toys for the lazy.

    Remember seeing some robot projects on the web past couple of years, that might be of some help. On was sort of like a dog on wheels, and just follow. The most recent was something following the owner around with his beer, so he wouldn't set it down and not find it later...

    To make things easier...
    Why not make the cart motorized, but the shopper still needs to have hands on to control it. Let go, it stops. Bump sensors to protect the operator, other shoppers, and merchandise.

    The cheapest/simplest...
    Larger diameter wheels would give a greater mechanical advantage. Push/pull more weight, with less effort.
     
  11. sharkfire

    Thread Starter Member

    Feb 13, 2008
    23
    0
    Sorry if I haven't been online the past week. I've been busy in my schoolworks and my OJT.

    This is only a project, and this is not intended for production. Our project is a machine that will follow the user. We used the cart as the prototype for feasibility purposes.

    We changed the transmitter and we're not using 40 IR LEDs anymore. The final outcome of the transmitter is still on process.

    I'll update this later...

    THanks for all the help..
     
  12. Octavian01

    New Member

    Mar 1, 2008
    6
    0
    :cool:I like this Idea Very much, Most times simple is best. I really like the idea of push buttons on a Shopping cart, Anyone with two brain cells can opperate it with out much instruction. Plus you don't have to program anything, simpliy a few motors like on on each side to rotate independently like a tanks tracks, or a steering servo and a low speed drive motor to get it going forward and back. I mean i was reading the description of the project and thinking about the image recognition / IR sensor array, and i was thinking What if Little old Martha turns at the end of an isle and the cart hasn't caught up with her yet... it could respond to seeing her turn, and it tries so hard to keep up that it turns prematurely right into the soup can pyramid stacked on the end cap...
     
  13. sharkfire

    Thread Starter Member

    Feb 13, 2008
    23
    0
    We're planning to have two sets of receivers. The first receiver will set the direction either left, right or forward. The other one will set the minimum range.

    We set a minimum distance from the cart and the user and that's about one foot. If any of the Receiver (photodiode) for the minimum range is high, it will cause the motor for acceleration to stop, and if it's low, that's the time the cart will accelerate.

    We have limited resources available here in our locale that's why we're just utilizing what's available.
     
  14. sharkfire

    Thread Starter Member

    Feb 13, 2008
    23
    0
    That's our problem that we're solving and that's what the panelists asked us.

    Our plan is to solve this through our program. Example, there are 5 receivers. If the receiver at the center is receiving the IR pulses, it will only enable the 2 receivers adjacent to it, which is the 2nd and 4th receiver. The first and 5th receiver will be disabled. The minimum distance of 1 foot from the cart and the user is also set so that no other users can intercept between the cart and its original user?

    Any advice?
     
  15. HarveyH42

    Active Member

    Jul 22, 2007
    425
    5
    The emitter pointed directly at the detector, will have a much greater range, then the reflected signal. Different materials refelect a wide range, some distort, some even transparent. Infrared is a very bad choice for this. I like the low-res camera idea. In software you could measure the features of pattern worn by the shopper. You could estimate distance, direction, movement from the image. There are plenty of old webcams or keychain cameras under $10.
     
  16. sharkfire

    Thread Starter Member

    Feb 13, 2008
    23
    0
    Thanks, I'll check if that is available here.
     
Loading...