Hello Guest it is April 18, 2024, 10:12:02 PM

Author Topic: Movement plugin with DDA  (Read 4358 times)

0 Members and 1 Guest are viewing this topic.

Movement plugin with DDA
« on: March 20, 2011, 02:47:34 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?

I have used standard settings in my code:
MainPlanner->ExBufferHi = 350;
MainPlanner->ExTime = 0.001;
for(int x = 0; x < 7; x++)
   MainPlanner->ExternalPulseRates [ x ]=75000;

In window "Motor Tuning and Setup":
Steps per - 2000
Velocity - 120
Acceleration - 4

Mach3 gave me these strange numbers for command G01 X3 Y2 Z1 F2000 (for X axis):
DDA1 = -4294967296
When I change some settings, for example, axis velocity, my magic constant also changes and I don't know why!
Re: Movement plugin with DDA
« Reply #1 on: July 03, 2012, 11:10:39 AM »
hi, you advance in their attempt to develop the plugin for USB?, I'm trying to develop something similar using a high speed module FTDI FT2232, I have serious problems because it does not manage you tell me aceeraciones and decelerations MainPlanner-> ExTime as may be used and where it is applied this time, thanks
Re: Movement plugin with DDA
« Reply #2 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[]"

Re: Movement plugin with DDA
« Reply #3 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.