Stepper - homing plus index encoder v2.9 no encoder reset ini flag

More
09 Jul 2021 14:53 - 09 Jul 2021 15:07 #214114 by evengravy
Thanks Andy,

Yep, the and2 solution was my initial thought, although I share the same concern over reliability. I'm going to see if I can get hold of the config files from Feral and will report back.
Last edit: 09 Jul 2021 15:07 by evengravy.

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

More
09 Jul 2021 15:36 #214117 by andypugh
linuxcnc.org/docs/2.8/html/man/man9/flipflop.9.html

Will work around the short-pulse problem. You would wire only the "set" and "reset" pins. "set" to the switch and "reset" to the index.
To work properly this would need the system to hit the index _before_ the switch.
Rapid search towards switch, past the index (ignored), hits switch, sets home-sw-in
Slow latch back off switch, flipflop ignores switch state
Still in slow latch, hits index, resets flip-flop, taken as home position by the system.
The following user(s) said Thank You: evengravy

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

More
09 Jul 2021 15:51 #214118 by PCW
What I don't understand is why you are re--inventing homing to index when its built into
LinuxCNC
The following user(s) said Thank You: evengravy

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

More
09 Jul 2021 16:41 - 09 Jul 2021 16:42 #214122 by evengravy
Thanks Andy, I will get a look at the flipflop if needs be, this might work better than and2 for this situation.

I got a hold of Feral and he is going to send me his config he says, so I'll report here. Apparently Dewey Garrett had implemented it or at least directed him to the solution.

Hey PCW, I understand your point. It's likely a case that I don't understand the inner workings of LCNC to the level required. I'm not trying to reinvent the wheel intentionally here, just put the machine back to a state of functionality that it shipped with in the original state. It's unusual insofar as both axes can extend in the negative beyond the home min position switch. That might also negate the ability of using the flipflop above, although I'm happy to give it a bash. It's hard to articulate the hardware arrangement but I can draw a picture of the hardware setup if needs be.

The reason for wanting to implement the index/proxy is that the switches on this aren't very repeatable at all, hence the addition of the proximity and the way the proximity is arranged as one pulse per cycle it can't be utilised alone of course. Together it seems like a good compromise of repeatability vs complexity.
Last edit: 09 Jul 2021 16:42 by evengravy.

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

More
09 Jul 2021 17:38 - 09 Jul 2021 17:45 #214124 by PCW
My point is that homing to index is already built into LinuxCNC and
well documented.

Index detection (in hardware) and index enable operate in a
way that can detect narrow index pulses in hardware and effectively
latch the position at index so there are no velocity dependent
detection errors or +-1 servo thread position capture errors.

Normally this is done with encoders, but it is possible now to do this
with step/dir with the right firmware and LinuxCNC 2.9
Last edit: 09 Jul 2021 17:45 by PCW.

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

More
09 Jul 2021 18:09 - 09 Jul 2021 18:10 #214126 by evengravy
Okay, this sounds great. I'm sorry PCW but I thought this would require custom firmware not yet in existence. I picked you up wrong here.

I'm using 7i96 with PWM firmware (to drive VFD). Is there firmware to add this and retain the PWM?

I've had a response from Feral, his custom HAL relevant sections are:

#
SINGLE HOME SWITCH DECLARATIONS

net home-x => joint.0.home-sw-in
net home-x <= [HMOT](CARD0).7i76.0.0.input-04-not

net home-z => joint.1.home-sw-in
net home-z <= [HMOT](CARD0).7i76.0.0.input-05

#pnp proximity sensor setup



setp [HMOT](CARD0).7i76.0.0.output-14 1
net X-home-prox hm2_7i76e.0.7i76.0.0.input-30 encoder.0.phase-Z
net X-home-index-enables joint.0.index-enable encoder.0.index-enable

setp [HMOT](CARD0).7i76.0.0.output-15 1
net z-home-prox hm2_7i76e.0.7i76.0.0.input-31 encoder.1.phase-Z
net z-home-index-enables joint.1.index-enable encoder.1.index-enable

This also requires the ini flag changes as noted previously here.

I haven't tried this yet but I will do tomorrow, although if there is suitable firmware with PWM I'm more than willing to give that a try too. I have already updated to 2.9 (yesterday) so that shouldn't be an issue.

Thanks for the info, best, John.
Last edit: 09 Jul 2021 18:10 by evengravy.

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

More
09 Jul 2021 18:14 #214127 by PCW
I can make one for the 7I96 plus PWM,
The question is where the index inputs go...

I assume you are using the 7I96's encoder
input for a spindle?

If so, its probably easiest to put the index inputs
on the 7I96 isolated inputs (if you have enough free)
The following user(s) said Thank You: evengravy

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

More
09 Jul 2021 19:57 #214135 by evengravy
Hey, that's very kind of you PCW.

I'm using the encoder for spindle speed input yes (although I have yet to wire it up I have it configured)

I'm using the isolated inputs on the top row for proximities yes, I have them set to gpio 04 and 05 respectively. I've dropped my config files here for ref, in case you need them, I'm keeping track of my pins in a separate txt file for my own reference later.  I've attached it here as 7i96 pins.txt

 
Attachments:

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

More
10 Jul 2021 03:01 #214155 by PCW
Here is a 7I96 bitfile with 4 stepgens, 1 pwmgen, and stepgen indexes 
0,1,2,3 on GPIO 4,5,6,7

 

File Attachment:

File Name: 7i96_stidx_1pwmd.zip
File Size:109 KB
Attachments:
The following user(s) said Thank You: evengravy

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

More
10 Jul 2021 08:24 - 10 Jul 2021 08:45 #214163 by evengravy
Thank you PCW. I'll get this flashed onto the board shortly. Just to check, do I need to flash both the .bit file and the .pin file in this zip with;
mesaflash --device 7i96 --addr 10.10.10.10 --write filename.xyz? The previous PWM firmware was a single file, but I see here there are two. I'm just curious if I need to flash both .pin and .bit files or just the .bit file.

Thanks again.
Last edit: 10 Jul 2021 08:45 by evengravy.

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

Time to create page: 0.144 seconds
Powered by Kunena Forum