How to test linear encoders?

More
15 Mar 2021 20:35 #202404 by Markyd
My end game here to to provide position feedback for my 3 axis mill with glass scales. I have got as far as wiring the scales upto a 7i85s that is plugged into a 7i96. I can use the Watch window to view the encoder counts. The figures look sensible as I have a count of 200 per mm which corresponds to the 5um scales i have.

Where next? I'd ideally like to display the output in mm in axis. Is there an easy way to do this without going as far as linking them to the actual position feedback signals? Can I create my own signals and display those?

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

More
15 Mar 2021 21:29 #202417 by tommylight
linuxcnc.org/docs/2.8/html/
The "Virtual Control Panels" section, several ways of doing it.
The following user(s) said Thank You: Markyd

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

More
17 Mar 2021 15:26 #202604 by andypugh
Linking them to the joint.N.motor-pos-fb pins will actually display the positions in mm in Axis. I know you said that you didn't want to do that, but it will work if you can move the axes (or just the scales) with LinuxCNC disabled.

If you leave any other feedback unchanged all that will happen is F-error faults if the settings are wrong. The feedback to the motor-pos-fb is used _only_ to detect following-errors.

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

More
17 Mar 2021 17:31 #202607 by Markyd
Replied by Markyd on topic How to test linear encoders?
Andy, it ironic, I didn't include hand wheels on my conversion after reading in your build log that you'd not used them and wondered why you'd gone to all the effort of including them! Mine's a Harrison vertical.

I was trying to compare the commanded position with actual to look at how accurate it is, and what the backlash looks like, before going the whole hog and connecting it up properly in hal. If I can get the scale component to work I think ill just use the watch window instead of trying to add them to axis.

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

More
17 Mar 2021 18:25 #202615 by andypugh
As long as the PID gets the feedback from the same place as before, you can connect the scales to motor-pos-fb and move the axes under power.
You will know that you have the scales set up right when you don't get an f-error :-)

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

More
17 Mar 2021 19:30 - 17 Mar 2021 19:47 #202622 by Markyd
Replied by Markyd on topic How to test linear encoders?
not sure i follow Andy,

what is the source of the motor feedback currently (its a stepper system), is it hm2_[HOSTMOT2](BOARD).0.stepgen.00.position-fb ? My hal is from JohnT's 7i96 config tool, hence the [HOSTMOT2](BOARD) syntax.

Does the axis DRO take motor.0.pos-fb as it's input signal?

what woul happen if i test the x axis by connecting the y axis dro to x axis encoder? will it throw a folloing error even without me commanding movement on the y axis?


below is what i assume is the relevant part of the hal;

# position command and feedback
net emcmot.0.pos-cmd joint.0.motor-pos-cmd => pid.0.command
net motor.0.pos-fb <= hm2_[HOSTMOT2](BOARD).0.stepgen.00.position-fb joint.0.motor-pos-fb pid.0.feedback
net motor.0.command pid.0.output hm2_[HOSTMOT2](BOARD).0.stepgen.00.velocity-cmd
setp pid.0.error-previous-target true
Last edit: 17 Mar 2021 19:47 by Markyd.

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

More
17 Mar 2021 19:57 #202630 by andypugh

what woul happen if i test the x axis by connecting the y axis dro to x axis encoder? will it throw a following error even without me commanding movement on the y axis?


Yes, as it will see an uncommanded movement.

Change
# position command and feedback
net emcmot.0.pos-cmd joint.0.motor-pos-cmd => pid.0.command
net motor.0.pos-fb <= hm2_[HOSTMOT2](BOARD).0.stepgen.00.position-fb joint.0.motor-pos-fb pid.0.feedback
net motor.0.command pid.0.output hm2_[HOSTMOT2](BOARD).0.stepgen.00.velocity-cmd
setp pid.0.error-previous-target true

To
# position command and feedback
net emcmot.0.pos-cmd joint.0.motor-pos-cmd => pid.0.command
net motor.0.pos-fb <= hm2_[HOSTMOT2](BOARD).0.stepgen.00.position-fb pid.0.feedback
net scale-fb  encoder.0.position => joint.0.motor-pos-fb
net motor.0.command pid.0.output hm2_[HOSTMOT2](BOARD).0.stepgen.00.velocity-cmd
setp pid.0.error-previous-target true

(replacing "encoder.0" with your actual encoder. probably hm2_7960.encoder.00.position)

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

More
17 Mar 2021 20:28 #202637 by Markyd
Replied by Markyd on topic How to test linear encoders?
thankyou, is this bit correct? net scale-fb ? should it contain a .0. somewhere?

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

More
17 Mar 2021 22:44 #202667 by andypugh

thankyou, is this bit correct? net scale-fb ? should it contain a .0. somewhere?


scale-fb here is a signal name. Those can be anything at all. Call it "Mary" if you want :-)
The following user(s) said Thank You: Markyd

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

Time to create page: 0.109 seconds
Powered by Kunena Forum