Welcome! Log In Create A New Profile

Advanced

3D printer hacking (Gcode help needed)

Posted by martinfl 
3D printer hacking (Gcode help needed)
June 25, 2020 05:00AM
Hi, (my first post)

I reworked a 3D printer (Geeetek A20M) to use it as a radio antenna characterization bench. The idea is to automatically perform radiation measures (with an oscilloscope) at different positions. The 3D printer moves one antenna relative to the other. One is hanging where the extruder normally is, the other one is mounted on a rotating plate laying on the print bed. I mounted the motor of the extruder on the print bed and a belt spins the plate to control the antenna polarity.

Software wise, I wrote a python driver. Controlling X Y Z works fine, but I'm having a hard time to identify the right Gcode commands to ...

- Disable all heating and temperature control of both the bed and the extruder (since the sensors are disconnected)
I managed to work around this problem (see below), but I'd rather have a more elegant solution to neutralize heating.

- Allow fine control of the extruder motor independently of any movement, and disable all security check that go with it.


Once connected to the printer (with USB virtual COM port), I send the following init sequence:

    M104 S-14       # Disable heating by setting extruder temperature to the value returned by a disconnected sensor (-14°C)
    M140 S-14       # Same with bed heating
    M107                # Stop fans
    M406                # Disable filament sensor (since there's no filament)
    M302 S0           # Authorize cold extrusion (since its motor drives rotation of the plate)


But it does not make the trick...
When I send the first command to control the extruder ("G0 E10"), the extruder motor turns and... the printer head moves !
The second time I invoke the same command, it returns "echo:enqueueing "M125"

Anyone knows how I can directly drive the motor ?
Whats commands should I send to disable all the checks and directly drive the motor without any restrictions or associated automatismes ?
If there's a Gcode expert around, your help is more than welcome smiling smiley

I'll expose you pictures of the system if you want. It's pretty neat smiling smiley

Regards,
Florent
VDX
Re: 3D printer hacking (Gcode help needed)
June 25, 2020 05:48AM
... hmmm ... M125 seems to be a paused condition?

I'm driving ultrasonic cleaners with Marlin4Due as firmware and standard Gcodes for moving, absolute/relativ positioning, short pauses and I/O switching with M42.

IIRC I've only set the "min-temps" to zero in the configuration to prevent temperature related interrupts ...

Edited 1 time(s). Last edit at 06/25/2020 05:48AM by VDX.


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: 3D printer hacking (Gcode help needed)
June 25, 2020 08:10AM
You don't need to disable heating as such.. If you just don't send any gcodes that tell it to heat anything up.
But to really disable it you need to set thirmistors to 0 in firmware and set extruders to 0.


"Allow fine control of the extruder motor independently of any movement, and disable all security check that go with it."
Can't do it, its 3d printer firmware, this is part of its soul.

"Whats commands should I send to disable all the checks and directly drive the motor without any restrictions or associated automatismes ?"
If you get latest's bugfix there is a new feature called Direct Stepping. [github.com]
It may do what you want. It may even get around the E limitations.


G0/G1 has two modes absolute and relative modes. G90/G91
If its is absolute mode you send as many G0 E10 as you like, it already at 10 so wont move.

Edited 1 time(s). Last edit at 06/25/2020 08:11AM by Dust.
Re: 3D printer hacking (Gcode help needed)
June 25, 2020 08:30AM
Quote
Dust
"Whats commands should I send to disable all the checks and directly drive the motor without any restrictions or associated automatismes ?"
If you get latest's bugfix there is a new feature called Direct Stepping. [github.com]
It may do what you want. It may even get around the E limitations.

I'm glad I came here smiling smiley

Quote
Dust
G0/G1 has two modes absolute and relative modes. G90/G91
If its is absolute mode you send as many G0 E10 as you like, it already at 10 so wont move.

Nice. Thanx Dust. Gonna try that smiling smiley
Re: 3D printer hacking (Gcode help needed)
June 25, 2020 05:17PM
You don't say what firmware you have on your printer. The interpretation of G-code depends on your firmware. See [reprap.org] for a good description of all the G-code commands in all the common firmware versions.

Quote
Dust
"Allow fine control of the extruder motor independently of any movement, and disable all security check that go with it."
Can't do it, its 3d printer firmware, this is part of its soul.

If you have Marlin firmware and want to "extrude filament" independent of the axes, you are right to do that with e.g. "G0 E5". This will move the "filament" 5mm = 200 steps at 40 steps/mm = 1 turn of the stepper for a typical 200 steps/turn stepper motor. So you can turn the stepper by 1 step = 1.8 degrees by "G0 E0.025". Generally speaking, you can't turn your antenna less than 1.8 degrees unless you gear the stepper or get a stepper with more steps/turn.

I'm not sure about the unwanted printer head movement. Maybe it is trying to home, since it doesn't know what the head's position is until it has been homed? Maybe add G28 to the beginning of your G-code (beware that this doesn't crash your antennas together... it assumes an empty bed). Or use G91 or G92 to set the current position to 0,0,0 and position relative to that.
Sorry, only registered users may post in this forum.

Click here to login