No enc0 counts on 7i77 with MPG
15 May 2021 00:29 #208877
by arvidb
No enc0 counts on 7i77 with MPG was created by arvidb
I'm trying to cobble together a rather temporary pendant using a 7i77 and an MPG. I get no counts on hm2_5i25.0.7i77.0.0.enc0.count - Hal Meter shows it as 0. Same thing with the other enc0 signals. I'm running axis_mm and simply added this hal file:
On the 7i77 LEDs CR1, 3, 6, 7 are on, CR15 blinks at about 1 Hz. I have +5 V to the MPG (taken from the RS422-EXP port) and using a multimeter I can see that I have signals on TB7 pin 1 & 2 when I turn the MPG. (I have checked the MPG with an oscilloscope earlier and confirmed valid quadrature signals.) Field power is about 17 VDC.
What have I missed?
Mesa version info:
loadrt hostmot2
# Set sserial port 0 to mode 3: mpg on inputs 16-19
loadrt hm2_pci config="sserial_port_0=300xxx"
addf hm2_5i25.0.read servo-thread
addf hm2_5i25.0.write servo-thread
# for MPG enc0:
# A --> 7I77 field input TB7 1 (IN 16)
# B --> 7I77 field input TB7 2 (IN 17)
# Vcc --> +5V
# Gnd --> +5V common --> field I/O common
setp joint.0.jog-enable 1
setp joint.0.jog-scale 1.0
net j0-jog-count hm2_5i25.0.7i77.0.0.enc0.count => joint.0.jog-counts
setp joint.0.jog-vel-mode 0
On the 7i77 LEDs CR1, 3, 6, 7 are on, CR15 blinks at about 1 Hz. I have +5 V to the MPG (taken from the RS422-EXP port) and using a multimeter I can see that I have signals on TB7 pin 1 & 2 when I turn the MPG. (I have checked the MPG with an oscilloscope earlier and confirmed valid quadrature signals.) Field power is about 17 VDC.
What have I missed?
Mesa version info:
$ sudo ./mesaflash --device 5i25 --sserial
SSLBP port 0:
SSLBP Version: 1.43
SSLBP Channels: 6
SSLBP Baud Rate: 2500000
sserial device at channel 0: 7I77 GPIO (unit 0x120000C2)
SwRevision = 14
NVBaudRate = 2.5Mb
NVUnitNumber = 0x120000C2
NVWatchDogTimeout = 50ms
SOFTWARE MODE Input_Output [index 00]
SOFTWARE MODE IO_Analog [index 01]
SOFTWARE MODE IO_Analog_FieldVoltage [index 02]
SOFTWARE MODE IO_Encoder_Analog_Fieldvoltage [index 03]
sserial device at channel 1: 7I77 ANALOG (unit 0x110000C2)
SwRevision = 14
HwRevision = 1
NVBaudRate = 2.5Mb
NVUnitNumber = 0x110000C2
NVWatchDogTimeout = 50ms
SOFTWARE MODE AnalogOut_Enables [index 00]
$ linuxcnc
LINUXCNC - 2.9.0~pre0
Machine configuration directory is '/home/arvidb/linuxcnc/configs/sim.axis-dev'
Machine configuration file is 'axis_mm.ini'
Starting LinuxCNC...
Found file(lib): /home/arvidb/src/arvidb-linuxcnc/lib/hallib/core_sim.hal
Note: Using POSIX realtime
Found file(lib): /home/arvidb/src/arvidb-linuxcnc/lib/hallib/sim_spindle_encoder.hal
Found file(REL): ./mpg.hal
hm2: loading Mesa HostMot2 driver version 0.15
hm2_pci: loading Mesa AnyIO HostMot2 driver version 0.7
hm2_pci: discovered 5i25 at 0000:04:00.0
hm2/hm2_5i25.0: Low Level init 0.15
hm2/hm2_5i25.0: Smart Serial Firmware Version 43
Board hm2_5i25.0.7i77.0.0 Hardware Mode 0 = standard
Board hm2_5i25.0.7i77.0.0 Software Mode 0 = input_output
Board hm2_5i25.0.7i77.0.0 Software Mode 1 = io_analog
Board hm2_5i25.0.7i77.0.0 Software Mode 2 = io_analog_fieldvoltage
Board hm2_5i25.0.7i77.0.0 Software Mode 3 = io_encoder_analog_fieldvoltage
Board hm2_5i25.0.7i77.0.1 Hardware Mode 0 = standard
Board hm2_5i25.0.7i77.0.1 Software Mode 0 = analogout_enables
hm2/hm2_5i25.0: 34 I/O Pins used:
hm2/hm2_5i25.0: IO Pin 000 (P3-01): IOPort
hm2/hm2_5i25.0: IO Pin 001 (P3-14): IOPort
hm2/hm2_5i25.0: IO Pin 002 (P3-02): IOPort
hm2/hm2_5i25.0: IO Pin 003 (P3-15): Smart Serial Interface #0, pin tx1 (Output)
hm2/hm2_5i25.0: IO Pin 004 (P3-03): Smart Serial Interface #0, pin rx1 (Input)
hm2/hm2_5i25.0: IO Pin 005 (P3-16): Smart Serial Interface #0, pin tx0 (Output)
hm2/hm2_5i25.0: IO Pin 006 (P3-04): Smart Serial Interface #0, pin rx0 (Input)
hm2/hm2_5i25.0: IO Pin 007 (P3-17): Muxed Encoder Select #0, pin Mux Select 0 (Output)
hm2/hm2_5i25.0: IO Pin 008 (P3-05): Muxed Encoder #0, pin Muxed A (Input)
hm2/hm2_5i25.0: IO Pin 009 (P3-06): Muxed Encoder #0, pin Muxed B (Input)
hm2/hm2_5i25.0: IO Pin 010 (P3-07): Muxed Encoder #0, pin Muxed Index (Input)
hm2/hm2_5i25.0: IO Pin 011 (P3-08): Muxed Encoder #1, pin Muxed A (Input)
hm2/hm2_5i25.0: IO Pin 012 (P3-09): Muxed Encoder #1, pin Muxed B (Input)
hm2/hm2_5i25.0: IO Pin 013 (P3-10): Muxed Encoder #1, pin Muxed Index (Input)
hm2/hm2_5i25.0: IO Pin 014 (P3-11): Muxed Encoder #2, pin Muxed A (Input)
hm2/hm2_5i25.0: IO Pin 015 (P3-12): Muxed Encoder #2, pin Muxed B (Input)
hm2/hm2_5i25.0: IO Pin 016 (P3-13): Muxed Encoder #2, pin Muxed Index (Input)
hm2/hm2_5i25.0: IO Pin 017 (P2-01): IOPort
hm2/hm2_5i25.0: IO Pin 018 (P2-14): IOPort
hm2/hm2_5i25.0: IO Pin 019 (P2-02): IOPort
hm2/hm2_5i25.0: IO Pin 020 (P2-15): IOPort
hm2/hm2_5i25.0: IO Pin 021 (P2-03): IOPort
hm2/hm2_5i25.0: IO Pin 022 (P2-16): IOPort
hm2/hm2_5i25.0: IO Pin 023 (P2-04): IOPort
hm2/hm2_5i25.0: IO Pin 024 (P2-17): Muxed Encoder Select #6, pin Mux Select 0 (Output)
hm2/hm2_5i25.0: IO Pin 025 (P2-05): Muxed Encoder #3, pin Muxed A (Input)
hm2/hm2_5i25.0: IO Pin 026 (P2-06): Muxed Encoder #3, pin Muxed B (Input)
hm2/hm2_5i25.0: IO Pin 027 (P2-07): Muxed Encoder #3, pin Muxed Index (Input)
hm2/hm2_5i25.0: IO Pin 028 (P2-08): Muxed Encoder #4, pin Muxed A (Input)
hm2/hm2_5i25.0: IO Pin 029 (P2-09): Muxed Encoder #4, pin Muxed B (Input)
hm2/hm2_5i25.0: IO Pin 030 (P2-10): Muxed Encoder #4, pin Muxed Index (Input)
hm2/hm2_5i25.0: IO Pin 031 (P2-11): Muxed Encoder #5, pin Muxed A (Input)
hm2/hm2_5i25.0: IO Pin 032 (P2-12): Muxed Encoder #5, pin Muxed B (Input)
hm2/hm2_5i25.0: IO Pin 033 (P2-13): Muxed Encoder #5, pin Muxed Index (Input)
hm2/hm2_5i25.0: registered
hm2_5i25.0: initialized AnyIO board at 0000:04:00.0
Found file(lib): /home/arvidb/src/arvidb-linuxcnc/lib/hallib/axis_manualtoolchange.hal
Found file(lib): /home/arvidb/src/arvidb-linuxcnc/lib/hallib/simulated_home.hal
note: MAXV max: 53.340 units/sec 3200.400 units/min
note: LJOG max: 53.340 units/sec 3200.400 units/min
note: LJOG default: 30.480 units/sec 1828.800 units/min
note: jog_order='XYZ'
note: jog_invert=set([])
task: main loop took 0.054628 seconds
Please Log in or Create an account to join the conversation.
15 May 2021 00:39 #208878
by arvidb
Replied by arvidb on topic No enc0 counts on 7i77 with MPG
Attachments:
Please Log in or Create an account to join the conversation.
15 May 2021 00:42 #208879
by PCW
Replied by PCW on topic No enc0 counts on 7i77 with MPG
What is the MPG output swing?
The MPG encoder inputs have a higher than TTL threshold = 2.5V with 20% hysteresis so you may need pullups to 5V
The MPG encoder inputs have a higher than TTL threshold = 2.5V with 20% hysteresis so you may need pullups to 5V
Please Log in or Create an account to join the conversation.
15 May 2021 00:51 - 15 May 2021 00:53 #208880
by arvidb
Replied by arvidb on topic No enc0 counts on 7i77 with MPG
The MPG output high level is approximately 3.7 V, measured with oscilloscope on the screw heads on TB7 1 & 2. (Edit: probe GND not hooked up but 'scope and computer share protective earth and low level checked out at close to 0 V.)
Last edit: 15 May 2021 00:53 by arvidb.
Please Log in or Create an account to join the conversation.
15 May 2021 01:36 #208883
by arvidb
Replied by arvidb on topic No enc0 counts on 7i77 with MPG
I tried adding 10 kΩ pullups but as suspected (given the 3.7 V high level) it didn't make a difference.
Please Log in or Create an account to join the conversation.
15 May 2021 01:43 #208884
by arvidb
Replied by arvidb on topic No enc0 counts on 7i77 with MPG
As a sanity check I've also confirmed that signals from the normal field inputs gets through, e.g. pulling IN24 high toggles hm2_5i25.0.7i77.0.0.input-24.
Is hm2_5i25.0.7i77.0.0.input-16 (and 17) supposed to toggle from the encoder signals? Are these inputs VFIELD voltage tolerant also in MPG mode, just with lowered threshold?
Is hm2_5i25.0.7i77.0.0.input-16 (and 17) supposed to toggle from the encoder signals? Are these inputs VFIELD voltage tolerant also in MPG mode, just with lowered threshold?
Please Log in or Create an account to join the conversation.
15 May 2021 03:54 #208888
by PCW
Replied by PCW on topic No enc0 counts on 7i77 with MPG
No, even in MPG mode inputs 16,17,18,19 have the standard 40% and 60% of field
voltage threshhold for the exported pin values.
You might try a stiffer pullup (say 1K)
voltage threshhold for the exported pin values.
You might try a stiffer pullup (say 1K)
Please Log in or Create an account to join the conversation.
15 May 2021 10:56 #208903
by arvidb
Replied by arvidb on topic No enc0 counts on 7i77 with MPG
I figured it out: no common ground between VFIELD and the RS422-EXP +5V. Weird thing is I was sure I had checked this, confirming 5 V between VFIELD GND and RS422-EXP +5V. Maybe I was too tired yesterday.
Please Log in or Create an account to join the conversation.
Time to create page: 0.087 seconds