Adjustment of feed override with a potentiometer

More
10 Jun 2020 17:58 #170981 by Louis_V
Hi! I need help in configuring my HAL file to adjust the feed override with a potentiometer. I upgraded a Bridgeport Interact 1 cnc mill. I have a 555 IC providing 5V "steps" to the encoder 04 pins of my Mesa 7i77 card. The signal looks good on my oscilloscope. The frequency from the 555 can be varied with the pot from 20Hz to 160Hz. I am using phase A only of encoder 04 connector (single ended). The ground wire is also connected. I tried using the MPG input 16 rather than the encoder 04, but it I didn't succeed. I also have a switch to enable feed override. When I turn on the switch, the cursor on the "axis" screen for feed override flickers back and forth quickly from 0 to 100 to 0. I change the scale for FO in my HAL for other values, but the cursor of FO will still moved quickly back and forth. My lines in my HAL file for feed override are:

net fo_enable <= hm2_5i25.0.7i77.0.0.input-15
net fo_count <= hm2_5i25.0.encoder.04.count
setp halui.feed-override.direct-value false
setp halui.feed-override.scale 1
net fo_enable => halui.feed-override.count-enable
net fo_count => halui.feed-override.counts

I read several posts on the subject, but I couldn't figure out what I am doing wrong. Any help is welcome!

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

More
10 Jun 2020 19:26 #170987 by fixer
this is not what you are asking, but the first few (3?) inputs on 7i77 can be set to analog input mode with this command:
loadrt hm2_pci config=" sserial_port_0=200xxxxx"
The following user(s) said Thank You: Louis_V

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

More
10 Jun 2020 19:33 #170989 by tommylight
From what you are describing, the wires are incorrect as it seems your encoder is wired where the switch should be.
Just in case
input00 in hal is physical pin 1 on the Mesa board header.
And most probably it will not work with just phase A, it has no way of knowing if it should count up or down, so you need phase A and B.
The following user(s) said Thank You: Louis_V

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

More
10 Jun 2020 20:25 #170997 by PCW
That is correct, the 7I77 MPG inputs have no counter mode, and only work with quadrature inputs.
The following user(s) said Thank You: tommylight

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

More
11 Jun 2020 03:52 #171071 by PCW
1. The encoder will not count with just 1 input unless you select counter mode
2. Why don't you use the 7I77 analog inputs?
The following user(s) said Thank You: Louis_V

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

More
11 Jun 2020 12:34 #171125 by Louis_V
Thanks for the information. It's much appreciated! I will try using the 7i77 analog inputs, with the addition of the command loadrt hm2_pci config=" sserial_port_0=200xxxxx" as mentioned by fixer.

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

More
13 Jun 2020 20:21 #171482 by Louis_V
I connected the feed override potentiometer to the 7i77 analog input input 0 (pin 1, TB8) and it works perfectly!

Here are the lines of my HAL fine in case someone runs into the same issue:

# added to convert fload to s32 for feed override:
loadrt conv_float_s32 count=0
addf conv-float-s32.0 servo-thread

# ---potentiometer wiper connected to analog pin input 0---
# ---fo_count converted from float to s32 into fo_fount_conv

net fo_count <= hm2_5i25.0.7i77.0.0.analogin0 conv-float-s32.0.in
net fo_count_conv conv-float-s32.0.out

# ---connect converted value of analog input 0 to feed override counts---

setp halui.feed-override.direct-value false
setp halui.feed-override.scale 0.1
net fo_count_conv => halui.feed-override.counts

Thanks again for your help!
Attachments:
The following user(s) said Thank You: FariaAl, TREFAB

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

Time to create page: 0.119 seconds
Powered by Kunena Forum