Hello Guest it is April 18, 2024, 06:30:34 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - en_el_camino

Pages: 1
1
Mach SDK plugin questions and answers. / Re: Movement plugin with DDA
« on: February 08, 2013, 09:43:19 PM »
Sorry, I made a mistake above: it is 22/42 fixed point format. So you have to devide by 2^42.

2
Hi,
I am working in a movement plug-in in which I intend to use the ExternalType = EX_DDA mode to send 1 to 64ms movement commands to the external device.
For that, I am trying to take information form MainPlanner->Movements[] GMoves structures, but I am finding the following two issues:
-1st --> GMoves.ex to GMoves.ec are supposed to hold the end coordinates of this movement, but their values are allways zero. I am not so worried about that, since it can be worked around taking next move start point as current move end point.
-2nd --> Gmoves.sx , sy , sz , sa , sb and sc store start point of this movement. I have checked that this is OK for all axes, except for sx. For some reason sx remains allways zero.
I would appreciate it if someone can help or give some advice.
I am thinking in a work around consisting in that the plugin computes sx itself from the very beginning using the DDAs , but I am not comfortable with the idea of the accumulated error of that calculation, specially in long trajectories.
Thank you.


3
Mach SDK plugin questions and answers. / Re: Movement plugin with DDA
« on: February 08, 2013, 08:54:25 PM »
Hello to all.
I have written a plugin for Mach3, that uses my USB movement controller. I have a problem with a misunderstanding of units, in which DDA values are measured. I assumed, that DDA frequencies are 4467843509235 (yes, about 4 trillion!) times greater than my real frequencies, and everything works fine. But I would like to discover this magic constant and understand how it works. Can anyone helps me?

Hi Anet512,
In some tests I did, I observed that DDAs are 64 bit fixed point numbers in 22/44 formtat. In addition they are scaled by the "steps per mm" constant of each axe.
Therefore, if you want to know DDAs in "steps/ms", divide it by 2^44 (kind of shifting decimal point 44 places to the left). If you want it scaled to mm/ms, you can additionally divide by the constant "MainPlanner->StepsPerAxis[]"


4

1.  Is there a way to set the Mach error label like  MachErrorMsg("*********x") or SetMachError("*********x")? From the Shuttle Plugin:

   void SetMachError(Cstring Message){
      CString *err = &MainPlanner->LastError;
      if(err != NULL )
      *err = Message;"}

In Ed's -TrajectoryControl structure LastError is a LPCSTR pointer. In C++/CLI I came up with:

   void SetMachError(LPCSTR Message){   
      LPCSTR err =   (LPCSTR)&MainPlanner->LastError;
      if(err != nullptr )
      err = Message;// Compiles NO OUTPUT
}
   
Has anybody figured this out?


Kurt, I solved the same problem with the following piece of code:

void SetMachError(char* msg){
   void *temp = &MainPlanner->LastError;
   if( temp != NULL) *(CString*)temp = msg;  //need #include <atlstr.h>    
}

One more tip: put the include atlstr.h before setting default namespaces in order to prevent name ambiguities.

I hope it helps.


Pages: 1