wapiti59
Posts: 4
Joined: Wed Nov 29, 2017 1:23 pm

embedding M150 commands to execute

I've got an issue I'm trying to solve, and need some help. I built and set up a mount for a standard hobby servo to deploy a brush over the print bed, with the intent that when the extruder heats up, it makes a few passes over the brush to clean itself off before starting a print. The challenge I had, that I THOUGHT I had beat, is that the motherboard in my printer (Geeetech A30) has absolutely NO way to connect a servo to it to control it from the printer. So, after a few months of pondering and looking, I came across a Sparkfun Servo Trigger that handles the actual control and powering of the servo. It simply relies on a switch state also connected to it to control if it moves the servo to position A, or position B. So, I independently powered the Servo Trigger from it's own 5V power source, and then am using the RGB LED Light control plugin in Octoprint to control it. I connected I think it was physical pin 7 on the Pi's GPIO header to the input side in the Servo Trigger, and ground on the Pi GPIO header to the other side. I configured the plugin in Octoprint to only know about that pin, making it think it's controlling the Red LED's So, issuing an M150 R0 (full off) command from the terminal homes the brush out of the way of the extruder and clear of the print bed, and M150 R255 (full on) deploys the brush out over the print bed ready for the cleaning passes. It runs beautifully from the terminal. So, I built the following command sequence into the print starting scripts of Simplify 3D thinking I had this licked, keyed to execute after the extruder has heated to temperature:

G1 Z30; (raise the extruder to the right height for cleaning)
M150 R255; (deploy the brush)
G1 X335; (first pass over the brush)
G1 X300; (second pass over the brush)
G1 X335; (third pass over the brush)
G1 X300; (fourth pass over the brush)
M150 R0; (home the brush out of the way)

In theory, it should work great, but it doesn't. All of the G commands get passed, but none of the M150 commands are executing. So, I thought OK, until I can figure this out (ya, right), I'll just monitor the printer and when it starts the cleaning cycle, I'll just issue the M150 commands from the terminal. No such luck - none of the M150 commands are passing out of the Pi. Any idea what I am missing here? Is there some trick I need to implement in Simplify 3D to get it to pass the M150 commands to execute, instead of just being passed over? Help???
horst.w
Posts: 852
Joined: Fri Oct 17, 2014 5:00 pm

Re: embedding M150 commands to execute

Slice a small object and have a look into the clear-text gcode.
I have no doubt about that S3D writes the M-command to the gcode and it will be execute when used by the terminal-command or used with a SD-card or USB.
Perhaps Octoprint is not able to pass it, analog to the prusa firmware where it is deactivated.

https://reprap.org/wiki/G-code#M150:_Set_LED_color

horst.w
GER
M-Test-Scripts.png
M-Test-Scripts.png (9.97 KiB) Viewed 897 times
M-Test.png
wapiti59
Posts: 4
Joined: Wed Nov 29, 2017 1:23 pm

Re: embedding M150 commands to execute

Yes, it is in the G code, as you said, so it is not an issue with Simplify 3D. It appears that there is something going on in Octoprint then that is causing it to not execute properly. Since the Servo Trigger is run by Octoprint and not the printers firmware, it must be passing M150 straight to the printer, which says that's nice, nothing there, on to the next line. Off to another forum. Thank you.

Return to “Troubleshooting and Bug Reports”