Closed 7cnc closed 1 year ago
What would an example of an mcodes.c "M100" look like with the function of replacing or inverting Step and Direction of the Y and A axes?
Or would it be easier to create a configuration parameter $499=1 to invert and in ioSender a Macro to change the value of $499=0 or 1?
Another way that would solve my case would be to enable the surface probing of the A axis, where the X axis represents the width of an alliance or cylindrical piece and the A axis the circumference. But I don't know if I would need to change it in GrblHAL or in ioSender.
I made the map for the Makerbase MKS TinyBee board, and it is working perfectly, I will make it available so that other users can use the updated map.
But I don't know if I would need to change it in GrblHAL or in ioSender.
The change has to be made in ioSender - not something I want to attempt without a machine with a rotary axis.
... and it is working perfectly
Great, you implemented it via a M-code?
It still didn't work!
I'll try to simplify what I need, because the way I tried to do it wasn't good.
I need to create parameter $499 (Invert Axis).
$499=0 (normal mode)
$499=1 (inverted mode)
I need that every time I change the $499 setting the grblHAL changes the pins without needing to restart the firmware.
I made the map for the Makerbase MKS TinyBee board, and it is working perfectly, I will make it available so that other users can use the updated map.
mks_TinyBee_1_0_map.h
/* mks_TinyBee_1_0_map.h - An embedded CNC Controller with rs274/ngc (g-code) support
Driver code for ESP32
Part of grblHAL
Copyright (c) 2022 Evan F. Gos
Grbl is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Grbl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Grbl. If not, see http://www.gnu.org/licenses/. */
// timer definitions
// Pin mapping when using SPI mode. // With this mapping, SD card can be used both in SPI and 1-line SD mode. // Note that a pull-up on CS line is required in SD mode.
// Define ganged axis or A axis step pulse and step direction output pins.
// Define ganged axis or B axis step pulse and step direction output pins.
// Define spindle enable and spindle direction output pins.
// Define flood and mist coolant enable output pins.
// Define user-control CONTROLs (cycle start, reset, feed hold) input pins.
// N/A
// Define probe switch input pin.
// Define I2C port/pins
It still didn't work!
You have to modify driver.c to get it to work. Add a bool variable to control the pin swapping and a function to set it. Call the function either when the setting is changed or when a M-code is issued. IMO it is best to use a M-code as this does not write anything to flash...
Hello, I need a suggestion on how to create a function in settings to flip pins from Y axis to A axis.
Example: $499=0 (Normal mode)
define Y_ENABLE_PIN I2SO(4)
define Y_STEP_PIN I2SO(5)
define Y_DIRECTION_PIN I2SO(6)
define Y_LIMIT_PIN GPIO_NUM_35
/ /Define ganged axis or A axis step pulse and step direction output pins.
if N_ABC_MOTORS > 0
define M3_AVAILABLE
define M3_ENABLE_PIN I2SO(7)
define M3_STEP_PIN I2SO(8)
define M3_DIRECTION_PIN I2SO(9)
endif
When changing the setting invert the pins Example: $499=1 (Invert Y and A axis)
define Y_ENABLE_PIN I2SO(7)
define Y_STEP_PIN I2SO(8)
define Y_DIRECTION_PIN I2SO(9)
define Y_LIMIT_PIN GPIO_NUM_35
/ /Define ganged axis or A axis step pulse and step direction output pins.
if N_ABC_MOTORS > 0
define M3_AVAILABLE
define M3_ENABLE_PIN I2SO(4)
define M3_STEP_PIN I2SO(5)
define M3_DIRECTION_PIN I2SO(6)
endif
In this way, using ioSender, I can use a probe on the rotating axis on cylindrical people, being able to map the probe.