CloneBoard Mini and P-Stop

50 views
Skip to first unread message

Joseph Ecker

unread,
Jan 26, 2018, 9:27:22 PM1/26/18
to Jetty Firmware
Hello,

I could use some advice on getting the P-Stop function working on my CloneBoard Mini.

I purchased a switch, wired it up to P-Stop, and enabled the function in the Sailfish menu.   I then power-cycled the printer and started a print from SD.

The printer starts to home X, but starts bouncing off the X endstop, and never continues to home Y.

Do you think this might be because I compiled Sailfish to be XYZ-min (and corexy)?

My next step is to go back to the firmware source code and see if I can make sense of why it's behaving like this.

Any ideas or suggestions would be greatly appreciated.

-Joe
p.s.  I'm using Sailfish 7.8 (r1675 I think) and I've connected the wires to the switch's ground and NC inputs.  Though I've tested triggering the switch while power cycling the printer and adjusting the P-Stop invert options to no effect.

Jetguy

unread,
Jan 26, 2018, 10:14:01 PM1/26/18
to Jetty Firmware
Pullup my friend. Know it, understand it.

P-stop intentionally does NOT include a pullup turned on in the processor pin. As such, the configuration in the clone board is NOT the same as a regular mightyboard and so you cannot sense a state change because you have no voltage source with just a 2 wire switch.

Again, what's happened here is the KEY difference between a real mightyboard and Carl's implementation with the clone board. Mightyboard has 4 wire endstop connections and P-stop depends on you using that 5V source and the switch using all 4 pins to have the logic high state (basically, the endstop has the pullup, but in order for it to work, it's ALSO because it's a pin connector that has 5V and ground present).

Carls board is 2 wire endstops. That means it's just the processor pin and the OTHER terminal is ground plane. As such, the assumption is that the processor has the internal pullup enabled (part of the hard coded firmware config)
That said, the issue then is that P-stop intentionally does NOT have pullup enabled so that it could detect when a user fails to plug in a working switch and enabled p-stop in the menu. In other words, the one way you could detect a malfunctioning or not connected p-stop switch.

But, when you load the same firmware on a cloneboard- now you physically have no 5V source in the endstop connector (2 wire VS 4 wire) and so you have to mod your switch or the board or something to provide the proper signal. A 4.7k ohm resistor is all you need, connected to 5V and pulling up the sense pin of the endstop to 5V. Then your switch grounds it and thus shorts it out giving a high and low state.

Jetguy

unread,
Jan 26, 2018, 10:18:34 PM1/26/18
to Jetty Firmware
Just being dead honest with you, this is the most common mistake when using P-stop even on a mightyboard.
This because again, the firmware intentionally does not enable a pullup in the processor. So people even using a 4 wire endstop style mightyboard, they forget that all important detail and then wonder why their often 2 wire switch or whatever sensor device they use fails to work.

Jetguy

unread,
Jan 26, 2018, 10:22:58 PM1/26/18
to Jetty Firmware
See, I said the same thing back in 2013 to show how long ago this was https://groups.google.com/d/msg/jetty-firmware/6QyGWF-N0PU/ruFsj4-5J-gJ
And here too in the same timeframe. I'm sure somewhere buried, there is a thread because I know this question came up on Carl's cloneboard.
https://groups.google.com/d/msg/jetty-firmware/ueunGyUuCEU/r7wvyCGqxpcJ

Jetguy

unread,
Jan 26, 2018, 10:36:09 PM1/26/18
to Jetty Firmware
In The cloneboard forum here is a link with even more additional specific information https://groups.google.com/forum/#!topic/clone3d/7JpOkwKA4-E

The more I think about this, I think reading Carl's instructions and then seeing you compiled your own firmware from source?
I think that comes into play. As stated, Carl knew his board is 2 wire only and requires the firmware to include pullup definitions. I bet in the P-stop configuration in the firmware source, it enables a pullup when Carl's board type is enabled. However, if you did your own edits, it could be this was missed.
Or, he didn't know about the P-stop intentionally not enabling pullup and his instructions and board design didn't compensate and thus we just have a gap here.




On Friday, January 26, 2018 at 10:18:34 PM UTC-5, Jetguy wrote:

Joseph Ecker

unread,
Jan 26, 2018, 11:24:58 PM1/26/18
to Jetty Firmware
Thanks for the replies, Jetguy. I'll dig into it tomorrow. I did read through all your posts from years ago and was awfully confused. I had thought that Carl documented his Pstop as being able to use a simple switch without having to wire in power.

I also looked at the sailfish GitHub and found there's been a few more releases since I last compiled it for my printer. This gives me a reason to get a fresh copy and dig into the code.

Daniel Newman

