Problem with homing ATC step motor

More
7 years 3 weeks ago #147571 by CNCDoc
loadrt carousel pockets=15 dir=1 encoding=bcd num_sense=5
loadrt conv_float_s32
addf carousel.0 servo-thread
addf conv-float-s32.0 servo-thread # G-code analogue outputs are float-type




File Attachment:

File Name: Modig_5000...0-09.hal
File Size:16.17 KB

File Attachment:

File Name: Modig_5000...0-09.ini
File Size:3.69 KB

File Attachment:

File Name: toolchange...0-09.hal
File Size:1.85 KB

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

More
7 years 2 weeks ago #148187 by andypugh
I am back from my travels, I will try to look at this again soon.
I do wonder if 15 pockets (not a power of 2) is the problem.
(And 5 sense pins is one too many to encode 15 pockets)

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

More
7 years 2 weeks ago #148229 by andypugh
Well, I tried your loadrt line, and no crash.

I don't know where to go from here, other than possibly setting up an identical system. I can't easily use your HAL and INI without a 7l92.

Can you see if the sim configs still work if you add that loadrt line to one of them?

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

More
7 years 1 week ago - 7 years 1 week ago #148682 by CNCDoc
Was not wise about which HAL file applies in sim configs

But I tried to replace encoding = bcd. Linuxcnc then starts without error code on all choices (gray, binary, index, edge or single) except "bcd".

But did not get the jog function to work. Nothing happens when I enable jog input

Must change so the carousel lock is not normally activated. Should not be a problem.

Have a copy (image) of my hard drive that I can share with you if you want?
Last edit: 7 years 1 week ago by CNCDoc.

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

More
7 years 1 week ago #148688 by andypugh
In that case I think that the issue might be the combination of 5 sense pins and BCD encoding.

github.com/LinuxCNC/linuxcnc/blob/master...s/carousel.comp#L166

The code makes an assumption that bcd-encoded carousels have sense pins in multiples of 4. With 5 sense pins it will read out-of bounds in the sense pin array. (This is a bug)

What are the actual sense pin allocations in your system?

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

More
7 years 1 week ago #148689 by CNCDoc
Does not have much information about the sensor but here is the connection for the old system.


Same sensor as in this thread:
67324

I'm pretty sure I tried changing to 4 sense pins and linuxcnc didn't start then either. Will double check tonight.

There is little difference in the code between the different versions:

From "old" comp
Code:
case 'D': // BCD i = 0; pow = 1; while (i < inst_sense){ if (i < inst_sense) d += sense(i) << (i % 4); i++; if (i < inst_sense) d += sense(i) << (i % 4); i++; if (i < inst_sense) d += sense(i) << (i % 4); i++; if (i < inst_sense) d += sense(i) << (i % 4); i++; p += d * pow; pow *= 10; d = 0; } break;

From "new" comp
Code:
case 'D': // BCD i = 0; pow = 1; while (i < inst_sense){ if (i < inst_sense) d += sense(i) << (i % 4); i++; if (i < inst_sense) d += sense(i) << (i % 4); i++; if (i < inst_sense) d += sense(i) << (i % 4); i++; if (i < inst_sense) d += sense(i) << (i % 4); i++; p += d * pow; pow *= 10; d = 0; pcalc ^= sense(i); } break;

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

Time to create page: 0.192 seconds
Powered by Kunena Forum