Pages: [1]   Go Down
Author Topic: Reading and graphing an encoders pulses (as graphic) possible?  (Read 808 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey there,

i hope, i'm posting in the correct subforum?

I have a problem regarding three stepper-motors, equipped with encoders.
The encoders are only for contouring-error-verification, not for controlling like a closed-loop-system. And they are not in use right now

The motors are on a milling-machine. Two of them are driving the Y-axis, one the X and one the Z. And i have problems with the results, the mill creates.
Cuts that are parallel to one axis have a perfect and glossy finish (in aluminum), but interpolated cuts are kind of "bumpy"

I tried many, many things to find out, what is going wrong and nothing helped. So i am searching for a possibility to "record" the pulses from the encoders and then graph them to lines that can be viewed on a computer screen.
I know there is something ready that counts the pulses of an encoder, but i have not found anything that could graph them on a computer.

The idea is, to see if the bumpy surface is CREATED by the motor (unwanted movement of itself) , or if it becomes created by oscillations or vibrations somewhere after the motor.
Because even if i am milling the same contour in multiple rows, the bumps are perfectly lining up with the first ones. And the bumps itself have a shiny, glossy finish on them, when viewing under a magnifier. That leads me to the assumption that the bumps are created of the motor itself by some interferences, electrical errors or something like that.

So the first step in elliminating-tactic would be to find out if the bumps ARE created my the movement of the motor or if they BECOME created by something else.

And therefore i am searching for a possibility to cound and graph the pulses of the encoders on the motors, so i can simply see, if the motor turns only in one direction (when moving in a 45° angle, as it should) or if it makes other weird things (like giving two pulses in X and only one in Y or stuff like that

Is there an similar project or something like that, that could be uses as a guideline or basis structure? Sadly i am no programming expert...  smiley-cry
The encoders have 1024 pulses per revloution and the motors make approximately 80 revolutions per minute when milling


Best regards,

Marc
« Last Edit: January 15, 2013, 05:27:34 pm by Marlox » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 642
Posts: 50366
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The motors are on a milling-machine. Two of them are driving the Y-axis, one the X and one the Z. And i have problems with the results, the mill creates.
Cuts that are parallel to one axis have a perfect and glossy finish (in aluminum), but interpolated cuts are kind of "bumpy"
That is likely happening because of how you are driving the motors, not the motors themselves. Some details about the motors, the stepper drivers, and a peek at the code would be useful.

Quote
And therefore i am searching for a possibility to cound and graph the pulses of the encoders on the motors, so i can simply see, if the motor turns only in one direction (when moving in a 45° angle, as it should) or if it makes other weird things (like giving two pulses in X and only one in Y or stuff like that
Counting the pulses is one thing. Interrupts are great for that. Graphing them is a completely different matter. The Arduino, as you've no doubt noticed, doesn't have a display device by default, so there is no place to display the graph.

You'd need to send that data someplace else to be displayed, and that's where the problem will arise. If the serial port is being used to receive the M and G codes, it can't be used to send data back to the PC, because the application that is sending the data is not likely to be equipped with the ability to deal with any returned data.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

the motors are 3-phase steppers from Berger/Lahr - Positec.
And they are not driven by an arduino, i think this has been misunderstood. My english isn't that good, sorry

They are driven by a cnc-controller named USBCNC.

And i want to use (or was hoping to) an arduino only for recording and sending the pulses to the pc, not more. The serial port is unused, so it could reveive the pulses and record them for graphing later. I could also use an extra pc only for this operation, no problem.

I just want to know if there is a possibility to do this with an arduino: Revording and sending the pulses to the PC, and graphing them there

Thank you and best regards,

Marc
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 642
Posts: 50366
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino can read the encoders, although probably only one, since reading encoders works best when they are connected to external interrupt pins. The 328-based Arduinos only have 2 external interrupt pins.

What the Arduino does is increment or decrement a counter as the encoder moves one way or the other.

You can't "send a pulse" to the PC. That doesn't really mean anything. You could send data, each time the encoder sent a pulse, but even sending one byte per pulse (the minimum you can send to the serial port), the Arduino will not be able to send data as fast as the encoder can send pulses.

On the PC end, knowing that a pulse occurred, and the direction (because you send '+' or '-', for instance) isn't really enough information, since the PC won't know when the pulse from the encoder was received by the Arduino. The Arduino knows when it received the pulse, but adding some kind of time stamp to the data sent makes the problem of sending data fast enough 5 times worse.
Logged

Pages: [1]   Go Up
Jump to: