Stepgen table mode adding one extra state and not following the table properly

More
03 Aug 2020 01:27 #176980 by nick-parker
Hi folks,

I've got a mill with four phase unipolar stepper motors and dumb little drivers on it that I'm trying to run off a mesa 6i25 card. @PCW graciously helped me out in a (previous thread) forum.linuxcnc.org/38-general-linuxcnc-q...20k?start=10previous thread with firmware that supports table mode and DPLL clocks for better performance.

I have two stepper problems that I didn't notice until I ruined a part by skipping a bunch of steps then cutting through the middle of it.

1. For some reason the length of my table cycle is 1 greater than the step-type variable in HAL. If I set it to 8, there are 9 distinct states. 4 gets me 5 states, 3 gets me 4 states. Is this the correct behavior because of zero-indexing or something, or is this a bug?

2. The table data *mostly* gets followed but not always. For example, with step-type = 3 and table-data-0 = 0x00000001 it should have the step pin on 1/4 the time, but hooking my scope to that pin clearly shows a 50% duty cycle. Also, 0x04080408 and 0x00080008 ought to produce the same behavior on tablepin 3 but the one with the 4 bits has twice the frequency of the one without.

I've manually stepped the drivers by probing their inputs with a 5V wire and I know that cycling a single high bit across step, dir, table2, table3 produces smooth full stepping motion on them, but I can't sort out how to make this system actually output that, let alone the two phases at a time version of full-stepping I'd really like to be doing for extra torque.

The reason I didn't notice this sooner is the config you see on my Y, Z axes in the attached files works correctly in 8 out of 9 states and just does nothing in the 9th, which allowed the mill to run just with a scale of 2250 instead of the clean 2000 it should. But I think the "stutter" effect of trying to stop moving 1/9 of the time is causing it to skip steps at higher speeds. The original bandit controller on this mill could run it at 100 IPM and I can't get past 40 with LinuxCNC so far before the motors bind up and whine.

Has anyone seen buggy tablemode behavior like this before? Please let me know if there's any more info I can add to make this clearer.

Thanks,
-Nick
Attachments:

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

More
03 Aug 2020 03:28 #176993 by PCW
Its a long-standing bug in the step generator driver
its fixed in master:

github.com/LinuxCNC/linuxcnc/commit/4d14...bc9c8c18638cc08ba138

I just happened to notice it last week because I was using the table mode
to drive a transformer and the 16 length table I selected does not work
(it resulted in a 0 length table)

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

More
09 Aug 2020 23:27 #177783 by nick-parker
Yep, that's definitely the problem!

I'm still running a Wheezy image with 3.4-9-rtai-686-pae #1 SMP PREEMPT Debian 3.4.55-4linuxcnc i686 GNU/Linux and having absolutely no success compiling on that machine because Wheezy is so thoroughly EOL'd I can't install any dependencies.

I managed to build successfully on my Ubuntu laptop and copy those binary files over, but I'm not sure how to install them from there. The setuid command failed and complained about Makefile.inc so I copied that over as well but it raised new objections.

Could you please point me toward the easiest way to upgrade this one part of my system and get table mode working nicely?

Also, are there any apt sources I could point this thing toward to install basic stuff like these compile dependencies, or vim for that matter?

Thanks for all your help! I've already made some nice parts on this system with super low feeds because of the stepper issues, and it feels super close to being a wonderful tool.

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

More
10 Aug 2020 02:55 #177788 by PCW
I'm not sure of the best way to do this.

If you are just copying .so files around
you would need to make sure they
have the same owner and permissions
as the existing .so files (and were built
for the same LinuxCNC version and same
32/64 bitness with a tiny 3 char patch to setpgen.c)


It might be easier to update the OS/LinuxCNC

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

More
10 Aug 2020 03:02 #177789 by nick-parker
While I waited on your advice for Wheezy I started a new partition on the machine for the Stretch image off linuxcnc.org. I've got it installed and I'm in the process of setting up linuxcnc compilation to get the latest main branch, but it's got really bad latency spikes (the worst I saw was 700k on servo and like 80k on base).

I'm going to try and get the latest branch running on Stretch to prove it fixes my issue, and hopefully it'll run well despite those latencies, but I may have to downgrade back to Wheezy in which case your advice will be helpful!

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

More
10 Aug 2020 04:46 #177792 by nick-parker
Update: The stretch partition is totally working! I compiled successfully and I'm now running the master branch with well behaved table mode stepping.

I still can't hit the max speeds the original controller did, but I suspect that's just because I need to set less aggressive acceleration values. I'm calling it for tonight but I'm super pleased to finally have this thing stepping correctly. If nothing else, it sounds MUCH better this way.

Thanks again!

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

Time to create page: 0.083 seconds
Powered by Kunena Forum