My two pennyworth.

>From origin
G00 X1 Y2

Would go to 1,1 then 1,2 in a "knight's move" diagonal then straight. There 
should be no force on the tool except acceleration of a mass.

>From origin
G01 X1 Y2

Would linear interpolate, stepping 2 Y for each X. With velocity limited by 
feed rate, the displacement is sqrt(1^2 + 2^2) = 2.236, the stepping is 
2/2.236 Y and 1/2.236 X for each step.

Most home NC milling machines use fractional/micro stepping to get the 
required resolution (and reduce the noise).
A stepping motor typically has 200 or 400 steps per revolution, (1/16) 
micro-stepping gives 3200 or 6400 micro-steps per rev. (1/256) 
micro-stepping might increase that to 51,200 or 102,400.

Lets assume belt drive is 16 tooth 2mm pitch therefore 32 mm per rev 
(radius 5mm) or 0.16 mm per step; and 0.01 mm per micro-step (or 625 nm per 
micro-step).

Each micro-step is the system's unit of distance/displacement; velocity is 
the rate of steps; and acceleration the rate of change in velocity.
The motor's available torque/force and the mass to move limit the 
acceleration, torque/force reduce with speed/velocity.
Some motors (103H5205-4240) will do 200 (or 4000) pulses per sec  with 
torque 0.15 Nm (0.1 Nm) that is velocity of 32mm/sec (640mm/sec) with 0.08 
m kg m^2 inertia (3 kg)
Force = m a; a = 0.15/0.08 m 1875 rad/sec/sec or a = F / m = 30 N / 3 kg = 
10 m/s/s

A sort of rate multiplier was described which outputs pulses at a rate 
lower than some maximum.

On Wednesday, 18 March 2020 23:37:52 UTC, John Dammeyer wrote:
>
> Would someone perhaps be able to describe simply (like MachineKit for 
> Dummy's) how exactly the step pulse and direction shows up on the Beagle 
> pin relative to the motion command from a G00 X1.0 where current X position 
> is 0.0.
>
>  
>
> Clearly we accelerate and move and then decelerate to arrive at the end 
> point of 1.0.  I do this in my ELS code inside the interrupt routine 
> which happens at a 20kHz rate.  If a step is required I set the output at 
> the beginning of the routine and then clear it at the end after a whole 
> bunch of other stuff is done.  
>
>  
>
> Whether to step or not is done by the equivalent of a trajectory planner.  
> For example in simple terms if the motor could accelerate instantly and 
> the step rate was 10kHz then every second interrupt the axis is pulsed.  Also 
> for every pulse the position is incremented if going in the positive 
> direction.  Decremented if going in the other direction.  When it matches 
> the end position the stepping is terminated and we have a move to position.
>
>  
>
> Inside my ELS interrupt code I do the accel/decel too.  The interrupt 
> routine changes the number of 20kHz intervals between step rates and also 
> tracks the half way point.  If we're not up to speed yet but the halfway 
> point is reached then deceleration is started and by the time the stepping 
> rate reaches 0 the motor has also reached it's desired position.
>
>  
>
> Otherwise once the step output pulse rate matches the desired velocity the 
> acceleration part is terminated and the number of steps it took recorded, 
> and now a pulse happens every second interrupt (for 10kHz step rate).  When 
> the destination location minus the time it took to accelerate is reached 
> deceleration begins.  And since we decelerate at the same rate as 
> accelerating and we have that same distance to move, once we reach 0 speed 
> we've also reached the destination.
>
>  
>
> Now this could all be done outside the interrupt routine in a trajectory 
> planner.  One could determine that it will take time X to reach either 
> target speed or midpoint of the distance to move.  Broken into the 20kHz 
> steps then the information could be fed into a FIFO so no math is done at 
> all inside the interrupt routine.  It's only task would be to read this 
> from FIFO one byte during each interrupt and write it to the port.   The 
> interrupt routine could then run 40kHz and clear the port of step signals 
> every second pulse.    If there is no motion the FIFO, flagged as empty, 
> holds the last entry for the port and it's just mirrored out to the port. 
>  
>
>  
>
> So how is it done in the Beaglebone with MachineKit.  Is there a function 
> that reads a FIFO filled by the trajectory planner or is it done yet some 
> other way?   I would look it up but don't even know where to start.
>
>  
>
> Obviously there's probably more going on under the covers to deal with 
> hard limits.  Seems like soft limits are dealt with before motion starts 
> with the option to not move because it will exceed machine limits.
>
>  
>
> Thanks
> John Dammeyer
>
>  
>
>  
>
>  
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/f608ba3f-2144-4e91-8be6-ac2964efe44e%40googlegroups.com.

Reply via email to