I need to build a small control for a welding machine. The machine needs to weld a elliptical part. Rolling the part from the center ( the welding arm stays like a pick-up arm on the part to weld) means that I need to fluctuate the speed of the motor that is rolling the piece. So, I need to know the tangential speed (arm - piece). For that I'm using a photo-transistor (IR receiver and IR emitter) and a mouse wheel that is placed (a little) in front of the arm that is touching the piece.
My problem is that I can't obtain a constant speed of the mouse wheel (the tangential speed). I think that the speed that I'm reading from the wheel isn't the right one, too.
Anyone could help me, PLEASE, to solve this problem?
This is the code:
#include <LiquidCrystal.h> #include <Stepper.h> #define steps 48
LiquidCrystal lcd(13, 12, 11, 10, 9, 6);
volatile byte rpmcount;
unsigned long rpm;
unsigned long timeold;
int speed;
Stepper stepper(steps, 7, 8 );
doesnt the welding cause strong photon emission, that disturbs the mouse wheel sensor?
does that welding arm move?
i mean: is it pressed away by the rotating elliptical part?
if yes:
can u find out the position of that arm?
the change of position together with the speed of rotation should be enough to find out the welding speed...
but i dont know the formula right now...
maybe it is similar to this (2 speed components):
RIDDICK:
doesnt the welding cause strong photon emission, that disturbs the mouse wheel sensor?
I don't know, yet!
RIDDICK:
does that welding arm move?
i mean: is it pressed away by the rotating elliptical part?
Yes it does!
RIDDICK:
can u find out the position of that arm?
the change of position together with the speed of rotation should be enough to find out the welding speed...
but i dont know the formula right now...
maybe it is similar to this (2 speed components): Parallelogram of force - Wikipedia
I think that the position of the arm isn't a big issue; I didn't try it. But if I find the position of the arm, then WHAT??? I don't know (remember) any formula related with this.
So, what should I do??
hum...
lets look at a rotational speed vR and an arm position at time t0 of x0 and an arm position at time t1 of x1...
the arm position is the distance from the center, where the arm moves on a straight line between the center and its most elongated position...
vR=1rpm
t0=0sec
t1=100msec
x0=100mm
x1=101mm
then arm moved 1.0mm to the outside in 100msec... --> ~0.01m/sec
and the rotating thingy moved between ~1.0mm and ~1.2mm... --> ~0.01m/sec..0.012m/sec
if we assume a linear path then the total distance is sqrt((1.0mm)^2+(1.0mm)^2)=~14mm --> ~0.014m/sec
this approach is similar to the approximation of pi via sectors of a circle...
Now... could you, PLEASE, be a little more explicit? The idea seems to be more than brilliant for me! But.. I do not understand well how to calculate the distance covered by the arm depending to the position.
Look, this is the part to weld:
oh
can u measure the angle of that arm?
i mean:
virtual line #1 goes through the joint of the arm (upper right circle) and the center of the part... constant length a....
virtual line #2 goes through the joint of the arm (upper right circle) and the welding head (arrow)... constant length b....
if u knew the angle ? (in radians for arduino math) between line #1 and line #2, then the distance of the arm from the center (length c) would be given by the "law of cosines":
but i dont know if the accuracy is sufficient...
can u ask the manufacturer of that machine? maybe it has some output that tells u the welding head speed... or u can tell it to use a certain speed...
The machine is not built yet. They are waiting for me to tell them how it needs to look like.
First, looked like a very simple task. But.. seems like it is quite difficult.
So, the arm does not physically exist yet. I've made the drawing just to understand the system that I suppose is the simplest way to realize the task.
The part to weld exist and cannot be modified (actuality there are about 15-20 types of that part - varies just the dimension).
The welding speed NEEDS TO BE CONSTANT and the manufacture of the parts (a workshop of a good friend of mine, not the Mercedes factory )says that needs to be about 1cm/sec. (he wants a potentiometer to regulate THE WELDING speed just in case he needs a little more fast or slow).
To determine the angle "y" I want to use a rotary encoder placed in the joint of the arm. Ok, isn't it?
is it possible that the welding head is pushed away from the center on a straight line (in ur picture the head moves on a circle, which makes the speed estimation more complicated...)?
or would that cause trouble with constant pressure on the part?
maybe position detection would be easier...
when u use really short time intervals, the inaccuracies by that "linear path assumption" become less important...
and it is not very complicated to find out the coordinates of 2 points on a circle, if u know their angles (let H be the joint of the welding arm)...
x=rcos ?+Hx
y=rsin ?+Hy
u would have 2 points on that circle and dt and the distance from the part center c (which is the size of the part at that moment) and the current rotation speed (reference variable) then...
I didn't buy the encoder yet; it was just an idea. Do you have a suggestion?
RIDDICK:
is it possible that the welding head is pushed away from the center on a straight line (in ur picture the head moves on a circle, which makes the speed estimation more complicated...)?
or would that cause trouble with constant pressure on the part?
It is not about the pressure; it's much more complicated for my friend to build the mechanical system to push away the welding head in a straight line.
RIDDICK:
maybe position detection would be easier...
I don't understand what you want to say with this! :~
RIDDICK:
when u use really short time intervals, the inaccuracies by that "linear path assumption" become less important...
Total agree with you. But... it doesn't seems to be so easy to split the ellipse in "linear path assumption"
RIDDICK:
and it is not very complicated to find out the coordinates of 2 points on a circle, if u know their angles (let H be the joint of the welding arm)...
x=rcos ?+Hx
y=rsin ?+Hy
I don't understand the "Hx" and "Hy" stuff. Could you, PLEASE, explain it to me?
RIDDICK:
u would have 2 points on that circle and dt and the distance from the part center c (which is the size of the part at that moment) and the current rotation speed (reference variable) then...
This is true and I can handle the problem from here. If you could be so kind to explain the "H" thing, then I suppose that I could start to write the code and make some experiments.
Thanks a lot for your time and knowledges that you are wasting with my problem!
i thought detecting of the position of the welding head could be easier... but it seems like ur idea is the best... so that the math gets a little bit more inaccurate...
i'm not good in engine building... just an informatician...
i never used a rotary encoder...but those i just found @ digikey use a hall sensor, which might be influenced by the welding arc...
so i cant recommend a certain encoder for ur application...
but i can write a formula:
let L be the length of that welding arm (its joint is in the point H=(Hx,Hy) -- the little circle in ur whitish sketch in the upper right corner)
let dA be the change of the angle of the welding arm (in radians)
then the welding head moved from
(Lcos ?+Hx,Lsin ?+Hy) to (Lcos(?+dA)+Hx,Lsin(?+dA)+Hy)
that is a distance of (linear path assumed):
sqrt((Lcos ?+Hx-(Lcos(?+dA)+Hx))^2+(Lsin ?+Hy-(Lsin(?+dA)+Hy))^2) = 2Lfabs(sin(dA/2)) wolframalpha
for example:
if the rotary encoder can say the position in 1° steps,
and the arm is 200mm long (a virtual straight line (the real form of the arm isnt important for the formula as long as the arm is inelastic) from the head to point H)
then u could detect head movements of 3.5mm...
i think the rotary encoder should have a resolution of 0.3° (~=~5.24radians) for that arm...
if u rotate a circle with 100mm radius once per second, then u get a welding head speed of 10.5mm/sec...
if u check the speed 10 times per second, u would have 600 segments on that circle with ~1.047198mm length each...
if u assume a linear path u get ~1.047193mm...
i think the accuracy (5ppm) is good...
would be nice to c a movie of that machine when it is working...
will it have a window in its shielding with special glass?
So, if I'll use this formula "2Lfabs(sin(dA/2))" to detect the distance made by the welding head in "dA" radians I could solve the speed problem, isn't it?
I could write a program that calculates the distance and then use this distance to detect the speed; this speed will be then compare with the "SET SPEED" (introduced by the user) and depending the result will rise or not the speed of the motor.
What do you think, does it looks like a good idea?
PS About the movie... be sure that I'll post it when the machine will work.
i would just add both components or use that rectangle formula:
c2=a2+b2
i think it might work...
but u should test it without the welding arc in the beginning (so that u can c if it works)...
u might also want to measure the time for 1 whole rotation...
have u found a good rotary encoder?
I didn't search very well for the encoder, but as I saw it is quite expensive. The idea to build one is not good. I've try it and it didn't worked well.
I'm looking to buy a interface encoder chip too, to reduce the possibility of errors of the system. I saw that the LS 7083 can handle what I need but I can't found where to buy it.
About the rotary encoder (I want an optical one) I saw that in USA is a little chipper then in Europe (at least in eBay).
I don't understand what do you want to say with "I would just add both components or use that rectangle formula: c2=a2+b2 ". This will calculate the distance from the joint of the arm to the welding head (straight line).
i meant:
a = position change of the head since last measurement
b = length of the path of the part outline since last measurement
c = estimated length of welded path since last measurement
can u use that mouse wheel sensor as a rotary encoder?
if u attach it outside of the box, it cant be disturbed by the arc...