Jarrek,
I'm fairly certain that you don't mean that you don't want to process circular motion. I think what you are saying is you don't want to process the DDA's. The GMoves structure is supposed to provide position moves and velocity moves and because time is included in the structure you can get velocity from the commanded position move and position from the commanded velocity. From what I've seen in the ncpods code it only uses the commanded positions and ignores DDA's.
I'm working on a motion plug in for a NextmoveESB motion controller. I have I/O, and commanded velocity motion like jogging or home, functional but I am stuck on GCode moves. The plugin is written in C++/CLR and uses the MachInclude structures built by Ed from Joshua Systems. I don't know if Ed's MachIncludes are broken or if there is a Mach variable that needs to be turned on but the GMoves structure doesn't return any position data.
I call into the ring buffer to get the GMove structure (from the Mach plugin wiki):
struct GMoves
{
int type; // 0 is linear, 1 is circular
double cx,cy,cz; // center of move for cubics.
double ex,ey,ez,ea,eb,ec;
double sx,sy,sz,sa,sb,sc;
__int64 DDA1[6]; //DDA1's for cubics
__int64 DDA2[6];
__int64 DDA3[6];
double Time;
bool Stop;
};
Not all the values are returned.
type,Time,Stop and DDA's all have values but e[axis],s[axis],c[axis] are always 0. Ex.
MDI "g1 x1 f10" will return type = 0, Time =63(64) ms, DDA[0] = 999999999 (a large int),DDA[1] = 0, but ex = sx = 0- No position data. When the move has completed, Time returns 34 and DDA[0] returns 8888888 (a different large int) which was the final move in the trajbuffer.
I don't really want to use this GMoves structure anyway because the longest move is only 64 ms. What I want to get from Mach is the line of G-Code broken down for the line's complete move in a structure like:
"g1 x1 f10" (assuming starting at x0,y0,z0,)
struct GLineMove
{
int type; // 0 is linear
double center[3]; // all zeros because move is linear
double end[6];//ex = 1.0000 ( or counts),ey = ez...=sy = sz ... = 0
double start[6];//sx = 0 ( or counts)this is known
double Time;//time = 6000 (1 uu * 60 sec/10 uu * 1000ms /sec )
};
Obviously Mach must take a line of G-Code and translate it to axes velocity pulses. Somewhere during this translation the above variables are probably generated but maybe not exposed in a buffered structure that can be read and incremented. I suspect that position move data by gcode line has something to do with the BACK_BUFFER but I haven't discovered how to get at a "Back Buffer"or any movement structure other than the velocity pulse based GMoves and GMoves1.
Any ideas would be appreciated.
Thanks,
Kurt
More info on the NextMove controllers:
The controller is a Texas Inst. Microcontroller which runs basic c software called Mint. There are 3 or 4 servo channels, 4 stepper channels, 20 inputs, 11 outputs and 2 additional analog channels. I/O, Servos, steppers are setup and tuned with a UI called MintWorkBench and the setup is stored in eprom on the controller. The program that runs on the controller is just a loop that waits for an event to happen (like a limit switch hit or estop) then processes the event and when finished returns to the main loop to wait for another event or command from a host which will be Mach if I can ever figure out how to get G code line moves. The real beauty of this controller is just how simple it is to interface to a host. All the host controls are AxtiveX and they pretty much duplicate all the functions and methods available in Mint. For example aX is a pointer to the MintController.lib::ActiveXMintController;
aX->set_Jog(short nAxis, float vel); // jogs the axis at +- vel direction
aX->VectorA(nNumberOfAxes, nAxesArray, fPosArray);;// coordinated one or more axis moves