How much of this welder is missing? The amperage control and wire feed? Are you trying to build a spool gun or do you have the original gun?
In your code you might want to verify what value you're analogReading. Pots can get scratchy and that might be the cause of your jerky motor. It would also be a good idea to use some smoothing; something like:
void loop()
{
if (analogRead(analogPin) > val && val < 1024) {
val += 1;
} else if (analogRead(analogPin < val && val > 0) {
val -= 1;
}
analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
delay(10); // creates a smoother ramp up/down
}
Coding it this way, if your analogRead() values are jumping around (due to interference or such) then that won't be reflected in the motor.
I'm struggling to imagine any situation where I'd want a home made welder instead of a decent quality production one.
That situation would be immediately following seeing the price of a 290A welder.