Steppers & Linear encoders
Please Log in or Create an account to join the conversation.
I use steppers in closed loop with glass scales on my mill with a 7i76E. Works fine.
Aciera - i note from a post elsewhere that you are using 5um scales like me. Would you be willing to post your hal and ini files? Keen to check my setup/connections and values against another working config. Also interested in any observations on accuracy, tolerances you typically get.
I found Metalmusings build thread as well and have been looking at his setup.
Cheers,
J.
Please Log in or Create an account to join the conversation.
Tests are showing following error is typically 0.02mm the vaste bulk of the time when cutting and is within 0.05mm during rapids. Also test cuts of aluminium on this small BF20 mill (G0704 equivalent) look to be within 0.02mm. This includes external cuts and internal pockets. An internal circular pocket was done as a "tough test" with the diameter coming within 0.02mm of target. There were also no signs of backlash or transition marks.
cheers,
James.
Please Log in or Create an account to join the conversation.
thank you very much for pinging your success back to this Forum, this makes your answer to the following question very valuable to this forum.
With your knowledge today, how would you do it "again":
If you would get a new (stiff) machine, having standard lead-bearing-screws on all Axis, and successfully added CNC-Steppers & Optical Linear Encoders on these axis... and hooked them up to your current LinuxCNC hardware.... What procedure did/would you follow today, to get to a working Feedback-loop going, where the encoders are actually the input to LinuxCNC to get to the wanted position ?
I ask you this, as I simply can't find any guidance here, why and what to edit in Linux-CNC from start to end, to get to a basic full-feedback-looped Machine.
Any feedback is very welcome, even if it is a rough one.
Best regards,
Ronald
Please Log in or Create an account to join the conversation.
It is worth noting that how I am getting the feedback loop into linuxcnc at the moment is a "hack". I am limited to only 2 axis as I am using the two MPG encoders under mode 2 on the 7i76. I have a 7i85S waiting to be implemented that will allow me to get 3 axis feedback using "proper" high speed encoder inputs. Having said that, what I have for the speeds my machine operates at is absoluely working.
If I was starting from scratch knowing what I know now I would probably:
1. getting better quality ball screws - I got chinese C7 ball screws - I think C5 might have been a better option.
2. some form of double nut or system that gives the same effect. There are multiple ball screw nut designs with ones that provide the same effect as the double-nut preload system while being a lot more compact. However they can be more expensive.
3. either use steppers with encoders built in or servos.
With 1,2 and 3 in place you should have might tighter mechanical accuracy and the feedback loop via the encoder. At this stage you probably dont need linear scale feedback.
However if you REALLY want that direct positional feedback then I would be looking at 1um scales. I used the 5um scales as that is what I have left over from when the mill was manual. So ... if you have them why not use them?
However 1um scales would give a good amount of extra resolution. You DO need to have motors with resolution that match though. For example if the smallest movement you can get from your stepper setup is 0.01mm per step having 0.001mm resolution on your scales it bit pointless.
Anyway, let me know if you would like my config/HAL files.
Cheers,
James.
Please Log in or Create an account to join the conversation.
Thanks getting back to me on this one.
I did not find a good introduction into the HAL Files, so I am not familiar with the HAL-Files so far.
Your proposal, commenting your own HAL-modifications with the how&why, is a great idea to get some examples into this forum, and getting beginners like myself up-to-speed , so YES, I would like to see a commented HAL for a full-feedback-drive-control-loop, thanks !
I will also use your feedback on using a possible worm-drive -like Gearbox between the stepper-motors and the X & Z -Axis, and do the math on what transfer-rate makes sense.
The same for the Linear Encoder Feedback. I intend to use 1um Resolution, 3um precision Feedback-encoders on both axis. You think having the 0,5um Encoder feedback would even be better for the feedback-loop ?
Your improvement proposal's for an open-loop Setup, makes perfectly sense. And this is axactly what I try to tackle.
There are so many hobbyists/Pro-sumers out there, people who have their beloved original Manual machine standing in their workshop, and terrified of making, large, time-consuming modifications to the machine that are not guaranteed to work perfectly and could even damage the "soul" of your loyal companion.
My Intention for the next months:
I would like to create some sort of a ground-truth on:
-Why can I not simply add appropriate Stepper-motors & Linear-Encoders to any existing (stiff) Lathe or Mill, and get great results ?
-What works, what doesn't
Wanted state:
No need to change the original Lead-Screws to ball-screws, the "Stiff-enough" Lathe/Mill, uses only the Feedback-Encoders as input to drive the Stepper-motors. All the backlash in the different Lead-Screws are irrelevant.
As the Linear-Encoders get cheaper by the Day (KA200 from Sino, 0,5um Resolution/3um precision @20 Deg.Celc, ca: $120/@10pieces), I would really like to test all this out, make some full start-to-end Video on this, with every-little detail described, so that a future beginner like myself, can simply follow the Start-End procedure.
So, I am really looking forward to my first Hands-on lesson on HAL-editing/-modification, to create a Full-loop-back in place.
AndyPugh already gave a good 3-liner on what needs to be done, but this was a very high-level description. I would love to see how this translates into the real-deal
AndyPugh wrote in #188281 :
1-PNCConf will probably add a PID component to the system (because that helps absorb the effects of jitter on an open-loop stepper system.
2-All you need to do is change the HAL to disconnect the PID feedback from the stepgen position feedback pin to the scale position pin.
3-And then add a small amount of P and I to the PID until the following error disappears.
4-The axis.L.motor-pos-fb and joint.N.motor-pos-fb pins also want to become connected to the scale output rather than the stepgen internal feedback too.
Looking forward for your Code & Comments ,
Ronald
Please Log in or Create an account to join the conversation.
I have added some annotations as comments. It's not particularly complicated. However the part that a user will need to sort for themselves is the tuning of the steppers under PID control. I'm not an expert on this and spent a lot of time searching the forums and watching youtube videos before having a go. There is a motor tuning too that is accessable like HAL Scope. This tool allows you to adjust various PID values until you get the motors responding in a manner you are happy with. Read the PID theory in the linuxcnc manual, read some of the PID tuning posts and watch some videos.
I used the simple tuning method from linuxcnc.org/docs/2.8/html/motion/pid-theory.html
I concentrated on P first getting that to a value that when doing a movement created rapid motor oscillation then dialled it back until this stopped. Make sure you check a range of motion for this. For example under an increment motion of 1mm I might be fine but an increment of 0.1mm would cause an issue.
Once I was happy with the P value I would start experimenting with I or D. In the end I decided that I was getting adequate performance with only a P setting. I found that either and I or D caused hunting. I have read of people creating a custom HAL component to suppress the hunting after a short period. Not something I bothered with in the end.
Cheers,
J.
Please Log in or Create an account to join the conversation.
I will also use your feedback on using a possible worm-drive -like Gearbox between the stepper-motors and the X & Z -Axis, and do the math on what transfer-rate makes sense.
The same for the Linear Encoder Feedback. I intend to use 1um Resolution, 3um precision Feedback-encoders on both axis. You think having the 0,5um Encoder feedback would even be better for the feedback-loop ?
My reference to resolution related to the mechanical interaction between ballscrew pitch and the amount of steps you get from a stepper motor. Of course the same goes for a the level of resolution your encoder gives you on a servo and how much that motor can practically delivery.
In my setup I have 5mm pitch on the ballscrews. My drivers are set so that I am getting 2000 steps (microsteps) per revolution. This gives me a theoretical resolution of 0.0025mm per step. However I am compromising some torque in achieving this. I could have used a lower number of steps giving me more torque but connected the motor to the ballscrew via a timing belt and suitably sized pulleys. From what I have seen this timing belt approach looks to be quite common on both servo and stepper installs. On my small mill direct drive is working fine.
The resolution of the linear scales comes down to what level of accuracy you can realistically get from both the positioning system and from the inherent rigidity of the machine. Having some super accurate encoder or positioning system is going to be a waste if the machine itself is flexing or has slope in it of say 0.01-0.02mm. This is why I decided to live with the 5um scales. I can get 0.01mm or slightly lower positional accuracy. While in theory 1um would be better and I could get more accurate positioning, the reality is my small mill has more flex in it than that. If I needed tighter tolerances then I would need to look for either a way remove the flex or get a bigger/heavier machine.
Cheers,
J.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19209
- Thank you received: 6438
quote from ? :
I have a head the size of a planet ....
Please Log in or Create an account to join the conversation.
If I get this correctly, the quote was from Ronald's previous message. Have updated my response to make that linkage.@Joco, off topic,
quote from ? :
I have a head the size of a planet ....
Please Log in or Create an account to join the conversation.