Welcome! Log In Create A New Profile

Advanced

Mini height sensor board ver 1.2

Posted by skippy2235 
Mini height sensor board ver 1.2
January 20, 2019 09:54AM
Hello,
I just recived my Mini height sensor board ver 1.2 (https://miscsolutions.wordpress.com/mini-height-sensor-board/)
I installed in on my zonestar (RepRap Prusa i3 CLONE) witrh Marlin firmware.

So I powered up the sensor and right away, LED come on and flashes 2 times, just like you said it would.
All wires are correct.
After homing the printer and find that it will not goto Z home. Instead it goes up about 10mm and stops.
I enter the M119 command and find that:
With the sensor a long way above any surface, the LED on the sensor is off, and printer firmware does indicate that the sensor is triggered.
AND
With the sensor closer to a surface LED does illuminate and printer firmware does indicate that the sensor is NOT triggered.

How do I fix this.
Rewriting firmware to my printer is not an easy task, as I do NOT have the source code and would have to do a complete install of Marlin.
Is there a way to change the firmware on the height sensor, and what would I change.
Dave
Re: Mini height sensor board ver 1.2
January 20, 2019 01:26PM
So I did a temp / maybe perm fix.

What I did is quite overkill but works, was to install a Nano as a buffer / inverter.
What is happening is that the Zonestar expects to see 5V when the sensor is away. and 0V when near. this switch setup is called normally closed.
I wrote a simple code that looks at the input from the sensor. Then puts out a signal that is opposite of what the input is.
did some wires and it test great.

I would like to find away to edit the firmware in the sensor and re-flash it, so I can remove the Nano.
Dave
Re: Mini height sensor board ver 1.2
January 20, 2019 03:07PM
I'm glad you got it working.

Ideally you would reconfigure the printer firmware to expect an active high signal from the Z probe, instead of active low. If you were using RepRapFirmware or Smoothieware, this would be done by a trivial edit to the configuration file that the firmware reads when it starts up. But as you are using Marlin, you can't make that change without recompiling and re-flashing the firmware.

If you want to stick with your existing 8-bit controller electronics, it's probably worth you making the effort to get a recent version of Marlin or Repetier working on your printer. Until you do, you will only be able to make a few minor changes to the configuration.

If you want to reprogram the IR sensor to generate an active low output, then the 6 programming pads on the top side of the PCB have the standard Atmel layout. You can find the firmware source at [github.com].

HTH David

Edited 1 time(s). Last edit at 01/21/2019 02:59AM by dc42.



Large delta printer [miscsolutions.wordpress.com], Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Mini height sensor board ver 1.2
January 20, 2019 03:36PM
thank you David for your repley

I was hopping you would come around.
I would love to change the firmware on your sensor.
I am not a programer. So could you help me.
can you tell me what to change... like what line # to what value.
I read all those .cpp files and dont understand them. I have only written 4 simple progams in my life, just getting started.
I have programed lots of chips, just using code written my others.
I have read up on how to use ardiuno IDE to program the Atmel ATTiny chips, and will have to issues doing that part.
Only need a cpp file that has the proper changes.
thanks
Dave

Edited 1 time(s). Last edit at 01/20/2019 05:53PM by skippy2235.
Re: Mini height sensor board ver 1.2
January 21, 2019 04:16AM
If you exchange the code bodies of the two functions SetOutputOff and SetOutputSaturated, that should do it. Note, the LED will be on when the sensor is not triggered.

IMO it would be easier to add a pullup resistor between the IR sensor output and Vcc pins (to make sure that it starts up in digital mode) and a 2N7000 or similar mosfet to invert the signal fed to your controller electronics.



Large delta printer [miscsolutions.wordpress.com], Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Mini height sensor board ver 1.2
January 21, 2019 10:55AM
Hello again.
Here is my understanding of what you are talking about.
I watched a youtube video of the 2N7000, and think I get what you are saying. (https://www.youtube.com/watch?v=m1l7TmVZVo4)
Attached is the proposed changes to make to the Height sensor.
Add a 10K resistor pin 1 to pin 3.
Cut trace going to pin 1 and reroute to gate of 2N7000.
then get source from pin3 and drain to the other side of the cut back to pin 1.
Attachments:
open | download - 0121190748.jpg (104.5 KB)
Re: Mini height sensor board ver 1.2
January 21, 2019 05:22PM
Cut trace - correct
Mosfet G and D connections - correct
Mosfet S connection - connect directly to ground
10K resistor - connect between mosfet G and Vcc. The MCU will detect it and start up in digital output mode. Also don't use 10K, use something between 22K and 100K inclusive.

Edited 1 time(s). Last edit at 01/21/2019 05:23PM by dc42.



Large delta printer [miscsolutions.wordpress.com], Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Mini height sensor board ver 1.2
January 22, 2019 08:59PM
Thankyou,
someone can label this SOLVED.
I build a very small board tonight after work, and it works great.

Notes:
I tried a big mosfet (I dont remember the number but it was a 20 amp NPN) and it did not work.
So without waiting a week for 2N7000, I used NPN BJT BC547B transistor.
also a 47K resistor.

Thanks again
Dave
Sorry, only registered users may post in this forum.

Click here to login