Glass scale linear encoders and steppers

More
31 Aug 2021 00:46 #219207 by ncf250sd
Hey all,
I have a working 3 axis mill with stepper motors and linear scales (5u), my drivers are set to 2000 micro-stepping.  The linear scales were from when the mill was a manual mill.  I am using a Mesa 7i76e and 5i85 card and have it hooked up with the scales now.  I flashed the card with what I believe to be the correct firmware and changed the jumpers on the 5i85 for TTL mode.  I have a few questions, but more importantly I would like some of you more experienced people to have a look and see if I am on the right track. Linuxcnc is new to me, so please go easy as I am doing this linear scale project as a learning experience.  I can get the mill to eliminate backlash using the PID loop so I think I am close; however, I am having some trouble getting smooth motion and I am not confident or truly understand the scaling settings. I cant seem to get halscope to plot any thing after selecting my pins to plot?  I have attached two sets of hal and ini files. The first files, "pentdant2 working" are my  regular files with no scales and the machine works well and is very accurate.  The others are my modified ones.  If you would be kind enough to see if my files are correct then i can continue testing and narrow down more intelligent questions.  BTW the PID settings in my file are just the most recent test settings, I have tried numerous,  I appreciate any help or suggestions.  

My initial questions are:
1. is my encoder scale correct at 5000?
2. Any glaring errors in my hal or ini files?


 
 
Attachments:

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

More
31 Aug 2021 01:50 #219209 by JohnnyCNC
Watching with interest. I have a very similar setup and history and have thought I might like to try this someday. Right now I'm just using software backlash compensation.

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

More
31 Aug 2021 03:00 - 31 Aug 2021 03:22 #219212 by PCW
Halscope has a bug that requires you to stop the plot and
restart the plot after adding channels, that may be why
you are not getting data plotted.

I noticed the stepgen maxaccel was set to 1000 for X.
I would just set it to twice the per axis accel (so 60)
Last edit: 31 Aug 2021 03:22 by PCW.

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

More
31 Aug 2021 10:14 #219233 by ncf250sd
Thank you, I will go back to accel 60 and continue to work with halscope.

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

More
31 Aug 2021 10:51 - 31 Aug 2021 10:57 #219235 by Joco
I did essentially this with my mill.   I am still using the two mpg encoders in mode 4 for X and Y axis. I When I redo the spindle motor and rebuild the enclosure I will go to a "proper" encoder daughter card for all 3 axis.

Anyway, I believe the same concept applies.  I have an encoder scale of 200 as for a 5um scale there are 200 counts/pulses per 1mm of travel.  1mm being the base machine unit.  i.e. 1/200 = 0.005

I am also using Nema 34 steppers on all axis under 48V power and 2000 steps per rev.

My HAL and ini file attached for reference so you can see the PID settings I used and the encoder connections into the PIDs.

I can say that the approach works REALLY well.  I tend to get ~20 mircon tolerance on parts by doing roughing operations then a final 2 pass finishing operation.

If there were 3 MPGs on the 7i76 I would just stick with the onboard encoders. They cope with the speeds I run at with no problems.

Cheers - James.
Attachments:
Last edit: 31 Aug 2021 10:57 by Joco.

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

More
31 Aug 2021 12:12 #219240 by ncf250sd
Thank you for your reply,
The scale settings are confusing to me because I am working in inch and a lot of the reading i am doing seems to be metric.

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

More
31 Aug 2021 19:04 #219273 by Joco
Ah, you are working in bananas. 

So 25.4mm per banana.  200 x 25.4 = 5080 scale.

Just as a word of warning that just because a glass scale SAYS it 5u it might not be bang on.  I did some checks with a DI and found one of my scales did not have a perfect 200 pulses/mm.  Once i adjusted the scale value she was bang on.  If you read a DRO manual they normally have a compensation section designed to deal with small errors in the scales.  Adjusting the scale setting is doing the same process. 

cheers.

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

More
31 Aug 2021 19:52 #219279 by ncf250sd
Thank you for clarifying that. I really only got to the 5000 by trial and error, now i understand logic.

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

More
31 Aug 2021 23:52 #219296 by ncf250sd
Hey Joco'
I see in your hal file a section called "calculate real following error". Do i need this in my hal file. BTW, the encoder scale you helped me with made a world of difference.

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

More
01 Sep 2021 04:08 #219307 by Joco
Hi - great that the scale has helped
I used the section of HAL you mention to gather detailed samples of the what the following error is. I use a Sampler hal component to gather that data.

So not needed to actualy have a running machine.

Cheers - J.



 
The following user(s) said Thank You: my1987toyota, ncf250sd

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

Time to create page: 0.079 seconds
Powered by Kunena Forum