My DIY automated pipe welding controller

HI.
I’m pretty new to arduino programming & I’m trying to make a simple little unit which will control my pipe welding kit, basically I operate the welding arc myself then I start the wire feed once the material heats up enough & after about 1/2 second I start up the turntable & then stop everything in reverse. I’ve basically got it working but I’ve got to keep tapping the up/down keys on my 16 digit keypad to set the timing, I know there’s a way of making the delay value time go up & down fast on its own when I hold the key but I cant seem to copy what people have done online, does anyone know a simple way of setting it up so when I hold one of the up or down keys the values go up at a set rate? my program so far is here as I see loads of people on here not posting their code so I have included everything, I’m using a mega 2560 also if that makes any difference?
Really grateful for any help.

FEED DELAY PROG.txt (2.25 KB)

I see loads of people on here not posting their code

It is much easier all round if you post it here directly rather than attaching it, but please use code tags when you do.

I don't know how that Key library works. If you can measure how long a key is held down then you can make it increment in bigger steps the longer it is held.

...R

Posting the whole program is acceptable and encouraged as described in this sticky post at the top of the Programming section read this before posting a programming question

However, you have not actually posted your whole program as I doubt (hope) that it does not end with

if (keypressed == 'E')outputValue3-- ;

Note my use of code tags

sorry as i said i’m trying to figure this site out myself along with learning how to program from scratch basically & did’nt know what you were calling a code tag, i’ve been really busy recently which is why i thought of just asking for some guidance as it would be handy getting this running properly as it would take some of my workload away. i’ve found a section of program online which uses the hold & case commands which works i just need to adapt it to make my value increase & decrease. i just wondered if i was missing something simple as i still have to keep using outputvalue ++ & outputvalue ++ tied together just to make my values jump in increments!
anyway i will get there just would be easier with a push in the right direction as i had to scour the internet for examples which fit my question & spent hours just finding that little program just laying out a working key hold demonstration, a lot of programs on line don’t seem to work, possibly as i have multiple library’s messing with things.

Moderator edit: Converted from all caps to all lower case (Nick Gammon)

positioner prog.txt (8.34 KB)

STOP BL**DY SHOUTING !

DID'NT KNOW WHAT YOU WERE CALLING A CODE TAG,

Well, if you had looked at read this before posting a programming question you would have known.

sorry, the keyboard I was using last night is a pain to use so I just carried on in capital's, I was'nt inferring anything just wrote in cap's.

It is very difficult to read and comprehend text that is written in capitals. In fact I think it is almost impossible for me to make sense of Reply #5.

...R

Ok Ive written this lowecase, Ive got somewhere on the number incrementing by twowling the internet for hour’s, I would like to add that I’m an engineer & have helped people on electrical / mechanical forum’s without correcting their formatting of question?, that to me just seemed pointless. I would like to add that I did read the information regarding posting on here however I went through a different page when I posted which did not seem to have the option of code tag’s. anyway thanks to the people who tried, I now know roughly how to use HOLD as you can see from my adjusted code, I just needed a program to learn from which I dug out on the internet eventually. I would like to ask if anyone know’s a more effective way of blanking the digit’s on the screen without going over them again in black as I am at present, it takes far too much time out of my code & refreshes the entire line of numbers, I have tried load’s of methods with no joy & looked for hour’s on the net, I’ve seen someone manage it but they didn’t post code. My code is quite long therefore I have to attach also I’ve blanked out my normal method of clearing the stray digit’s as it messes up my delay’s etc… I know I should be using millis instead of delay but I’m not looking for accuracy just repeatable & if not for the stray numbers left on the screen when I decrease the value the program would do.
Thankyou anyone for any useful help.

turntable program2.txt (10.9 KB)

PaulEE:
sorry, the keyboard I was using last night is a pain to use so I just carried on in capital’s, I was’nt inferring anything just wrote in cap’s.

It will be a bigger pain when I delete your thread. Turn off the caps lock key. Get a better keyboard. Sheesh!

How to use this forum

Read this before posting a programming question

Does your keyboard not let you do paragraphs either? Try to write sentences and paragraphs that people will want to read. A wall of text just makes people want to move on.

