Shop OBEX P1 Docs P2 Docs Learn Events
Help with motion tracking — Parallax Forums

Help with motion tracking

NosePickerNosePicker Posts: 54
edited 2011-08-13 11:13 in Robotics
I want to create something that will track motion around an area maybe 50' +/- in diameter. I invision having something like a 6 inch diameter by 2 foot long piece of plastic pipe standing/mounted on one end. The pipe would have some type of motion sensors all the way around it near the top. I could store the batteries and circut inside the pipe. Then I want to have a controller receiving feedback from the sensors so that it can control a servo to point a camera at the moving target. The camera would be attached to some type of rod coming out the top end of the pipe. This would be for outdoors. I do not need to worry about fast things such as a car riding by at 50 mph or a baseball being thrown. What I want to track would be someone walking by or pets or something like that. As phase two of the project I will want to be able to tell the camera to wake up and start recording or snap a photo depending on settings so I will need a control that can handle that but for now I just want to see how quickly I could get the motion tracking portion working.
I have no idea what parts would be needed for this project, all I know is I need sensors, a controller, a servo motor but I don't know actual parts. I was hoping someone could give me a list of parts I could buy so I could quickly get this phase of the project up and running. Thanks for any help and/or advice you can give.

Wayne

Comments

  • LeonLeon Posts: 7,620
    edited 2011-08-11 07:53
    Where I used to work we developed this system that could track people over a large area:

    http://www.irisys.co.uk/

    We used a Kalman filter and development took several man-years.
  • NosePickerNosePicker Posts: 54
    edited 2011-08-11 08:06
    Yeah those are some high end devices. I am not looking for anything that accurate. I figure with the wide angle that most cameras have anyhow if I can just sense the general direction of the motion (45 - 90 degrees) and move a servo to that place then it should be pretty painless. At least in my mind this sounds almost rudimentry <- not sure how to spell it but hopefully you understand. My thinking is if I have like 4 - 8 sensors dividing the 360 degree circle then based on the sensor feed back I should know where to face the servo. Of course I know nothing about motion sensors so I don't know if they provide just an on/off type feedback or some type of range that indicates motion distance or speed or what so I am starting blind hoping someone here with experience could just tell me what to get and I can read the white papers to figure how it will all work.
  • alex123alex123 Posts: 102
    edited 2011-08-11 10:53
    That's somewhat similar to the optical mouse. These mice really take "pictures" of the surface and determines which way the mouse is moved. An optical mouse is a much simpler thing because it has its own light source and it can "take pictures" at really high rate. In your case a camera would require a fast processor (e.g. DSP) an image capture capability and a quite sophisticated algorithm to process the data. The other things, like the servo and the controller, are trivial compared to that...

    Another thing you could do is to use a couple of sound sensors on 2 sides of this thing. That's assuming that your target is producing sound. The farther apart the sensors are the better. You could compare the intesity of the signal from both microphones and decide which way to turn. You'd keep trunning until the signals are at the same level. That would require some nice processing as well but that wouldn't be as complex as the image capture. More sensors would be required if you need 2D tracking.
  • LeonLeon Posts: 7,620
    edited 2011-08-11 10:58
    That was how we did it at Irisys. I used a 30 MIPS 16-bit Analog Devices DSP and a lot of assembler code for the tracking algorithm. The current system uses a 500 MIPS Blackfin chip and the code is written in C.
  • alex123alex123 Posts: 102
    edited 2011-08-11 11:23
    That must have been a fun project! It seems like we don't do these fun things here in US anymore...
    Talking about DSPs and MIPS... I used TI DSPs in the past. The VLIW architecture? OMG! The peak MIPS on these puppies with 1GHz clock is 8000MIPS (8GIPS?)...
  • LeonLeon Posts: 7,620
    edited 2011-08-11 11:33
    We had another system that drove a video camera via a couple of servos, something like Wayne wants to do. As it used the same IR sensor array, if one was standing a couple of feet from it the camera ended up pointing at one's groin area.
  • NosePickerNosePicker Posts: 54
    edited 2011-08-11 11:40
    OK I was hoping I could actually get someone to answer my question as to the parts needed. As I mentioned in my original email the "working of the camera" is phase 2 and actually it is something I have already done in the past so that is why I am not asking questions about that. All I really need help with is what you referred to as
    The other things, like the servo and the controller, are trivial compared to that...
    I figured this would be trivial for someone who has done this before but I have not, which is why I was hoping rather than me starting from ground zero someone would be kind enough to tell me exactly what to buy to accomplish the task, just the sensors, controller and how to turn a servo motor.

    While here I may as well add I am thinking I would like a sensor that has a fairly narrow field of view. This would allow me to have more sensors and thus better at pin-pointing the direction. Also is the motor part really a servo motor or is that what would be called a stepper motor or are they one in the same?

    Oh yeah and I don't want to use sound sensors... I really need to use motion sensors which I understand really detects a change in tempurture but none the less not sound.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-08-11 11:43
    Another option would be to use Hanno's video capture method with the Prop. You should be able to extract motion information from the data from the ADC.

    I have a project using Hanno's method myself. (It's on hold for a bit.)

    Duane
  • LeonLeon Posts: 7,620
    edited 2011-08-11 11:59
    Servo and stepper motors are completely different.
  • NosePickerNosePicker Posts: 54
    edited 2011-08-11 12:05
    OK maybe I should simplifiy my question....
    Can someone help me quickly build a circuit where I have a motion sensor and if someone walks by I turn on an LED?
    Thats it .... thats all... nothing more,,, nothing less....
    I need to know what part number(s) the sensor is (possibly how to determine the "field of view" for different sensors) and what would be the easiest way to get a prototype circuit for the controller as far as power regulation, etc... some type of starter board?
    I am capable of writting code in C or Basic but not Assembler.

    Then the next question would be... using the same circut from above instead of having the controller turn on an LED when someone walks by I want to turn a servo/stepper motor to point 180 degrees different than it is currently pointing. then the next time someone walks by it will turn back 180 degrees to where it was the first time.
    Again, I need to know a part number for the motor and any reference to how to build the circuit and code sample to move the motor.
  • PublisonPublison Posts: 12,366
    edited 2011-08-11 12:26
    NosePicker wrote: »
    OK maybe I should simplifiy my question....
    Can someone help me quickly build a circuit where I have a motion sensor and if someone walks by I turn on an LED?

    http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/PIR/List/0/SortField/4/ProductID/83/Default.aspx

    http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/Motion/List/0/SortField/4/ProductID/606/Default.aspx
  • alex123alex123 Posts: 102
    edited 2011-08-11 12:28
    NosePicker,

    Servo? You have to size the servo based on the size/weight of the thing control. I would make a model first with just reqular $10 RC servos. The servos are usually controlled with PWM. You can find many examples on how to generate the 1.5ms +/- 0.5ms pulses to control servo movements... I said 'trivial' because you have to firgure out the motion sensor first which will be the hardest part...
  • alex123alex123 Posts: 102
    edited 2011-08-11 12:39
    I looked at these sensors Publison found. I wonder what will happend when two (or more) are close to each other and point in the same direction? Both sensors' IR light would interfere... A similar thing would happen with the RF sensor...
  • PublisonPublison Posts: 12,366
    edited 2011-08-11 13:23
    alex123 wrote: »
    I looked at these sensors Publison found. I wonder what will happend when two (or more) are close to each other and point in the same direction? Both sensors' IR light would interfere

    Good question. I usually put the PIR at the back end of a PVC tube (3"-5") to narrow the field of view. I have been known to use paper towel tubes, painted back, for indoor applications.

    But I think what the OP wants is to look at OpenCV

    That would let you track shapes, blobs, or colors. Not going to be done on a Propeller though.
  • ercoerco Posts: 20,256
    edited 2011-08-11 15:26
    OpenCV or RoboRealm can track colors & blobs, too.

    I wonder if you had several non-contact IR thermometer guns (like http://www.harborfreight.com/infrared-thermometer-93984.html ) and made a moving array, could pick out and track a 98-degree human against a cooler background?

    Alternatively, you could have multiple PING sensors in an array. For use in a fixed environment, you could either have a dozen fixed PINGs facing outward radially, or maybe 3 PINGs on a turntable, indexed to a dozen locations 30 degrees apart. You could map & store the empty environment distance measurements, then compare those to live values to track a target big enough to be detected.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-11 16:03
    The PIR some people have already mentioned can sometimes be found at Radio Shack. You can check your local store and maybe pick one up if you are in a big hurry.

    http://www.radioshack.com/product/index.jsp?productId=2906724

    NosePicker wrote: »
    ...when someone walks by I want to turn a servo/stepper motor to point 180 degrees different than it is currently pointing. then the next time someone walks by it will turn back 180 degrees to where it was the first time.....

    I don't understand what you are accomplishing with that motion. Do you want something to just track a moving object so you can take photos of it, or.... what's with the 180 degree movement? to store the camera? keep it hidden?
  • alex123alex123 Posts: 102
    edited 2011-08-11 16:06
    I agree with erco. An array of PING)))'s may work for your project. You can actually trigger eash device in a round robin fashion. No interference in this case. The PING is really sensitive to the measurement direction so a dynamic maping of the environment could be required as erco pointed out.
    The only real issue is the maximum distance it can measure. According to the DS the limit is about 10 ft.
  • HughHugh Posts: 362
    edited 2011-08-12 00:02
    Those PIR sensors only have one sensing element - the detection of 'motion' comes from the filter on the front face which chop the 'view' of the sensor into different segments. A moving object triggers a couple of these segments and the sensor sees multiple pulses. Insulating tape is a good screening material with which to adjust the view of the sensor. Similar sensors for burglar alarms are available with different filter patterns (e.g., for wide rooms, looking down corridors or to include a 'pet tunnel')

    You might want to think about what happens if you detect more than one moving object in the field of view - does it track the first one, the second, or try and do both and burn-out!
  • alex123alex123 Posts: 102
    edited 2011-08-13 08:36
    I like the idea to use the PIR sensors. No wave (electromagnetic, light or sound) to generate so no interference from multiple sensors.

    The filter in front of the PIR sensor is called a Fresnel lens. That's usually there to make the motion detection angle really wide. Replacing it with a regular lens will drastically reduce this angle and that's what you want. Some experimenting will be required though with the lens placement.
    Just my $0.02
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-08-13 10:29
    I've read from several sources PIR sensors don't work well outdoors. I believe the changing sunlight causes false triggers.

    Duane
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-13 11:13
    Duane Degn wrote: »
    I've read from several sources PIR sensors don't work well outdoors. I believe the changing sunlight causes false triggers.

    Duane

    Yes, when sunlight flickers through the leaves of trees, for example, it can sometimes set them off. So can distant heat sources, like campfires, etc. playing off the rippling of water.
Sign In or Register to comment.