Install Advice (HOME_USE_INDEX with stepper using an encoder)

More
16 Jan 2024 07:02 #290832 by jtrantow
I finally figured out what has been going on with my configurations that use encoders, steppers, and configurations started with pncconfig. HOME_USE_INDEX with this setup ONLY works correctly when you use the encoder as the feedback signal. x-pos-fb     <=  hm2_7i96.0.encoder.00.position 

If you comment out the .hal encoder line to use x-pos-fb <= hm2_7i96.0.stepgen.00.position-fb, HOME_USE_INDEX does not work correctly. It will be off from the other configuration by (HOME-HOME_OFFSET). I'm pretty sure this is because the x-index-enable does not reset the stepgen when the index occurs. If I set HOME_INDEX_NO_ENCODER_RESET = YES when in the .ini, homing works correctly. (but I've only used moderate home latching velocities.

The 2.9 documentation for hostmot2 indicates that stepgen should have an index-enable pin but Halmeter does NOT show this pin??? I tried using net x-index-enable => hm2_7i96.0.stepgen.00.position-reset which seems close but this didn't seem to work.

 

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

More
16 Jan 2024 16:02 - 16 Jan 2024 16:07 #290878 by PCW
You need specific firmware that supports stepgen index operation.
This firmware will have a "sdi" in the file name. Here is firmware for
a 7I96 + 7I85S with shared stepgen/encoder index pins on the 7I85S
encoder inputs:  

 

File Attachment:

File Name: 7i96_7i85ssdid.zip
File Size:126 KB
Attachments:
Last edit: 16 Jan 2024 16:07 by PCW.

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

More
16 Jan 2024 23:40 #290913 by jtrantow
Thanks that makes sense. Assume this means hand edit the pncconf.

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

More
17 Jan 2024 01:26 #290920 by PCW
Yes, unless pncconf could be taught to use:

net index-enable_0 hm2_7i96s.0.encoder.00.index-enable > joint.0.index-enable

for encoder feedback setups using home to index and:

net index-enable_0 hm2_7i96s.0.stepgen.00.index-enable > joint.0.index-enable

for stepgen feedback systems using home to index.

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

More
17 Jan 2024 17:16 #290969 by jtrantow
That works well!

Using the stepgen..index-enable pin, I can home my lathe x axis using HOME_USE_INDEX to the same location using x-pos-fb from either encoder or stepgen position. This also allows the use of the encoder.position => joint.motor-pos-fb with stepgen position and HOME_USE_INDEX.

I will summarize this in www.forum.linuxcnc.org/39-pncconf/51254-...en-generated-configs

I noticed this .bit file enables a Mesa pwmgen. I'm using a pwmgen component to drive the spindle VFD which is an old Minarek 0-10V via a 50hz G540 PWM interface. Before I button everything up and hang the lathe controller back on the wall, Is there any advantage using the fpga vs software pwmgen for this application?

 

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

More
17 Jan 2024 17:48 #290971 by PCW
The pwmgen is a copy-paste mistake (there is no output pin for it), but that could be
fixed if need be.The advantage of a hardware PWMgen is it will have higher resolution,
especially at higher frequencies. This may not make much difference if its just for spindle
control, especially if the existing filter is low bandwidth.

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

More
17 Jan 2024 21:59 #290978 by jtrantow
Spindle control is working fine that way it is, so don't bother as I've buttoned things up on the lathe.

I'd like to apply the stepgen index enable fix to my mill (7i92 + 7i85S + 7i75).
Could I please get a bit file for this? (P1 - 7i75, P3 - 7i85S) No PWMgen required on this one either.

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

More
18 Jan 2024 02:56 #290984 by PCW
Config for 7I92+7I85S with shared encoder/stepgen index:

 

File Attachment:

File Name: 7i92_7i85sx1sdid.zip
File Size:107 KB
Attachments:

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

More
20 Jan 2024 06:07 #291162 by jtrantow
7i96 lathe update went perfectly, but when I flash the 7i92 mill I'm getting errors running the new 7i92_7i85sx1sdid.bit file.

I tried the --reload, power cycle and the verify comes back ok. I can --readhmid.

FWIW, The mill is running linuxCNC 2.8.4. (Lathe was running 2.9.2)

However, when I run my Mill config with the new .biffile I get:

cncbox@debian:~/linuxcnc/configs/Mill7i85s$ linuxcnc Mill7i85s.ini
LINUXCNC - 2.8.4-23-g93a844ef5
Machine configuration directory is '/home/cncbox/linuxcnc/configs/Mill7i85s'
Machine configuration file is 'Mill7i85s.ini'
Starting LinuxCNC...
application-specific initialization failed: no display name and no $DISPLAY environment variable
Error in startup script: invalid command name "."
    while executing
". configure -borderwidth 0 -highlightthickness 0"
    (file "/usr/lib/tcltk/linuxcnc/bin/popimage" line 35)
twopass:invoked with <> options
twopass:found ./Mill7i85s.hal
twopass:found ./Spindle.hal
twopass:found ./estop-chain.hal
twopass:found ./quad_encoder.hal
twopass:found ./postgui_load.hal
twopass:pass0: loadusr -Wn spindle-vfd gs2_vfd -r 9600 -p none -s 2 --name spindle-vfd --accel-seconds 5 --decel-seconds 3 --braking-resistor --device /dev/ttyUSB0
spindle-vfd: device='/dev/ttyUSB0', baud=9600, parity='N', bits=8, stopbits=2, address=1, enabled=1
twopass:pass0: loadusr -W hal_manualtoolchange
Note: Using POSIX realtime
Traceback (most recent call last):
  File "/usr/bin/hal_manualtoolchange", line 62, in <module>
    app = Tkinter.Tk(className="AxisToolChanger")
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1828, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
hm2: loading Mesa HostMot2 driver version 0.15
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
hm2_eth: 10.10.10.10: INFO: Hardware address (MAC): 00:60:1b:13:05:4e
hm2_eth: discovered 7I92
hm2/hm2_7i92.0: Low Level init 0.15
hm2/hm2_7i92.0: Smart Serial Firmware Version 43
hm2/hm2_7i92.0: unknown stepgen MD:
hm2/hm2_7i92.0:     Version = 194, expected 0-2
hm2/hm2_7i92.0:     NumRegisters = 10, expected 10
hm2/hm2_7i92.0:     InstanceStride = 0x00000004, expected 4
hm2/hm2_7i92.0:     MultipleRegisters = 0x000001FF, expected 0x000001FF
hm2/hm2_7i92.0: failed to parse Module Descriptor 6
board fails HM2 registration
hm2_eth: in hm2_eth_reset
hm2_eth: rtapi_app_main: Invalid argument (-22)

twopass: load_the_modules cmd=<orig_loadrt hm2_eth [concat board_ip="10.10.10.10"] [concat config=" num_encoders=4 num_stepgens=4"]>
waitpid failed /usr/bin/rtapi_app hm2_eth
/usr/bin/rtapi_app exited without becoming ready
insmod for hm2_eth failed, returned -1

Shutting down and cleaning up LinuxCNC...
Running HAL shutdown script
hm2: unloading


If I flash a different .bit file the config starts up as normal.
 

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

More
20 Jan 2024 06:19 #291164 by tommylight
Not sure if stepper with index works with 2.8.4 ( waguely recal something mentioned here on the forum) but it is not to dificult to test with 2.9 by downloading the ISO (burn to usb, boot from usb) and running the config from a live session.

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

Time to create page: 0.114 seconds
Powered by Kunena Forum