PaulEE:
HI.
I'm pretty new to arduino programming & I'm trying to make a simple little unit which will control my pipe welding kit, basically I operate the welding arc myself then I start the wire feed once the material heats up enough & after about 1/2 second I start up the turntable & then stop everything in reverse. I've basically got it working but I've got to keep tapping the up/down keys on my 16 digit keypad to set the timing, I know there's a way of making the delay value time go up & down fast on its own when I hold the key but I cant seem to copy what people have done online, does anyone know a simple way of setting it up so when I hold one of the up or down keys the values go up at a set rate? my program so far is here as I see loads of people on here not posting their code so I have included everything, I'm using a mega 2560 also if that makes any difference?
Really grateful for any help.

Have you got your basic control method right ?
Would a potentiometer foot switch make your welder more user friendly ?

apologies for the wall of writing & the cap’s, I was going warp speed at the time & grasping at straw’s hoping someone just knew a quick & easy answer, problem solved now.
I was just flapping at the time & just wrote, now I look at it I understand what you mean.
funny thing is I just carried on with the Idea of blanking numbers that I mentioned, I just incorporated the overwrite I’ve been using in the same line as the decrease button (the only place where it is needed, also it keeps the delay out of the program which keeps my delay use ok).
I still dont know how to tag my code from the reply box but here it is if anyone can learn from it.

turntable program2.txt (9.82 KB)

State code inside square brackets

Put your code here

state /code in square brackets to terminate

Top left is this symbol

</>
You can click on it with a mouse which makes things easier.[/code]

Your code however seems to exceed the allowed 9000 characters though.

Not sure how to handle that.

Not sure how to handle that.[/qoute]
Click Reply, and Attach it.

What is this intended to do?

    if (keypressed == '2')outputValue++ & outputValue++ & outputValue++ & outputValue++ & outputValue++ & outputValue++ & outputValue++ & outputValue++& outputValue++ & outputValue++ & outputValue++ & outputValue++ & outputValue++;

Do you mean:

 if (keypressed == '2')
  outputValue += 13;
if (keypressed == 'E')outputValue3-- & outputValue3-- & outputValue3--& outputValue3-- & outputValue3--& outputValue3-- & outputValue3--& outputValue3-- & outputValue3-- & (outputValue <= 100),    myGLCD.setColor(0, 0, 0), myGLCD.setFont(SevenSegNumFont),  myGLCD.printNumI('  00',260, 164, 0);

Time to do some C tutorials. This should be written more like this:

if (keypressed == 'E')
  {
  outputValue3 -= 9;
  //  I don't know what this is supposed to do: (outputValue <= 100)
  myGLCD.setColor(0, 0, 0);
  myGLCD.setFont(SevenSegNumFont);
  myGLCD.printNumI("  00", 260, 164, 0);
  }

When you make up your own coding style we can only guess at what you are trying to achieve.

my problem was I was using quick reply all the time.. I was looking for that button, found it now!, anyway yes my program has to be shrunk & I'm on that. I've got everything working now but my next problem is saving the 4 x 4 digit values when the units powered down. I've looked into eprom but it is a lot of code to get my head round. I was wondering if there's a way of just supplying the chip on a mega with battery power so the program is in effect still running & everything else like the screen & relay board shuts off? but if I did that I wondered how long a mega would last being powered continuously with no current drain from any of the pins?

I did search for a way of abbreviating the way I used the keypressed but I couldn't find a site that just lists all the ways of using it & how they work. hence I just made do! thanks for the tip. the other bit of program is for overwriting the left behind digits when going from 100 back to double figures, I've put that code only after keypressed - - statements now as it was slowing the program down. I do have a lot of bad habits all ready, the thing is I grew up writing spectrum programs when I was 12 & then learnt plc programming, cnc programming during my apprenticeship, now I'm trying to incorporate arduino & I only know what I've reverse engineered from other programs.

Hi, well part one of my project is all done now & working, the best way to learn is trial & error. here’s a pic of the finished tig welding positioner control unit with a few add on features such as microswitch start/stop lap with a timed learn mode which I added as the turntable is closed loop encoder speed controlled, therfore once a weld has been tested then it can be ran without the switch to start a flying lap. sorry for the welding language but to simplify. an arc is struck, then after a delay the welding fill wire is fed, then when a full lap of the turntable is complete the arc slopes out, wire feed & turntable stop after their delay. next up is torch height control. I’m thinking of incorporating mach3 for that with a voltage operational amp/divider circuit. any ideas welcome & I will try helping anyone in return.