unread,
Jan 27, 2018, 12:36:09 AM1/27/18
to jetty-f...@googlegroups.com, Jetguy
On 26/01/2018 7:36 PM, Jetguy wrote:
> In The cloneboard forum here is a link with even more additional specific information https://groups.google.com/forum/#!topic/clone3d/7JpOkwKA4-E
>
> The more I think about this, I think reading Carl's instructions and then seeing you compiled your own firmware from source?
> I think that comes into play. As stated, Carl knew his board is 2 wire only and requires the firmware to include pullup definitions. I bet in the P-stop configuration in the firmware source, it enables a pullup when Carl's board type is enabled.

Actually, I don't believe it does. I could be wrong, but I don't recall adding that nuance
for Carl's board.

Dan

Jetguy

unread,
Jan 27, 2018, 10:31:40 AM1/27/18
to Jetty Firmware
Either way, this is very easy to check if this is the source of the problem. Just like me bringing up the issue with him of limitations and EMI issues with 2 wire only endstops and depending on weak internal processor pullups he may have been totally unaware of this function (lack of pullup) being enabled for P-stop when he designed the board and made the instructions.

Without your switch installed, simply take a multimeter across the 2 P-stop screw terminals with the board powered and your firmware loaded. If there isn't 5V across the P-stop, then that validates there is no pullup and that's why no state change is sensed with a simple switch installed.

Jetguy

unread,
Jan 27, 2018, 11:00:59 AM1/27/18
to Jetty Firmware
Also, another "gotcha" that gets people in testing, after changing the setting in the menu for P-stop on, you have to power cycle the control board for the change to take effect. That messes up folks all the time during testing.

Jetguy

unread,
Jan 27, 2018, 11:05:32 AM1/27/18
to Jetty Firmware
Also, I just happen to have a cloneboard mini and dug it out and with firmware 7.7 on it (the binaries provided via using the Sailfish Rep-G 034 update process and official Sailfish update repository) the P-stop and all the other endstops do in fact have 5V across them meaning there is either a pullup external resistor in the schematic or the code knows and that's an internal pullup.

That makes me think it could be something with your custom firmware or the failure to reboot after changing the setting?

Jetguy

unread,
Jan 27, 2018, 11:09:46 AM1/27/18
to Jetty Firmware
I also see that Carl put LED indicators on the endstops near the screw terminals and it lights when the endstop is closed (shorted) and does this on P-stop. So when you toggle the switch does the LED light?
Again, if the LED lights indicating a status change, but the firmware does not react- then probably a code issue since you did do a custom version.

Jetguy

unread,
Jan 27, 2018, 11:32:10 AM1/27/18
to Jetty Firmware
Sorry I guess I have been really bad at helping you and that's what I get for going off memory and not having the board or schematic in front of me.
Basically, a lot of the endstop pullup stuff is 100% true and valid for Mightyboards, but Carl does appear to have done filtering and conditioning on the endstops of the mini clone board.
Again, a lot of what I went over about using only internal pullups and depending on a 4 wire connection to endstops that also contain pullup external resistors and specific connections to drive the sense line high and low rather than a "floating" one ended pullup state is all true- but more specific to a mightyboard.

Given that the cloneboard does has an LED state indicator right near the screw terminals, the first and most obvious thing is does it light and turn on and off when the filament detection device (switch) you chose is toggled?
That pretty much defines the hardware side and if the LED does change state, then the fault is likely custom firmware. If it doesn't change state, disconnect and troubleshoot the switch wiring.

Jetguy

unread,
Jan 27, 2018, 11:42:11 AM1/27/18
to Jetty Firmware

Schematic so I was wrong in some of my early assumptions about the cloneboard, there is an external 4.7k pullup (well, and you also get additional pullup via the LED and limiting 1k resistor too).

Jetguy

unread,
Jan 27, 2018, 11:42:39 AM1/27/18
to Jetty Firmware
FYI, full schematic location https://github.com/CarlRaffle/CloneBoard

Joseph Ecker

unread,
Jan 27, 2018, 3:36:21 PM1/27/18
to Jetty Firmware
I printed up a housing for the switch to use as a filament sensor.  With the switch wired up with the NC terminal, and filament inserted through the housing, it activates the switch and the LED indicator on the cloneboard for P-Stop is off.  Once the filament is removed from the housing, the switch deactivates and the LED indicator on the cloneboard for P-Stop is on (lights up).

I compiled Sailfish to use XY-min, so let me find what I compiled before and see if there is a conflict with one of the endstop and P-Stop definitions.

Thanks

Daniel Newman

