Position counts to user units?

Moderators: TomKerekes, dynomotion

Moray
Posts: 54
Joined: Thu Apr 26, 2018 10:16 pm

Re: Position counts to user units?

Post by Moray » Sun Oct 07, 2018 6:08 pm

TomKerekes wrote:
Sun Oct 07, 2018 4:49 pm
Hi Moray,
Instead of delaying you might wait for the previous command to complete instead.
I was already waiting for CheckDoneBuf() to go true, to signify the end of the previous command, but I'm guessing there is some overlap between the buffer emptying, and KMCNC becoming ready for the next MDI?
If I was to improve this, I guess it would be a case of checking for the PC_COMM_PERSIST persist to go greater than 0 before sending the next command?
During the DoPC command, at what point does PC_COMM_PERSIST get set to 0?
The reason I ask, is with also needing to get/set offsets, I should really add some kind of check to ensure KMCNC is not currently handling some other command, before sending another command.
Yes I expected that more commands would be needed. The DROs should basically be:

Machine Coordinates = DRO + Fixture Offset + Global Offset + Tool Offset

or

DRO = Machine Coordinates - Fixture Offset - Global Offset - Tool Offset


I would think you would need to know all the offsets instead of the DRO value.
Yes, I think I would need to ultimately know all of the offsets.
My initial thoughts are I would like to be able to select the offset in my app, and possibly show what offsets are in effect to get the current DRO displays. I think there would also need to be some level of communication between KMCNC and my app to update if offsets are changed in either during a probe routine.

However, that's a bit away yet.
My current plan is, get basic corner probing working, which needs handling offsets and move planning (this is the current thing that's bouncing around my head, as I want a setup that isn't going to need a major re-work for future probing routines).
Then work on alignment/edge probing, which will involve creating a basic geometric correction file to allow for angular offsets.
Then expand the basic probing routines to include the various other options that might be needed aka bore/spigot/slot/ridge probing.
After that, I'll get onto probe radius/offset correction.

User avatar
TomKerekes
Posts: 190
Joined: Mon Dec 04, 2017 1:49 am

Re: Position counts to user units?

Post by TomKerekes » Sun Oct 07, 2018 6:50 pm

Hi Moray,
I was already waiting for CheckDoneBuf() to go true, to signify the end of the previous command, but I'm guessing there is some overlap between the buffer emptying, and KMCNC becoming ready for the next MDI?
If I was to improve this, I guess it would be a case of checking for the PC_COMM_PERSIST persist to go greater than 0 before sending the next command?
During the DoPC command, at what point does PC_COMM_PERSIST get set to 0?
The reason I ask, is with also needing to get/set offsets, I should really add some kind of check to ensure KMCNC is not currently handling some other command, before sending another command.
The mechanism works like this:

  1. PC_COMM_PERSIST should be zero indicating idle mode
  2. KFLOP sets all parameters for a Command
  3. KFLOP sets PC_COMM_PERSIST with a command (value > 0)
  4. PC polls PC_COMM_PERSIST as it reads Status ~every 100ms and detects the command>0
  5. PC executes the command
  6. if the command succeeds PC sets PC_COMM_PERSIST to zero, on failure a negative error code is set
I think in your senario:
  1. motion finishes
  2. CheckDoneBuf() goes true and detect this immediately in KFLOP
  3. you then set a new command
  4. the PC now detects CheckDoneBuf() is true
  5. PC then sets "success" by clearing the command (your new command is lost)
HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

Moray
Posts: 54
Joined: Thu Apr 26, 2018 10:16 pm

Re: Position counts to user units?

Post by Moray » Sun Oct 07, 2018 7:07 pm

That makes sense, and explains why the error only occured after the clearance move, as after a succesful probe trigger move, there is already a 0.1sec delay before the ClearStopImmediately() call, which was needed to stop KMCNC showing a buffer underflow error.

So all I really need to add, is to check PC_COMM_PERSIST has been set to less than 1 before issuing the next command.

User avatar
TomKerekes
Posts: 190
Joined: Mon Dec 04, 2017 1:49 am

Re: Position counts to user units?

Post by TomKerekes » Sun Oct 07, 2018 7:40 pm

So all I really need to add, is to check PC_COMM_PERSIST has been set to less than 1 before issuing the next command
Correct
Regards,

Tom Kerekes
Dynomotion, Inc.

Moray
Posts: 54
Joined: Thu Apr 26, 2018 10:16 pm

Re: Position counts to user units?

Post by Moray » Mon Oct 15, 2018 10:14 pm

Just a quick update, but after various reworks of code, I can now build a list of moves, reliably carry out the moves, and store the resulting trigger points.
So the basics are finally working, but are in need of some refinement.

Post Reply