Shop OBEX P1 Docs P2 Docs Learn Events
Dirrs giving old readings even i am taking new — Parallax Forums

Dirrs giving old readings even i am taking new

SandhuamarinderSandhuamarinder Posts: 85
edited 2010-04-29 09:48 in Learn with BlocklyProp
Hi
I am using servo on boe bot front which moves and have a DIRRS on it. DIRRS sensor takes new distance reading and servo again move. And new reading problem which is coming is that. DIRRS is giving the old reading which are already taken before. What is happening that servo with DIRRS on moves to the right side and i put my hand. Ok then servo moves to middle and suppose to make new reading. What is happening is that its is giving the reading with my hand detected in it.
Why this is happening i had attached my program. How i can fix that help plz.

Comments

  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2010-04-19 11:45
    Can you post a link to the ·servo that has the DIRRS sensor on it

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·Now wanting to learn Spin· Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam
  • SandhuamarinderSandhuamarinder Posts: 85
    edited 2010-04-19 19:40
    Man there is no servo which have a DIRRS on it. I had modified it. Bcoz i have only 3 DIRRS out of which only 1 is working so i have to use servo to make DIRRS move to 3 different directions left,right and middle and it gets the reading. I had attached the DIRRS on the wings of a servo with a solid wire. I will make the video soon and will post the youtube link over here.
  • hover1hover1 Posts: 1,929
    edited 2010-04-19 22:23
    Can you post a link to the DIRRS sensor since it doesn't sound like a Parallax product.

    And please use better grammar and spelling. It's hard to follow what you are asking for.
  • SandhuamarinderSandhuamarinder Posts: 85
    edited 2010-04-19 22:38
    Sorry about my grammer.
    I had posted the link.
    Its the product from HVWtech i think

    http://www.solarbotics.com/assets/datasheets/dirrs.pdf
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2010-04-19 23:29
    You need to understand how this code work first
    before try to do any thing else

    Also here is a link where there are more examples
    http://www.hvwtech.com/products_resources.asp?CatID=0&SubCatID=0&SubSubCatID=0&ProductID=91
     '{$STAMP BS2}
    '********************************************
    'HVW TECHNOLOGIES INC.
    'DIRRS Plus demo software version 1.0
    'Date: March 2000
    'Author: Dan Henne
    'www.HVWTech.com
    '********************************************
    '
    '********************************************
    'This software is used with the DIRRS Plus when it is configured
    'for Original DIRRS mode. The input from the DIRRS Plus is
    'triggered by a high low transition with the resulting
    'distance measurement shifted into the DIST variable.
    '********************************************
    
    DIST  VAR  Byte  'Variable used to store DIRRS result
    T  VAR  Byte
    clock  CON  1
    datain  CON  0
      OUTPUT clock  'Pin 0 connects to Pin 2 of DIRRS Plus
      INPUT datain    'Pin 1 connects to Pin 4 of DIRRS Plus
    START:
      HIGH clock    'Start Vin must have high-low transition
      PAUSE 3    'Wait for high to be recognized
      LOW clock
      FOR T= 1 TO 30  'Begin 30 ms wait
      PAUSE 1
      IF IN0=1 THEN JUMP
          'If Vout is HIGH, measurement is complete -jump
      NEXT    'Measurement not complete, wait another 1 ms
    JUMP:
      SHIFTIN datain,clock,2,[noparse][[/noparse]DIST\8]
          'Shift 8 bits into DIST via pin P1, clocking with P0, MSB first
      DEBUG "Distance= ", DEC DIST,CR
          'Display distance (in decimal form) in debug window
      GOTO START  'Start over
    


    I hope this helps

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·Now wanting to learn Spin· Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam
  • SandhuamarinderSandhuamarinder Posts: 85
    edited 2010-04-20 00:16
    I know how this works thats why i am playing with it.

    While playing with it i am getting problem. Thats why i came here.
    1200 x 1200 - 93K
    1200 x 1200 - 82K
    1200 x 1200 - 96K
    1200 x 1200 - 67K
    1200 x 1200 - 98K
    2.jpg 92.6K
    1.jpg 82.2K
    3.jpg 95.6K
    4.jpg 67.3K
    5.jpg 98.5K
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2010-04-20 01:10
    Have you used there demo and where it has JUMP routine add the servo routine· just an idea.gif

    Now as far Dist2 and Dist3 routines that is going another story

    You might want to try this if different routines

    ·SHIFTIN datain,clock,2,[noparse][[/noparse]DIST2\8]·
    ·SHIFTIN datain,clock,2,[noparse][[/noparse]DIST3\8]·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·Now wanting to learn Spin· Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 4/20/2010 1:22:16 AM GMT
  • SandhuamarinderSandhuamarinder Posts: 85
    edited 2010-04-20 01:41
    why i am using dist1/8, dist2/8, dist3/8
    I am just doing that bcoz it is debuging old values when servo moves and its is suppose to take new readings.
    To make that simple i just did that to remove that dout.
    I think i got the problem.
    I think debug is the problem which is making delay in the process.
    And in that much time servo is already at other place. So i will try removing the debug. And see what happens. I will post the results.

    Ok sam i will also try that what u are saying.
    But i dont think that will solve the problem.
  • FranklinFranklin Posts: 4,747
    edited 2010-04-20 03:51
    Where are the wires from the sensor connected to the stamp? Vin and Vout?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • SandhuamarinderSandhuamarinder Posts: 85
    edited 2010-04-20 07:10
    Vin and Vout are the wires which goes to stamp.
    DIRRS have 4 wires One 5 v and other ground. Other 2 Vin and Vout goes to stamp.

    Vin is the output pin of microcontroller
    Vout is the input pin of microcontroller

    Vin to 0
    Vout to 1

    Post Edited (Sandhuamarinder) : 4/20/2010 7:15:51 AM GMT
    1200 x 1200 - 89K
  • SandhuamarinderSandhuamarinder Posts: 85
    edited 2010-04-29 09:48
    Guys problem is solved i just switched stuff around and it worked great.

    Thanks for the help though.

    Guess what i am the only one who finished the boe bot race. Boom i got the bonus marks.
Sign In or Register to comment.