Robots in Architecture Forum

Robots in Architecture, Art, and Design => General Discussion => Topic started by: luigipachecoFIU on September 06, 2023, 08:40:09 PM

Title: import Gcode to digital output
Post by: luigipachecoFIU on September 06, 2023, 08:40:09 PM
I am wondering if there is any way to use the gcode import so that when the E value is 0 or negative (retraction) there could be a signal out to for example stop the extruder motor. Or how couuld I aproach this issue, I love the fact that the import component takes into account the path speed too so I am also tryng to control the extruder.
Title: Re: import Gcode to digital output
Post by: Johannes @ Robots in Architecture on September 07, 2023, 09:42:29 AM
Hello Luigi,

How are you currently controlling the extruder? With the method that maps just to a digital output for on/off?

Best,
Johannes
Title: Re: import Gcode to digital output
Post by: luigipachecoFIU on September 07, 2023, 08:55:59 PM
I am currently sending a digital output to enable the extruder (ESP32), the flow is controlled manually with a knob or with OSC (UDP) with an esp32. But it should be possible to stop it by just sending having in my case output 1 to turn off. The problem is that the gcode import doest let me put this in between , I see it changes the speed based on the gcode, but not sure how to map the e values from the gcode to the digital output. another idea could be to map an analogue output to the extruder speed and I could implement the logic on the ESP 32 to map the extruder speed accordingly.
Title: Re: import Gcode to digital output
Post by: Johannes @ Robots in Architecture on September 08, 2023, 09:29:40 AM
Hello,

For the G-code import if you set the mapping to e.g. E1 it maps the extrusion to an external axis, with e.g. D1 it maps ON or OFF to $OUT[1]. The external axis should also work without a physical axis attached (you may need to configure a simulated axis, but try it without it first). On the robot via the sps.sub you could map the current E1 speed to an analogue value that gets output to the extruder.
Just an idea!

Best,
Johannes
Title: Re: import Gcode to digital output
Post by: luigipachecoFIU on September 29, 2023, 02:00:22 PM
This is exactly what I was looking for, thanks for clarifying .:)