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. Doug Meek

    Doug Meek Member

    Joined:
    Sep 14, 2016
    Messages:
    54
    Likes Received:
    24
    Well I got it installed and powered up and when I turn the printer on I get the expected 2 blinks....however IF I have the printer powered off and I connect the USB from my OctoPI the board will flash the LED 4 times. This is before powering up the printer. If after attaching the USB power I power on the printer the LED does nothing at that point and my Z home setting keeps getting higher and higher, it is now at zero about 5 inches above the bed.

    If I have the USB disconnected and I power on the printer I get the expected 2 flashes . Is this how it is supposed to act? This will make it a real pain to use if I have to disconnect the OctoPI before powering on the printer. I just can't think what might be wrong...help?

    Currently I am running the 1.1 firmware from about 10 days ago, but not RC8 and I have not gone through and made the changes in firmware and uploaded it yet. Would that cause this? Off to get RC8 and make my changes.
     
  2. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    21,935
    Likes Received:
    7,103
    USB powers the arduino. Regardless of whether the power supply for the printer is on or off.
     
  3. danzca6

    danzca6 Well-Known Member

    Joined:
    Jul 27, 2015
    Messages:
    2,161
    Likes Received:
    1,074
    That is the expected behavior. The IR only needs to initialize once. Either at the time the power is turned on or the time the USB is plugged in. Not really a big deal. I'm using mine with 1.1.0 RC8 without any issues. I've also been using it for many of the previous 1.1.0 versions posted.
     
  4. Doug Meek

    Doug Meek Member

    Joined:
    Sep 14, 2016
    Messages:
    54
    Likes Received:
    24
    The problem is that it is initializing as analog instead of digital when the USB is connected...that is a problem, I would expect. NO?
     
  5. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    123
    Hi Doug, Just seen your post......Some errands to run this morning......I will get back to you later today.........I'll pull a schematic of your Ramps card..We will get the IR workin'...................Jimmy
     
    Geof and danzca6 like this.
  6. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    123
    Doug, I hope this will help you, here goes......

    First, you are correct in grabbin' the +5v from the I2C connector, referred as Vcc on the schematic or + on the silkscreen of the actual Ramp board. You can double your wires up or Google Ramps 1.4 drawing and locate another Vcc terminal on the Ramps that may be empty. Okay that's the easy answer.

    Here's what I think is happening with you IR, which I think you already 'kinda' know. As @danzca6 explained earlier, during initial power up of the IR, (rear power switch off, no usb connected), the IR boots up, checking system resistance. If the resistance is low, the IR will blink twice and enter into the digital mode, (Robo R1, R1+). If the IR sees a high resistance, (4 blinks) it will enter into the analog mode, some non-ramp driver boards, (you don't want 4 blinks). The mode will lock until you shut off the power switch and disconnect USB. I will explain the signal flow later......

    As you stated, powering up with the power switch will place the IR into digital mode, if you then plug-in the USB you are still good, (the IR is locked into digital mode, 2 blinks). However, in your case, if you plug-in your USB first, the IR is chooses analog mode, 4 blinks......The problem is your set-up is supplying 5v via the USB to the IR. The IR boots up........BUT, the resistance of your set-up is too high, greater than 390K ohms. Now your stuck in the wrong mode.....the Ramps digital input cannot deal with the analog mode chosen, hence the Z issues.........Try to place another resistor from the IR output pin to Vcc, (5v). Try a 100K first. The goal is: with the main power off & the USB unplugged, plug-in the USB only & shoot for 2 blinks...when you see that, you are d-u-n....

    Here's the signal path for the IR to sense the low resistance,
    Mini IR output pin.........to the ramps Z min endstop connector.......thru the ramps board & right back out again passing thru no electronics, exits an 8 pin header...........enters the Arduino 2560 "communication" header D18..........8 pin header, pin 4, called TXD1 on the schematic or TX1 on the board silkscreen................finally terminating to the micro pin 46, TXD1/int3 PD3.....which has an internal pull-up resistor, (20K -50K)......voila.........that's the resistor that IR is lookin' for.

    Try using jumper cables to attach that resistor first.........let me know if I can help with resistors or anything else...........Take Care
     
    mark tomlinson likes this.
  7. Doug Meek

    Doug Meek Member

    Joined:
    Sep 14, 2016
    Messages:
    54
    Likes Received:
    24
    Jimmy,
    Thanks for the reply! I will try the resistor and let you know what I come up with. I think in the end I will remove T2 (MOSFET comparitor) on the Arduino to eliminate any power from the USB port, never liked that "feature" of the Arduino anyway. From what I understand removing the MOSFET will eliminate powering the Arduino via USB but still allow the USB power to the 2560 for communication purposes.

    In the mean time I have been trying to get things working when I startup without the USB connected and in confirmed digital mode. The sensor is tripping at about 3.1mm from the board (paper snug under extruder) consistently. Example, triggers at -7.09 and is snug on paper at -10.19. My sensor is 15mm behind the extruder and about 1.7mm above it so in firmware those are the offsets I entered. My Z offset in S3D was 1.24mm. I'm a little confused on what sequence I should be going through to get everything working and setup properly. I did the M502, M500 after updating the firmware and that is where I get a little lost.....I'm new to this so be patient please ;) I tried going through the MESH bed leveling in the controller but it starts about 5-10mm above the bed and only allows me to bring the head down by 4mm still well above the bed. If I try to print (Z offset in S3D back to 0.00) it tries printing 5-10mm above the bed.

    I'd prefer to go back to ABL till I get things working but haven't looked to see what I need to change in the firmware to disable MESH first. Everything in these threads is so spread out it takes time to find processes. It would be nice if there was a how to guide for dummies consolidated in one place for the firmware and this sensor..once I get mine working I will document, from a dummies perspective, what I had to go through to get it working in a new post.

    If you could help to get me started that would be great. Thanks again!
    Doug
     
  8. Doug Meek

    Doug Meek Member

    Joined:
    Sep 14, 2016
    Messages:
    54
    Likes Received:
    24
    Oh, one other thing, why is my RAMPS different than most others? At least I assume most do not have this analog mode problem. The path through the RAMPS and to the 2560 is the same isn't it? Is it just a tolerance issue?

    Also since I have the sensor mounted behind the extruder, the LED is facing the rear of the printer which makes it next to impossible to see...I added a piece if transparent filament to act as a light guide so that I can somewhat see it trigger. Is there an easy place on the sensor board to attach a remote LED? I will try a printed light guide first but I don't know if that will be bright enough.
    Thanks again.
     
  9. Doug Meek

    Doug Meek Member

    Joined:
    Sep 14, 2016
    Messages:
    54
    Likes Received:
    24
    #309 Doug Meek, Dec 10, 2016
    Last edited: Dec 10, 2016
    jim3Dbot likes this.
  10. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    123
    Glad to hear......100k worked.............ramp board is open source..........you will see many varieties of the same root design. Signal path thru ramp to arduino shield will be the same in all spins......On my layout/design of the mini, I mechanically up-sized the LED package size, from 603 to 1206..........offering more illumination & simpler assembly of the PCB. If you feel brave, you can remove the LED, D3........solder a 30awg wirewrap or similar small solid wire to the top pad.......bring wire to ???......you will need a second wire to the ground (center) pin. Design & print a remote LED support from your existing.............

    Personally, I would begin as you suggested already simple...........ABL......Digital mode, you are already there now..........get the IR triggerin' at a repeatable height.........stay away from the white areas on the bed, during ABL......very important.

    Man, I have not, shamefully so, not installed mesh yet.....been out of control busy..........too many projects going, I would have to highly recommend @danzca6 for the mesh stuff...........and the big gunner @WheresWaldo
     
  11. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    123
    Oh cool! That fellow used my layout..........nice fit.......
     
  12. Doug Meek

    Doug Meek Member

    Joined:
    Sep 14, 2016
    Messages:
    54
    Likes Received:
    24
    Hopefully my light guide will be enough but I'm fearful it won't be....hard to set things up when you can't see when it triggers. I've soldered 805's before but my eyes are getting older all the time and those parts seem to be getting smaller but 1206's are huge! Ha Ha! We'll see.

    Working on getting ABL setup now. Then I will worry about MESH, thanks for all your help and the excellent job you did on the IR sensor!
     
  13. Doug Meek

    Doug Meek Member

    Joined:
    Sep 14, 2016
    Messages:
    54
    Likes Received:
    24
    Well I love this mini IR but I had a problem with a runaway print last night and before I got to it it had moved a few things around. One of the casualties was the MIni IR board. The moving print piece evidently hit the sensor and IR transmitters (they were all 3 bent) on the board so now it isn't homing anymore. I straightened the IRs and receiver best I could but I really have no idea what angle any of them should be at. Jim2DBot could you give me some guidance on placement so I can see if I can get this aligned again?

    I have an electronics repair background so don't hold back ;) Thanks in advance. Just to note, it had been working flawlessly prior to this mishap!
     
    jim3Dbot likes this.
  14. danzca6

    danzca6 Well-Known Member

    Joined:
    Jul 27, 2015
    Messages:
    2,161
    Likes Received:
    1,074
    Oh man that's too bad. I designed a case to go around mine to keep things from messing with it for this very reason. The alignment of the IRs and receiver is critical. I think @jim3Dbot used a jig in order to get the alignment just right.
     
    jim3Dbot likes this.
  15. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    123
    Hi Doug,

    Man, @Doug Meek sorry to hear 'bout the print lifting........As @danzca6 wrote, the alignment is tricky but not impossible without a fixture. First make certain, with a good eye, that all 3 are close to a 45 degree angle with the board edge. Make certain all three are not bent forward or backward, shoot for perpendicular to board surface. Lookin' at the board, the photo-transistor is on your left & the IR emitters are on your right. The IR emitter furthest to the right board edge is the one you need to tweak. Make certain you are not above a white bed area......I adjust mine close to bed center/center. After you eyeball the adjustment.....check to see the distance the IR triggers from the bed......manually stepping the nozzle in very small steps, Z minus. I find that using diagonal cutters, held firmly but gently, grab the ir emitter right below the rounded part of the lens. You will be grabbing the molded part...do not touch the two leads or scratch the round molded lens. The idea is to twist, ever so slightly either CW or CCW.....then check your trigger height...going the wrong way......then twist the other way...........if you break the Ir emitter or just can't get it right................send it to me, I'll tweak it & return the mini IR. I will PM my address............Jimmy
     
    #315 jim3Dbot, Jan 5, 2017
    Last edited: Jan 5, 2017
    danzca6 and Geof like this.
  16. Doug Meek

    Doug Meek Member

    Joined:
    Sep 14, 2016
    Messages:
    54
    Likes Received:
    24
    jim3Dbot - Thanks for the info, I'll see what I can do tonight and send it to you if I get nowhere.

    danzca6 - I had it mounted in my fan shroud, actually fairly well protected but the renegade part found a way to get up in there and bend both IR emitters and the receiver....I may redesign it with a little more protection after this though. When I got to the printer when the part was flailing around I saw the carriage lift up so there was some power behind that part.
     
  17. danzca6

    danzca6 Well-Known Member

    Joined:
    Jul 27, 2015
    Messages:
    2,161
    Likes Received:
    1,074
    Wow, you really made that part angry. Must have been a Hulk bust. hahaha! Glad to see Jim gave some direction. I hope you are able to fix it easily.
     
  18. 3dEz

    3dEz New Member

    Joined:
    Mar 1, 2017
    Messages:
    2
    Likes Received:
    0
    Hi Jimmy and all, I am new here but I am in the process of modding the IR sensor so it can be installed on a Digispark board (so no AVR ISP is required). I have succeeded in loading the code (via a bit of hack on using Atmel Studio to compile and loading via micronucleus (Digispark bootloader) command line. I added the additional hardware via a tiny prototype board mounted on the Digispark. When all is done I will publish the mod in but I am having some issues:
    The device works but I am having a sensitivity issue with the detection. I had to bring down the LED resistor to around 200R to make this close to work. When I shine the phototransistor with a home remote I can see very strong pulsing with an oscilloscope so the phototransistor seems to be detecting well. I used the LED's indicated in dc42's schematics but I am wondering if those are the right ones (or maybe I got the wrong ones from Mouser?)
    Also, there is a behavior that I would like to confirm with you:
    - When light is detected from the near but not the far LED the output goes into a short pulse mode (led dim). It should not be a problem since in normal operation it should be detecting from the far and the near LED's but I found this a bit odd. have you seen this?
     
  19. jim3Dbot

    jim3Dbot Active Member

    Joined:
    Jun 1, 2015
    Messages:
    246
    Likes Received:
    123
    Hi @3dEz Sorry I won't be much help......Layed up in hospital for the past few weeks, should be out maybe another week.......stuck here with my iPads ......no IR ref material here......however, sounds like your issue will be the two emitters from mouser. Your LEDs are not the pink ones. Those LEDs are not obtainable in USA.......it's not that you need the pinks but, your mouser purchase shouts incorrect angle parameter. I have got non-pink ones to function but watch those parameters, keep them as close as possible........after you have the correct emitters then extreme careful mechanical tweaking of that far led still may be required........go backwards in this thread to find correct part number of the pinks, then google parameters, match as close as possible.......lens light angle, most important.........I'll keep watch bro.....Take Care......Jimmy
     
    #319 jim3Dbot, Mar 2, 2017
    Last edited: Mar 2, 2017
    mark tomlinson likes this.
  20. 3dEz

    3dEz New Member

    Joined:
    Mar 1, 2017
    Messages:
    2
    Likes Received:
    0
    Hi Jimmy, hope you get out of hospital soon. Your posting is very helpful. I do not have the pink ones and started to suspect those Mouser ones from the original dc42 schematics could be the problem. This makes total sense to me. I noticed the angle criticality you mentioned and was bothered by it. I will procure the pink ones and report back.
     

Share This Page