Shop OBEX P1 Docs P2 Docs Learn Events
CMUCam2 w/Propeller and motor control — Parallax Forums

CMUCam2 w/Propeller and motor control

Thomas RippyThomas Rippy Posts: 2
edited 2007-03-22 19:36 in Propeller 1
I have a desire to utilize the capability within the CMUCam2 for motion tracking. If anyone is not familiar w/the CMUCam2 it is a very straight forward device that can easily control servo motors for pan/tilt operation. Unfortunately my project requires much higher torque than a servo motor can provide. I currently have the Propeller (which is awesome) controlling a powerful actuator and stepper motor. To make motion tracking easy I figured I could make use of the CMUCam2 servo outputs to tell the Propeller pan/tilt positioning. I'm having difficulties interpreting the output signal from the CMUCam2 and turning it over to my actuator and stepper motor controllers. Currently I am attempting to feed the PWM signal through a 1K resistor (CMUCam2 is a 5V system). Right now I am unable to even verify the timing/frequency of the signal fed into the Propeller let alone transitions to trigger a change in direction. Is this approach feasible? Should I just use the TTL output on the CMUCam2 instead of the direct PWM signal? Should I forget about the CMUCam2 abilities and only use the 6620 camera module directly controlled by the Propeller? Is anyone working w/the Propeller and motion tracking? Any advice is greatly appreciated.

Comments

  • T ChapT Chap Posts: 4,223
    edited 2007-03-22 17:37
    You are trying to translate the two different servo PWM signals into two separate Step and Dir outputs? Sounds feasable, have you already written some code that is giving you the problem?

    It is assumed you have the two PWM signals going connected to two pins(verified by a scope) on the Prop via 1k's, and the stepper driver controls already working. If you post your code for the translation maybe someone will notice something to help solve it.

    Are you translating the duty to positional information, i.e. duty 20 = a scaled position of 2000?

    Post Edited (originator) : 3/22/2007 5:57:23 PM GMT
  • simonlsimonl Posts: 866
    edited 2007-03-22 17:53
    AFAIK the CMUCam2 outputs standard R/C servo pulses; these range from 1ms to 2ms, with 1.5ms being servo centre. It would be relatively simple to have one COGs counters read those pulse-widths (I'd suggest you look at the MEMSIC accelerometer object for ideas) and then have the cog interpret them to give you the stepper outputs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon

    BTW: I type as I'm thinking, so please don't take any offense at my writing style smile.gif

    www.norfolkhelicopterclub.co.uk
    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
  • T ChapT Chap Posts: 4,223
    edited 2007-03-22 18:32
    Would Spin be fast enough to do the following semi-accurately?

    
    CTRA :=%01000
    
    PUB GetDuty 
      Repeat
        FREQA := 100    'multiplier to get position value
        Waitpne (%1, %1, 0)
        PHSA := 0
        Waitpne (%0, %1, 0)
        steps := PHSA - currentPosition      'move motor these number of steps   
    
    




    **This doesn't account for duty = 0

    Post Edited (originator) : 3/22/2007 8:12:10 PM GMT
  • Thomas RippyThomas Rippy Posts: 2
    edited 2007-03-22 19:36
    Very easy and very embarrassing fix...... I didn't set the clock speed correctly at the beginning of my code to match my conversion. My associated timing variables were wrong. Thanks for the quick replies.
Sign In or Register to comment.