Fake encoder index for simulation

More
3 years 4 months ago #273237 by andypugh

./turner.hal:207: Pin 'motion.spindle.0.revs' does not exist
Sorry, that was an error on my part, I typoed the older pin name by accident (now fixed in the original post) 

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

More
3 years 4 months ago #273251 by drummond
When I look at HAL configuration there are four pins associated with Stepperspindle: index-enable, rawcounts, spindle-revs, time.

I'm running the lathe motor with the following in the ini file:

MOTOR_SCALE 3200 // stepper takes 3200 steps per revolution
STEP_SCALE  1600 // lathe spindle has a 2:1 relationship with the motor, stepper revolves once, lathe spindle revolves twice.

I wondered how this might gel with:

setp stepperspindle.0.steps-per-rev 1600

Which went in HAL file per the original instructions, it seems correct- but how could I be so lucky?

Got the motor running and watched the first 3 pins.

Results:

index-enable=nothing
rawcounts=count is going but with a minus sign in front of it
spindle-revs=count is going but with a minus sign in front of it

I can "correct" the minus on spindle revs by changing the HAL entry to:

setp stepperspindle.0.steps-per-rev -1600, which feels wrong somehow because the originals in the ini file are both positive and produce counterclockwise rotation with M4

rawcounts seems less trivial to fix

from the comp file:

.......signed steps-per-rev = 100 "stepper steps per rev / per index";

If that means what I think it means it will produce indexes far more frequently than I was expecting?

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

More
3 years 4 months ago #273266 by andypugh
Negative scales are not unusual to reverse specific functions.
Counts being negative is not a problem for the fake index comp.
But I suspect that you might have a misconfiguration if M4 is normal rotation unless this is a back-tool lathe.

Looking down the spindle towards the tailstock, M3 should be clockwise and count up.

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

More
3 years 4 months ago #273273 by drummond
Well, that was a typo combined with an interruption leading to an incomplete message being sent (!) Sorry about that

What it should have read is: "the originals in the ini file  are NOW both positive and produce counterclockwise motion with M3, to correct this I have to set them both back to negative

I could never get to watch the index changing by watching it on HAL configuration even with a spindle speed of 1 rpm (stepper running at 0.5 rpm)

I tried a simple g33 routine "in air" and everything seems to work, spindle synchronized motion without an encoder.  Thank you.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum