Adding encoder to stepper motor and adding a buffer to Stepper Motor controll

More
02 Aug 2018 04:01 #115370 by flexbex
Hey I am quite in the beginning of building my first CNC. But I had some ideas I wanted to implement on it. Maybe someone could point me to existing projects and or give me feedback on it. My plan is to put LINUX CNC on a RPI and controll the motors from there.

So first I heard that it is a problem that Linux like most OS is not a realtime OS and due to this the motors have to run slower as the Controll signal for the motors is not guaranteed to be exact. Hope this is understable. So my idea was to put a barebone Mikrocontroller in between the Motordriver and my RPI controll unit. The purpose of the Mikrocontroller would simply be to function as a buffer which can handle precise Signal generation better.

Second idea was concerning my stepper motors. I heard that it is the problem when they run faster that they can loose steps. To tackle this I had the idea to build an encoder which keeps track of the steps. And to get feedback of motor position. So basically creating a closed loop setup. I have some simple encoders at home which could fullfill the purpose. But they are only 128 steps per revolution. So I thought maybe I could build my own Encoder by printing out a black and white stripe which goes around the coupling of the motor and read it out with a laser and a light sensor. Assuming that the black stripes consume enough laser light and the white reflect enough.

But these are just some ideas as I really don't know much about CNC untill now. I would be happy to get some feedback.

Thanks a lot
Felix

Please Log in or Create an account to join the conversation.

More
02 Aug 2018 05:45 #115372 by tommylight
Linux has two types if Real time kernels so you can choose depending on the hardware you want to control, and the signal is very precise for what we use it.
Using RPI for machine control is doable and there are plenty being used for that, but all of them have some other hardware for generating steps as RPI has a huge latency due to power saving. Investing on a RPI and other hardware is not a good idea as you can buy used computers for less money and do much more with them, like directly controlling a machine through parallel port. The only good thing is the size of the RPI.
Stepper motors do not like to spin fast, and they will stall completely at a certain speed, so using encoders is a viable solution, except that would require having drives that can change the current going to motor winding on the fly, and that is not easy to achieve, but at least it can report that it lost position even with simple drives.
128 PPR is not enough for what you need it as the motors have usually 200 steps per revolution so you would need at least that to have a decent position control, although 128 times 4 is 512, so it can be used.
Making a high resolution encoder is not that easy, so if you do make one please let us know, we can respect that !

Please Log in or Create an account to join the conversation.

More
02 Aug 2018 09:22 #115384 by flexbex
Hey
yes you are right using a desktop pc is definitly the better solution.

For the encoder do I really need 4 times the resolution. I think the best option is to have the exact same amount of pulses per revolution.

But i don't want to invent the wheel new. I just was hoping to find some projects I could contribute in.

Please Log in or Create an account to join the conversation.

More
02 Aug 2018 17:06 #115415 by jmelson
What is the problem with 4X resolution? The encoder counter hardware needs to detect all 4 state transitions of the quadrature signal anyway to detect direction, so why not use it?

But, unless your encoders have very low resolution, and you move quite slowly, you do need hardware encoder counters to not miss counts.

Jon

Please Log in or Create an account to join the conversation.

More
02 Aug 2018 17:38 - 02 Aug 2018 17:51 #115419 by flexbex
Oh now I understand what he said. Just didn't understandin the first place. It's an idea! But I realized that they are also mechanical so they won't stand the amount of revolutions which is needed on a cnc. So can't use it. I really would like to try out more of encoders. But I guess it's not worth it. Found stepper motor for round 130 euro including encoder. And without 20 Euro less.

[update]

any knowledge about this one. Would be an option.
www.renishaw.com/en/new-am4096-12-bit-ma...-encoder-chip--10829
Last edit: 02 Aug 2018 17:51 by flexbex.

Please Log in or Create an account to join the conversation.

More
02 Aug 2018 17:45 #115420 by tommylight

Please Log in or Create an account to join the conversation.

More
02 Aug 2018 17:53 #115421 by flexbex
thx. But I think it's too small for my CNC. I will ask

Please Log in or Create an account to join the conversation.

More
02 Aug 2018 17:57 #115423 by tommylight

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.278 seconds
Powered by Kunena Forum