1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Differential IR height sensor, Attemptin' Clone....ain't sure of success...now stage 10

Discussion in 'Mods and Upgrades' started by jim3Dbot, Aug 25, 2015.

  1. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Jim, I also gave up on 1.0.2, since it was orphaned by the developers quite a while ago, that is why that thread morphed into a 1.1.0 thread. There is no effort being put into any issues involving 1.0.0, and there are many bugs. It is almost as if the developers of Marlin want to distance themselves from anything prior to the current project. A lot of things in the reprap g-code wiki are only supported by 1.1.0. Unfortunately the wiki many times do not include version information, just firmware variants.
     
  2. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124
    Some good news..........I'll be shipping 5 mini's out Monday mornin'.................

    015.JPG


    There will be a straight 3 pin header installed, not shown in picture. Let me know before Monday if you are soldering wires directly in board. Tomorrow, I'll post what I did to intergrate this sensor to the mostly stock Robo R1. The 9 degree 1/2 angle IR LEDs tested very well. I ran G29 commands and Long-handed the z deviation............the results with 10 auto-levels were recorded.....I'll post those tomorrow......and plug them into the 'standard deviation' formula via what-else a cheapo calculator & 'sum' math.......Take care
     
  3. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    "I love it when a plan comes together."

    (sorry, I have no cigar)
     
  4. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124
    Here's some pointers first, remembering, I make mistakes...........so lets fix'em together to make this post accurate..........

    1. The mini-ir only comes into play during Z homing and 'Autolevel' only.

    2. The visible LED, illuminates when the mini 'sees' the bed, variables include, but probably not limited to:

    a. the height you mount it from the bed.......................................... You have control.
    b. the assembly of the IR emitters & photoXsistor.................limited control....twist & bend the sensors on the PCB.
    c. clean the bed prior to leveling...................................the 'snozzle' doesn't touch the surface and squash the living hell out of
    the boogers left behind.....the mini measures the distance to them.



    Standard Deviation formula, I used for calculating Z repeat-ability for ten G29 autolevel commands, the frickin' M48 'no works'..........

    standard-deviation-formula.gif

    Okay............the ten G29 command Z numbers are: three point probing in nine locations

    autolevel bed position

    1 2 3 4 5 6 7 8 9

    G29 (1) -.20, .06, .38, .00, .29, -.73, -.26, .24, .26
    G29 (2) -.20, .08, .41, .01, .31, -.70, -.24, .25, .28
    G29 (3) -.20, .08, .38, .00, .30, -.70, -.24, .26, .27
    G29 (4) -.20, .06, .39, -.03, .30, -.69, -.25, .25, .27
    G29 (5) -.19, .08, .37, .00, .30, -.69, -.24, .26, .28
    G29 (6) -.20, .07, .39, .01, .30, -.74, -.24, .25, .27
    G29 (7) -.21, .07, .41, .00, .31, -.73, -.24, .25, .26
    G29 (8) -.19, .07, .40, .00, .31, -.73, -.25, .25, .28
    G29 (9) -.18, .09, .41, .02, .32, -.72, -.24, .26, .28
    G29 (10) -.20, .07, .40, -.01, .34, -.72, -.24, .26, .27

    solve for u (the mean) obtained by the sum of each position divided by 10

    Lets do position 5, read vertically, the center of the bed......where my small prints, ahhh errr print.

    u = 3.08/10 or 0.308

    next subtract the ten Z heights from the means u then square the result.

    0.29 - 0.308 = -0.018, then square = 0.000324
    0.31 - 0.308 = +0.002, then square = 0.000004
    0.30 - 0.308 = -0.008, then square = 0.000064
    0.30 - 0.308 = -0.008, then square = 0.000064
    0.30 - 0.308 = -0.008, then square = 0.000064
    0.30 - 0.308 = -0.008, then square = 0.000064
    0.31 - 0.308 = +0.002, then square = 0.000004
    0.31 - 0.308 = +0.002, then square = 0.000004
    0.32 - 0.308 = +0.012, then square = 0.000144
    0.34 - 0.308 = +0.032, then square = 0.001024

    then figure the mean (avg) of the sq's above

    sum all....................................................0.00176 divided by 10 = 0.000176 avg (Variance)

    finally square root of 0.000176 = Standard Deviation

    the Standard Deviation is: 0.01398mm of the Z probe with the mini IR.

    What it looks like to me is the M48 command is traveling to an operator reported x,y position, then probing that point (ex) 10 times.
    What I did was send out 10 separate G29 commands.................causing the snozzle to run all over the bed, Home..........then record the Z height............wash, repeat, 9 more times.........much more brutal then up/dwn in one spot......numbers very good, Take Care.......
     
    #124 jim3Dbot, Nov 8, 2015
    Last edited: Nov 9, 2015
    jbigler1986 and Mike Kelly like this.
  5. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124
    Here's what I did to install the mini-ir on my R1.

    The .stl file is the correct screw spacing for the PCB. If you use the bracket, I may be able to modify the design file to accommodate your machine. The holes will accept #2 machine screws or maybe a #2mm metric. Stay away from flat-head, not a fan of driving a wedge into the hole. Pan-heads or best Fillister heads have a smaller head diameter, less chance of shorting something on the PCB. The small nuts that ride in the rear channel work fine but, are a real headache to get started. I plan to redesign the bracket with captive nuts, that will allow up/dwn movement. The R1 has a phillips screw with an aircraft style lock nut in the extruder carrage. This bracket attaches with the screw, no other modifications needed.

    Mount the mini to the bracket. The lower side of the PCB should be about 2mm above the tip of the nozzle.
    It is best to mount facing you as in the videos, this has less negative effect if the X is slightly misaligned. When plugging in the 3 pin connector, RED is Vcc, White is the signal, and Black is ground. Careful, don't plug in backwards. The cable is 48" long which is plenty long enough for the robo. If you need to lengthen the cable cut about 6" from the end that attaches to the ramp board. Splice there. Don't try to remove pins from connector, possible but not recommended.

    These are the Robo3DR1V3_06112015 firmware lines that were revised:

    // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
    const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //robo
    const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //robo
    const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //robo
    const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //robo
    const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //robo
    const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //robo
    #define DISABLE_MAX_ENDSTOPS //robo
    //#define DISABLE_MIN_ENDSTOPS

    #ifdef AUTO_BED_LEVELING_GRID


    // set the rectangle in which to probe
    #define LEFT_PROBE_BED_POSITION 15
    #define RIGHT_PROBE_BED_POSITION 200
    #define BACK_PROBE_BED_POSITION 210 //Jim revised from 240
    #define FRONT_PROBE_BED_POSITION 10 //Jim revised from 20
    // those two distances were revised because the -25mm I added to Y offset
    // set the number of grid points per dimension
    // I wouldn't see a reason to go above 3 (=9 probing points on the bed)

    // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
    #define X_PROBE_OFFSET_FROM_EXTRUDER 0
    #define Y_PROBE_OFFSET_FROM_EXTRUDER -25 // IR located -25mm from nozzle
    #define Z_PROBE_OFFSET_FROM_EXTRUDER 0


    //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
    //it is highly recommended you let this Z_SAFE_HOMING enabled!!!

    // #define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area. (Jim commented out)
    // When defined, it will:
    // - Allow Z homing only after X and Y homing AND stepper drivers still enabled
    // - If stepper drivers timeout, it will need X and Y homing again before Z homing
    // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
    // - Block Z homing only when the probe is outside bed area.

    // #ifdef Z_SAFE_HOMING (Jim commented out)

    #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28)
    #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28)

    // #endif (Jim commented out)

    // required with the -25mm Y offset, software believes nozzle not on bed
     

    Attached Files:

    #125 jim3Dbot, Nov 11, 2015
    Last edited: Nov 14, 2015
  6. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124
    Autolevel run.......without limits

     
  7. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    @jim3Dbot You have done a spectacular job with this mod. I applaud you, sir.
     
  8. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124
    Thank you Sir,

    Final stage 10 is two parts, A video using the steel stencil, solder paste, and into the SMT oven.

    Wait for the feedback from the ten minis I have already 'hand soldered' and sent out there...........that is the real test.

    Personally, don't like the position of the board....needs to be located somewhere else, possibly on the carriage.....with fiber optics or light guides angled towards the tip...........possibly next thread........hmmmmm
     
  9. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Now just use this with the new Marlin 1.1.0 and you will have the thoroughly modernized Robo, the Robo +PLUS+ (see the extra plus there, because two pluses aren't redundant enough).
     
  10. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    R++
    (see all the less letters there?)

    ;)

    (apologies to both K and R)
     
  11. Mike Glass

    Mike Glass Active Member

    Joined:
    Dec 29, 2014
    Messages:
    268
    Likes Received:
    123
    Jim, I have installed the sensor, but for some reason it probes about an inch above the bed, if I stick something under it detects it and raised the bed, Is there a gcode start command I need to use first, or some kind of calibration?

    Thanks
    Mike
     
  12. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124
    Mike,

    It seems like the same condition as Robos' limit switch/s being not seated. Did you revise the firmware to False from True? IR is moving away from bed when it sees your added reflection......keep me posted...See post #125....flash with changes..........thanks Mike
     
    #132 jim3Dbot, Nov 14, 2015
    Last edited: Nov 14, 2015
  13. Mike Glass

    Mike Glass Active Member

    Joined:
    Dec 29, 2014
    Messages:
    268
    Likes Received:
    123
    Yes Sir, I did the changes to the firmware as listed, mine does not seem to act the same that yours does, can you send me your configuration.h file and I will do a compare.
     
  14. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124
    Arduino 1.6.5
    ROBO3DR1V3_06112015

    Mike, Here's the config. H

    Lets get this workin'............jim
     

    Attached Files:

  15. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124
    Setting the Z Offset with the Mini-IR



    M565 command
    Set the offset from the extruder tip to the probe position. The X, Y and Z values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing.

    Yesterday at 8:02 PM - Mike Kelly: m565 would be positive, firmware would be negative

    I have seen, on the forums, MK repeating this several times........I am revising the firmware in matter control, yep..it's negative.

    The definition for M565 is above.....IR not typical, it is triggering above the extruder, thus positive if you are revising M565 & negative if revising the firmware...........please reply if this is not correct...we are striving for as accurate as possible....take care.
     
    #135 jim3Dbot, Nov 14, 2015
    Last edited: Nov 16, 2015
    Mike Kelly likes this.
  16. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,276
  17. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124
    I'll get you a number....I need to check model dimensions...may be same or smaller.
     
  18. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124
    Mike, Boards are scored & broken apart from a 20 piece panel...accuracy slightly varies, but figure from datum (0,0) left hole (0.1,0.60)" right hole (0.825,0.60)" Holes are 0.100" dia. & 0.725" center to center.

    Hope this helps.....Take Care
     
    #138 jim3Dbot, Nov 14, 2015
    Last edited: Nov 14, 2015
    Mike Kelly likes this.
  19. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124

    Thanks Mike Glass for catching my copy & paste blunder............Damnit....Damnit...Damnit....damnit
     
    Mike Glass likes this.
  20. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    124
    M565 command
    "Set the offset from the extruder tip to the probe position. The X, Y and Z values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing." wiki

    Yesterday at 8:02 PM - Mike Kelly: m565 would be positive, firmware would be negative

    I have seen, on the forums, MK repeating this several times........I am revising the firmware in matter control, yep..it's negative.

    The definition for M565 is above.....IR not typical, it is triggering above the extruder, thus positive if you are revising M565 & negative if revising the firmware...........please reply if this is not correct...we are striving for as accurate as possible....take care.
     
    #140 jim3Dbot, Nov 16, 2015
    Last edited: Nov 16, 2015

Share This Page