สรุปว่าไม่มีเออเร่อร์สะสม ถ้าจะผิดก็ผิดพลาดที่เศษเสี้ยวของตัวเลขที่ถูกปัดทิ้ง
ผมเคยเขียนกระทู้โต้ตอบเรื่องทำนองเดียวกันกับ Greg ผู้ประดิษฐ์ SmoothStepper ซึ่ง quote ที่ 2 จากข้อความด้านล่าง ได้อธิบายสิ่งคล้ายกัน ตรงนี้น่าเป็นหลักฐานว่า Mach3 ทำงานเหมือนกับที่คุณสมภพอธิบายไว้
ต่อไปนี้เป็นการอธิบายสิ่งที่เกิดขึ้นที่ปลายเศษเสี้ยวของแกน x ที่วิ่งไปและวิ่งกลับ จาก x0 -> x0.75 -> x0
Mach3 ประมวลพิกัดต่างๆของคำสั่ง G-code เป็นแบบเลขจุดทศนิยมและทำงานอิสระจากการเอาท์พุทให้สเต็ปปิ้งมอเตอร์ เช่นเมื่อการเคลื่อนที่เช่นแกน x วิ่งผ่านค่าย่อยสเต็ปที่เล็กสุด(ในที่นี้สมมุติให้เป็น 0.5) เช่นวิ่งจาก 0 ไป 0.75 ก็จะมีสัญญาณ step pulse ออกไปให้ตัวขับ (driver) สั่งให้มอเตอร์ขยับสเต็ป และยังวิ่งต่อไปที่พิกัด 0.75 แล้ววิ่งกลับ ซึ่งตรงนี้็ยังไม่มีอะไรเกิดกับส่วนที่เกินมา 0.25 (ในความเป็นจริง Mach3 ได้ประมวลและวิ่งไปถึง 0.75 จริงแต่ pulse ออกแค่หนึ่ง pulse ที่ตำแหน่ง 0.5 และวิ่งกลับ)
ขณะวิ่งกลับ สัญญาณ dir จะถูกเปลี่ยนขั้วและเมื่อ x วิ่งผ่านจุดตัดในขากลับคือ 0.5 ก็มีสัญญาณ step pulse เกิดขึ้นอีกที และได้เปลี่ยนทิศไปก่อนหน้านี้แล้วจะทำให้สเต็ปปิ้งขยับกลับที่เดิม
ถ้าการวิ่งจาก x0 ไป x2.33 และกลับมา x-1.60 และ pulse จะเกิดขึ้นตามจุดต่อไปนี้ครับ
--> 0.0 0.5 1.0 1.5 2.00
-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.00 <--
หมายเหตุ ตัวเลขด้านบนสมมุติให้หน่วยย่อยสเต็ปอยู่ที่ 0.5 ครับ
สังเกตว่าภายใน Mach3 จะไม่มี error สะสม เพียงแต่เศษเสี้ยวของปลายสุดจะถูกเพิกเฉย
http://www.warp9td.com/index.php?option=com_fireboard&Itemid=33&func=view&id=992&catid=7&limit=6&limitstart=18#1004----------------------------------------------
Hi Greg,
I love your ascii art. Good job
Thank you for your compliment.
That part you might be missing is that (assuming your drawing reflects the way the SS did it in prior plugins) the ‘v’ is at about 0.375 steps past the point where it output a step. Let's say it stopped at ‘v’, sat there for a while, and then Mach commanded it to move 0.7 steps further. As it passes 0.5 it will toggle the step high. When it passes 1.0 it will bring the step low and stop 0.075 steps beyond. Remember, Mach does everything in floating point. The SS maintains the fractional component.
I understand you now and the meaning of ‘asserted’. Mach3 control the all motions value, SS plug-in watch for increase or decrease of the position value, x,y,z… until the value across over tick point, here is 1.0, then SS plug-in manage to generate transition output signal. This is why you have to force the step signal back to the initial level when it asserted for sometime.
But why Mach3 with PP doesn’t have this problem Or because it been fixed like the way you did long ago Or it just gives a short pulse (now the wave form is not 50% duty cycle for sure) after the tick point and the coming move will generate another tick and so on. In case of ending partial move like we are discussing is also fine, it doesn’t care the left over value, similarly we round a number up.
Also, the pulse width wide enough for optoisolators and other things to settle down (this value is on Motor tuning and Setup). Can we check this behaviour of PP by oscilloscope or just ask Art?
However, I have no doubt on accuracy by the way that you implemented it in v.13 and I’m please with filter feature too.
Thanks
Weerasak
----------------------------------------------