Set 0's first to turn off one direction before turning on reverse. This effectively checks if it's less than 2^4, ie. noise you're seeing and it and should be ignored. If the mean is very low, then the plasma is turned off - it's just ADC so your shit will be totally broke if you don't set SAMP to a power of 2. Since we are using bitshifting instead of division, I'm using a != here, We need to calculate how big the shift must be, for a given sample size. Do a few throwaway reads so the ADC stabilizes, as recommended by the docs.ĪnalogRead(PLASMA) analogRead(PLASMA) analogRead(PLASMA) analogRead(PLASMA) analogRead(PLASMA) Set the reference voltage to the external linear regulator Unsigned long target = 0 // voltage target, in ADC counts Unsigned long disp = 0 // for separately tracking ADC reads for the display Unsigned long total = 0 // for keeping a rolling total of the buffer The pins follow the schematic and were picked to try to make it lay out nicely.īyte segmentPins = // buffer for ADC reads Need this for my common-cathod sevseg LCD. (c) The Swolesoft Development Group, 2019 With that, as well as additional YouTube videos and files coming soon. LinuxCNC's HAL configs to only respect the THC's signals once the torch isĬutting and is not piercing or cornering. Is not cutting (since the voltage will be 0), so it is important to use Secondly, this is going to be giving the "UP" signal whenever the plasma Update the display several times a second and give it a much, much longerĪverage. Last I checked, this wasĪble to do about 6000 samples per second, whereas the maximum you could getįrom simply looping analogRead() is supposed to be 9000 samples per secondįirstly, while we let the signals for the plasma change rather rapidly, we only Reset button), using bitwise shifts for division, etc. Like only reading the setpoint on startup (so if you want to adjust it, hit the I do a few tricks in here to make sure the loop() function runs quickly. LinuxCNC can't respond fast enough when the torch height really is changing. The signal's stability a bit, but we can't do too much, since otherwise, the There's a little bit of smoothing that goes into to the ADC reads to improve Then it reads the analog pin for the plasma voltage, doesĬomparisons to that setpoint, and triggers the optocouplers accordingly. The gist of how this is works is, on startup, you read the potentiometer and Goes along with the board schematic in this repo. The THC code I need help modifying or including in the grbl code. Help getting the code to play nice inside Grbl code and using a Mega 2560 would be fantstic. I just need help getting the code changed to command a stepper motor driver using step and direction instead of UP Down. The code I'm going to show and link is setup to send commands to linuxCNC and then it tell the machine what to do. It should even be possible to use 1 Mega 2560 to run both Grbl and THC. The setup I would love to go with uses a Nano, a 10K pot, a 7 segment 4 digit lcd and some other small elec components to achieve the same thing with far less fuss. I currently have a setup that uses a nextion screen and 2 mega 2560's, but it's more complicated than I want using a slider button on the screen to adjust the target voltage for the current cut, and it doesn't always work smooth. Changing code functions like I am hoping to receive help with, I know nothing. I'm know enough to change pin locations and basic parameters in Arduino IDE. As the metal heats during the cuts, it moves, so torch height needs to move the hold same distance relative to the shifting metal surface being cut. There is an optimal distance that needs to be maintained for optimal cuts. Basically the THC reads plasma voltage which is directly related to the height of the tip from cutting surface. The THC function needs only control the Z axis while torch is cutting, the grbl controls Z axis to set Z zero before each cut. I am currently using an Arduino Mega 2560 with grbl and a breakout board to control the table. I am looking to add THC (torch height control) to my plasma table.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |