Open JelmerV opened 9 months ago
You have included the thc.c file in driver.h - this is causing the compilation errors. The correct place is to add it in CMakeLists.txt like the other submodules by including its CMakeLists.txt and also adding it to the libraries section.
I can't seem to find a complete example of the implementation within any of the hardware drivers.
They do not use cmake for building...
Also, should STEP_INJECT_ENABLE be enabled to use THC?
Yes, but you do not need to do it. Adding #define PLASMA_ENABLE 1
to my_machine.h automatically adds STEP_INJECT_ENABLE. Note that I have not tested step injection for the RP2040 - it could be that it is not easy to get right due to using PIO for step generation and is main the reason for why I have not yet added the plugin to this driver.
Amazing, thanks for the quick reply! It compiles now so I will do some tests soon.
Do you also have advice for adding an analog input? I added the aux analog input to the inputPins
definition in driver.c
and it shows up when sending $pins
along with the inputs claimed by the plasma plugin, however, the analog input does not seem to get a description.
[PIN:10,Aux input 0,P0]
[PIN:11,Aux input 1,Cutter up]
[PIN:12,Aux input 2,Cutter down]
[PIN:9,Aux input 3,Arc ok]
[PIN:28,Aux analog input 0]
Also, when looking at the settings in IO-sender, the plasma settings show up but the $350 options are shown as "off", "N/A", and "Up/Down". Most other settings are also missing. Do you have the reason for that?
My goal is to use the first mode of operation as mentioned in the readme, where $350=0 only an analog voltage signal is needed.
Code to support analog input has to be added in ioports_analog.c - see the STM32F4xx driver for how it can be done. When added an input can be claimed, $350 will change and the description will be added.
Thanks! That is also working now. It took some tinkering but the STM32F4xx as a reference helped a lot.
Sorry for asking these basic questions but I got one more thing. I want to disable the spindle PWM feature. This pin isn't needed for plasma cutting and has an ADC for the analog input, so i want to reuse that. I believe I need to set SPINDLE_ENABLE_PWM0
false to get the basic spindle here in driver_opts.h. Modifying there works, however, I would prefer setting this from the machine definitions in the driver code, without needing to modify the core. Is there a definition that I can to disable spindle PWM and free that pin?
Hi, I am trying to use the PicoCNC board with the RP2040 for a DIY plasma cutter and am trying to get THC working. The analog input will be the ADC on GPIO28, moving the probe pin to 24. I also ordered an I2C ADC chip but that's a later step.
However, I am immediately running into problems while trying to add the plasma plugin. I added an
include "plasma.c"
withindriver.h
but it contains redefinitions of multiple functions causing the compilation to fail. (side question: why was theplasma.h
file removed in some recent change?) In summary the errors are for redefinitions of the 'digital_out', 'analog_out', 'stepperPulseStart', and 'enumeratePins' functions, and for the 'settings_changed' variable. Here is the full output:What would be the correct way of activating the plasma plugin? You mention testing this plugin already so i am also curious about the implementation that you use. I can't seem to find a complete example of the implementation within any of the hardware drivers.
Also, should
STEP_INJECT_ENABLE
be enabled to use THC?My fork of the RP2040 driver can be found here for reference: https://github.com/JelmerV/grblHAL_driver_RP2040