Go Down

Topic: Low Cost DIY DC MOTORS CNC (Read 4 times) previous topic - next topic


Sep 27, 2012, 05:15 pm Last Edit: Sep 27, 2012, 05:17 pm by bragajam Reason: 1

I've been working in a project for a low cost CNC using simple DC Motors.

At the moment i managed to do motion control part of the project using arduino's PID library, I can say that theres no overshoot in position although i'm not using motors full power(power is limited).

I'm now working/researching in 2 axis  interpolated movement, found the bersengh...whatever algorithm but im not sure if thats the best approach.

There's a lot to be done and help would be welcome.

Java interface - I managed to communicate between arduino and a java application but the com's protocol can/must be improved  

                   - G-code interpreter is to be done (only g00 and g 01 for now). it would be taken in the java app and then sent to arduino in a simpler way
                   - trajectory lines on java interface. (already started to mess with some java drawing api and doesnt seem too hard)

on the arduino side :
                    - mainly the interpolated movement of the axis

Here some videos of what i've been doing (not edited and some of them are boring)

Colabs or suggestions are welcome and appreciated.

Please just don't ask me why wont i use stepper motors instead of DC.

Best regards,
Paulo J. Martins


"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

????? ???? !



I'm in Portugal (Europe) if thats what u are asking.


Ok I'm in India so I can help/consult you software wise however I have experience in developing hardware too when things are very far from me but software would be easy if that is needed let me know.
"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

????? ???? !


Sep 27, 2012, 10:56 pm Last Edit: Sep 27, 2012, 11:18 pm by bragajam Reason: 1
Ok thanks for your reply.

i'm not there yet but i think that data flow control might be a problem.

i'm thinking that i could interpret the g-code in the java app instead of sending the g-code to arduino and interpret it, compute and only then, send for instance

x:100 ' to move x axis 100  points to left or
X:100 (notice the upper case) to move x axis 100 points to right (i'm using relative positioning by the way)

X100Y1000 would be interpolated trajectory

I'm using USB so i think i cant use the RS232(DB9) pins DRS DTR (maybe these are not correct i'm writing from memory) to control the data flow.
I cant send another command before it reaches the setpoint (at least more than the buffer can take).

in the arduino part im thinking about 2 ways i could do the interpolated moves (both axis must arrive at same time no matter what):

lets say i want to move x 100 points and y 50. the declive would be 1/2 for each 10 points of x axis, y axis should move 5.
so i could define a fast time interval in which i would verify if this condition is satisfied.

another way could be introduce another factor(lets call it DA) in the PID error expression  output = (Kp*error) + (Ki*integral) + (Kd*derivative) + DA;
where DA would be like  DA = (Kp1*delta) + (Ki1*integral1) + (Kd1*derivative1);
where delta is something like (X/Y -encoderX/encoderY) that should in the suggested case be 2;  'that would change considering whether x>y or y>x

Its the firs time i'm thinking about these problems...what are your thoughts about it?
I'm not an expert in programming, i learn while im doing things, as i go along. So if anyone thinks i'm out of the track please put me back on.

Best regards

Go Up