Help with gantry machine. Dual motor setup

More
23 Sep 2022 17:50 - 23 Sep 2022 17:58 #252629 by Mulholland
Hello Linuxcnc Forum,I have been using my router now with linuxcnc for about 6 years or so and mostly without a problem.

It's a XYYZ gantry machine and I have until yesterday been manually squaring the gantry (hard stops with power off).I recently decided to implement gantry squaring in the homing sequence, which took a bit of figuring out but it works like it should. The problem that I can't seem to work out now is the gantry motors wont reach full speed without stalling or missing steps! Obviously bad for a gantry!

The only thing different (that I can tell) is both Y motors are getting different step and direction signals. Before I changed things over both Y drivers were sharing parport pins, one step and direction for both drivers.I feel like it has something to do with timing or latency but maybe I missed a critical step? Do I need to sync the motors some other way after homing? I mean if it jogs like it should after homing it should be right, right? 

I really tried to avoid starting a new thread on gantry/dual motor problems but I have been sitting here all day searching through old posts, reading about double-steps and going through the documentation but I can't seem to find it out. If anyone can point me to the right information I would greatly appreciate it. 

Thanks,

Jeremy



 

File Attachment:

File Name: router.ini
File Size:4 KB

 

File Attachment:

File Name: router.hal
File Size:5 KB
Attachments:
Last edit: 23 Sep 2022 17:58 by Mulholland. Reason: Attachments

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

More
23 Sep 2022 22:13 #252638 by rodw
Looks like none of your joints have the following critical settings
DIRSETUP   = 5000
DIRHOLD    = 5000
STEPLEN    = 10000
STEPSPACE  = 10000
STEP_SCALE = 10000

Don't assume my values are correct. They are just a bit of a guess.

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

More
23 Sep 2022 23:06 - 23 Sep 2022 23:14 #252639 by Mulholland
Hi, thanks for looking over it. 

All joints have:
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 10200
setp stepgen.1.dirsetup 10200
setp stepgen.1.maxaccel


No sign of step scale though. Assuming your example, the values of Steplen and stepspace could be the issue?

Edit:

It looks like I need to simply declare them as variables? 
Last edit: 23 Sep 2022 23:14 by Mulholland.

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

More
23 Sep 2022 23:24 #252640 by tommylight
Wait...
From your hal file:
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS 
loadrt hal_parport cfg="0 out"
setp parport.0.reset-time 1000
loadrt stepgen step_type=0,0,0,0,0
loadrt pwmgen output_type=1
Change the reset time to 5000 or start at 10000 and lower gradually till you are OK with it.

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

More
26 Sep 2022 08:00 #252752 by Mulholland
Okay, so I had a few hours to play around and changing the reset time but alas to no avail.

I'll have a look at some more timing things but the problem still exists.

I need to get some more work done so I'll probably have to revert the changes I've made for gantry squaring for now but any help would be greatly appreciated!

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

More
28 Sep 2022 20:10 #252968 by Mulholland
SOLVED.

For anybody in the future who happens to have the same problem, the issue was the choice of parallel port pins.

I have a rotary axis so pins 2-9 were in use and when I gave my Y2 motor it's own step and direction pins I just used the next free output pins, 16 and 17.

It worked just fine, until I sped things up and then one motor would lose steps and rack the gantry.

By moving Y2 to pin-02 and 03 and the rotary axis to 16 and 17 has fixed the problem on the gantry at least.

Is this a known problem? Or should that have worked just fine? Is it maybe a wire shielding issue?

At least it's working now anyway.

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

More
28 Sep 2022 23:39 #252973 by tommylight
It is not a problem, it is just how the parallel port works, there are 8 data pins 2-9, "service" pins 1,14,16,17,, and "i do not know" pins 10,11,12,13,15.
Pins 2-9 can be used as inputs or outputs, same with 1,14,16,17, but pins 10,11,12,13,15 can only be inputs.
There are also electrical differences between them, pins 2-9 are better at sinking than sourcing current, pins 1,14,16,17 when used as inputs require more current than pins 2-9 or 10,11,12,13,15, etc, etc.
It has 3 modes of operation:
-OUT = 12 outputs +5 inputs
-IN = 4 outputs +13 inputs / data pins 2-9 are inputs
-X = 8 outputs +9 inputs / only data pins are outputs

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

More
28 Sep 2022 23:47 #252974 by tommylight
Strobe, one group of those pins is called strobe, or a pin, a bit fuzzy ...

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

More
29 Sep 2022 06:50 #252995 by Mulholland
Wow, fantastic explanation, thank you.

But I guess this means the rotary axis shouldn't be on pins 16 and 17?

I mean, it works but I can't see if it's not keeping up like the obvious signs of a racking gantry.

I do have a second parallel port but that is not supposed be used for step and direction signals?

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

More
29 Sep 2022 09:03 #253004 by tommylight
Pins 16 and 17 can be used, it is just that they might not work as the data pins, or might not meet the drive requirements at higher speeds. Probably more to do with the drives, but i never investigated it thoroughly.
I know for sure some encoders will not work with pins 1,14,16,17 when used as inputs as they do require more current than the pins 10,11,12,13,15.
And yes, second parallel port can be used for everything, there is just one issue that might crop up, address change after a reboot, and that could be remedied by entering BIOS and seting the resourse assignment to manual. Most new boards/PC's do not have that option though.
Even if this happens, checking the address and changing it in the hal file takes about a minute of time.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum