Trouble in changing function "PrintLine::queueDeltaMove() "

I try to understand the PrintLine::queueDeltaMove() function. However, I find this function only calculate how many steps the motor should move. I can't find the function to drive the motor. Could anyone tell me where is the function please?

Comments

  • The motors are driven in motion.cpp bresenham function. There the precomputed segments are consumed and converted in stepper signals.
  • You mean the bresenhamStep() function? But I can't find by which function the bresenhamStep() is called. And could you tell me the use of virtual axis? Thank you very much!
    Repetier said:
    The motors are driven in motion.cpp bresenham function. There the precomputed segments are consumed and converted in stepper signals.

  • That is called by timer1 interrupt and the returned time in ticks is when timer should trigger again. That way we can control speed without dummy loops.

    Bresenham algorithm needs a leading axis to work. Since deltas are nonlinear the driving axis could change over a line. So we added a virtual axis that has the biggest steps for all segments so it is always the driving axis in nonlinear systems.
  • Hello! 
    Could you please specify how much time in one tick of returned bresenhamStep() value? 
    I mean if it returns 2000 is it 2000 * 0.1 micro seconds?
  • It is cpu cycles in bresenham.
  • Thank you very much! 
    I'm learning how this firmware works to make some twiks here and there and I just made some measurements using Arduino DUE.

    I placed port manipulation (with direct register access so no Arduino overhead) code inside timer1 interrupt handler and I got 476 us intervals for 10000 ticks value bresenhamStep().  

    If i calc 10000 avr @16 MHz ticks I will get 400 us interval.

    Do I understand correctly that this difference doesn't matter that much and Arduino DUE will driver steppers just a littile bit slower?
    Can lowering tick value make printing faster? 

     
  • Arduino due has 84000000Hz. Ticks get computed from set cpu speed and they are for every step different as the method is time controlled, Also value is ticks the question is what is The closest value you can set the timer to. It has only 65536 values so resolution might get reduced a bit by a prescaler to something lower. It‘s bin a while i wrote this so not totally sure, I know i have a check if counter is down. But 476 vs 400 us seems way off.
Sign In or Register to comment.