Trying to get Mesa 5i25 to generate steps for G540

More
20 Sep 2012 00:42 #24441 by PortlandGTS
After swapping a 6i25 for a 5i25 and figuring out how to use gantrykins (See previous post), I've finally got my 5i25 to partially work.

I'm able to use gpio, but can't seem to get stepgen to drive my Gecko 540.

Starting from a working system using software step generation through a parallel port, I loaded hostmot2 and hm2_pci, changed all the parallel port pin and stepgen references to 5i25 references, and switched the cable from the parallel port to the 5i25. But I can't get any of the steppers to budge.

Here's the relevant sections of my HAL file for one joint:

loadrt hostmot2
loadrt hm2_pci config="firmware=hm2/5i25/configs/hostmot2/g540x2.bit num_encoders=0 num_pwmgens=0 num_stepgens=4"
.
.
.
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf hm2_5i25.0.read servo-thread
addf hm2_5i25.0.pet_watchdog servo-thread
addf hm2_5i25.0.write servo-thread
.
.
.
# Initialize stepgen object
setp hm2_5i25.0.stepgen.03.position-scale -1909.861
setp hm2_5i25.0.stepgen.03.steplen 1
setp hm2_5i25.0.stepgen.03.stepspace 0
setp hm2_5i25.0.stepgen.03.dirhold 15200
setp hm2_5i25.0.stepgen.03.dirsetup 15200
setp hm2_5i25.0.stepgen.03.maxaccel 4

# Connect stepgen and axis objects
net ypos-cmd2 <= axis.3.motor-pos-cmd => hm2_5i25.0.stepgen.03.position-cmd
net ypos-fb2 <= hm2_5i25.0.stepgen.03.position-fb => axis.3.motor-pos-fb
net yenable2 <= axis.3.amp-enable-out => hm2_5i25.0.stepgen.03.enable

Can anyone see what the problem is?

Thanks,
Tom

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

More
20 Sep 2012 02:24 #24442 by PCW
1 ns steplen is not liable to work very well :-)

for G540, steplen of 1500 (1.5 uSec) and stepspace of 2500 (2.5 uSec) are probably reasonable values

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

More
20 Sep 2012 11:57 #24449 by BigJohnT
Also a dirhold and dirsetup of 2000 is plenty for the 540. On my G203v's (same as the ones in the 540 but can handle more voltage) I just set all 4 to 2000...

John

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

More
20 Sep 2012 12:11 #24450 by andypugh
PortlandGTS wrote:

setp hm2_5i25.0.stepgen.03.steplen 1
setp hm2_5i25.0.stepgen.03.stepspace 0

PCW has already pointed out that this is the problem. But I thought I would explain what has happened.

Stepconf uses the parallel port "reset" function to create the step pulses. This is a bit of code that runs a fixed number of nS after the parallel port write, and writes 0 back to any pins with the reset flag set.
This means that the system can create a step pulse every base period, rather than every two base-periods.
In this scenario the actual step pulse length is set by the reset time, and the step space length is simply the rest of the base period time. The step length and space are set to nominal values so as not to interfere with this timing.

In the case of a FPGA card, it really can do a 1nS pulse length, but that won't operate the drive. So you need the real pulse and space lengths in those parameters.

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

More
21 Sep 2012 02:13 #24494 by PortlandGTS
Thanks for the help, everyone. Now it works lilke a charm. Special thanks to Andy for explaining why my parameters worked with the parallel port interface, but not the 5i25.

I should probably learn exactly what these parameters do, but stepconf seemed to know how to set them, so I just kept using those values.

One more question: I noticed that the 5i25 wants its ports polled from the servo thread, not the base thread. Since I've now got the limit switches connected through the 5i25, it seems that this could slow response to limit triggers. Should I lower the servo period?

Thanks again,
Tom

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

More
21 Sep 2012 03:06 #24496 by PCW
A 1 KHz servo thread should be fast enough for limit switches unless you are moving really fast. Even at 10 inches per second (600 IPM) the 1 ms poll rate only results in 10 mills uncertainly in the limit switch trigger point.

It does not affect homing accuracy much either as the second stage homing move can be done quite slowly

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

Moderators: PCWjmelson
Time to create page: 0.060 seconds
Powered by Kunena Forum