unread,
Jan 27, 2018, 3:53:07 PM1/27/18
to jetty-f...@googlegroups.com, Joseph Ecker
On 27/01/2018 12:36 PM, Joseph Ecker wrote:
> I printed up a housing for the switch to use as a filament sensor.  With the switch wired up with the NC terminal, and filament inserted through the housing, it activates the switch and the LED indicator on the cloneboard for P-Stop is off.  Once the filament is removed from the housing, the switch deactivates and the LED indicator on the cloneboard for P-Stop is on (lights up).
>
> I compiled Sailfish to use XY-min, so let me find what I compiled before and see if there is a conflict with one of the endstop and P-Stop definitions.
>

For a Clone board, you likely want to define CLONE_R1 for the build.

'mighty_one-2560-clone-r1' :
{ 'mcu' : 'atmega2560',
'programmer' : 'stk500v2',
'board_directory' : 'mighty_one',
'defines' : [ 'CORE_XY', 'BUILD_STATS', 'ALTERNATE_UART',
'HEATERS_ON_STEROIDS', 'AUTO_LEVEL', 'HAS_RGB_LED',
'PSTOP_ZMIN_LEVEL', 'COOLING_FAN_PWM',
'PLATFORM_SPLASH1_MSG=\\\" Sailfish Clone R1 \\\"',
'PLATFORM_THE_REPLICATOR_STR=\\\"CloneR1\\\"',
'PLATFORM_X_OFFSET_STEPS=14444L',
'PLATFORM_Y_OFFSET_STEPS=8667L',
'PLATFORM_AXIS_LENGTHS={300L, 195L, 210L, 100000L, 100000L}',
'PLATFORM_AXIS_STEPS_PER_MM={88888889, 88888889, 400000000, 96275202, 96275202}',
'EEPROM_MENU_ENABLE', 'CLONE_R1', 'RGB_LED_MENU' ]
},


Dan

Joseph Ecker

unread,
Jan 27, 2018, 3:53:34 PM1/27/18
to Jetty Firmware
Ok, I think I found the firmware tree I last compiled :-)  (I have to do a better job of documenting which versions I'm messing around with and which ones I'm actually using, as the firmware version info shown on the printer is simply v7.8 r01234)

Looks like I had modified r1677.  The SConscript shows:

if (zlevel == '1'):
   flags.append('-DPSTOP_ZMIN_LEVEL')


My coffee hasn't sunk in yet, but I'm thinking that might be my issue.  I'm continuing to look...

Joseph Ecker

unread,
Jan 27, 2018, 4:00:28 PM1/27/18
to Jetty Firmware
Hi Dan,

I think I had based my modifications off the clone-r1, but I'll take a look at it again.    This is a silly question, but don't most printers home Z to min?

Joseph Ecker

unread,
Jan 27, 2018, 4:11:16 PM1/27/18
to Jetty Firmware
Yeah, last time I compiled it was with "scons platform=mighty_one-2560-corexy" and that was after making some mods to the firmware.

Joseph Ecker

unread,
Jan 27, 2018, 5:41:14 PM1/27/18
to Jetty Firmware
I'm going to try and come up with my own machine definition.  Hopefully I can get it to work without twiddling with stepper ports in the source code :-)

Joseph Ecker

unread,
Jan 27, 2018, 6:36:34 PM1/27/18
to Jetty Firmware
Well, this isn't working out too well.  I can't even upload firmware now.  The board simply resets a few seconds after clicking the upload in replicatorg.

Joseph Ecker

unread,
Jan 27, 2018, 7:11:17 PM1/27/18
to Jetty Firmware
ok, got the firmware to upload, but now homing is all messed up.  *sigh*  so much for a simple platform definition ;-)

Joseph Ecker

unread,
Jan 27, 2018, 7:43:52 PM1/27/18
to Jetty Firmware
Any ideas what port the PSTOP is supposed to be on?  I'm looking at Configuration.hh and by default XMIN is L0, XMAX is L1, ZMIN is L6 and ZMAX is L7.

If I'm homing to XYZmin, can I simply define PSTOP to be on Z-max or X-max or is the port specific to the cloneboard mini?

Joseph Ecker

unread,
Jan 27, 2018, 8:14:28 PM1/27/18
to Jetty Firmware
Well, I think I'm going to give up on trying to get PSTOP to work on this CloneBoard Mini.  Now to figure out how to get the firmware back to a functional state.

Daniel Newman

unread,
Jan 27, 2018, 11:50:04 PM1/27/18
to jetty-f...@googlegroups.com, Joseph Ecker
On 27/01/2018 1:00 PM, Joseph Ecker wrote:
> Hi Dan,
>
> I think I had based my modifications off the clone-r1, but I'll take a look at it again.    This is a silly question, but don't most printers home Z to min?

Replicator 1 and 2 types do. However, Cupcakes and Thing-o-Matics home Z max.
And there are other printers which home Z max (e.g., printers which offer the
ability to restart a print after a power outage).

Dan
Reply all
Reply to author
Forward
0 new messages