G33 does not adjust IPM after the first one. 2.9.0 pre-3376

More
5 years 9 months ago - 5 years 9 months ago #195264 by RBC
Thanks. I think I understand how this works now.
I am not using an encoder. I am feeding directly to spindle.0.index-enable and spindle.0.revs.

So the revs should be reset every time an index-enable is sent to low. And revs always stay between 0-359 ?
If so, I can try to make this happen in hostmot2.
Last edit: 5 years 9 months ago by RBC.

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

More
5 years 9 months ago #195267 by andypugh

RBC wrote: So the revs should be reset every time an index-enable is sent to low. And revs always stay between 0-359 ?


The standard hostmot2 encoder does the right thing.

LinuxCNC sets index-enable high.
hosmot2 (ie, the FPGA code) waits for an index, then sets the encoder counts to zero at the same time as setting index-enable low.
As far as I am aware the counts then just continue to increase until the next index-enable. The HAL driver converts those into a position in complete revolutions.

I am glad that you admitted to the Hostmot2 changes, we could have wasted days looking for a bug in the G33 code.

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

More
5 years 9 months ago #195268 by RBC
Is there a better way to do what I am trying to accomplish?
Since the position-fb is known, would it make sense to use this info to feed into the spindle so a G33 can be run correctly?
I am working on the code in stepgen.c under hostmot2 to do this at this moment.

The advantage is to be able to use stepper driver as spindle and run a G33.

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

More
5 years 9 months ago #195270 by RBC
Also, which file holds the codes for G33 behaviour? So I can understand how it works in detail. Thanks.

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

More
5 years 9 months ago #195278 by andypugh

RBC wrote: Also, which file holds the codes for G33 behaviour? So I can understand how it works in detail. Thanks.


G33 is a special case of a straight move:

github.com/LinuxCNC/linuxcnc/blob/master...erp_convert.cc#L4749

The tricky part of using a stepgen to emulate an encoder is that there is no index pulse.

Ideally you would add a physical index pulse from a sensor on the spindle, then modigy the stepgen.c code to output a scaled version of the stepgen counts that latches to zero whenever index-enable is high and the index pulse is seen.

Ideally you do really want to use an actual index, though you could emulate it at a modulus of the stepgen counts if the spindle to motor gearing is fixed (eg toothed belt not friction belt)

The position output pin should zero at index (but only when enabled) then count up by exactly 1.0 for ever revolution of the spindle.

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

More
5 years 9 months ago - 5 years 9 months ago #195318 by RBC
Thanks for the details.
From all this information, I decided to use a microcontroller to get the step counts and output 3 pins into a mesa encoder's A,B and Z.
Do you see any issues with this approach?
Last edit: 5 years 9 months ago by RBC.

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

Time to create page: 0.375 seconds
Powered by Kunena Forum