Perfect Horizontal Line alignment for Z-Axis Stepper motors
-
How to make sure that your default starting rotation position to be always the perfect Horizontal Line when dealing
With Z-Axis movements ?e.g In OpenPnP using Duet3 6XD controller , Let’s say I command the motor with Gcode to
move a distance 10 mm/Degree , then 5 mm/Degree and then 4 mm/Degree . After that sequenced move ,
I would like to command it to go back to the Default position
of the horizontal line and be perfectly horizontal before the next sequence of movements.I would like to First do it in Duet3 6XD controller before apply that to OpenPnP. Is this possible ?
Attached is my config file and pdf explanation .
-
@developeralgo222 if you command it to move +10mm, then +5 then +4 and what to go back, what is wrong with sending it back -19?
I think i am missing something about this requirement
-
@T3P3Tony
The issue i am having at the moment is that although the sequence of movement is fine and no issues at all , My problem is that when i command it to park any of the Z-based axes, (Z, U & V axis) at 0 , even though the log says they are parked 0 , they are not completely horizontal. i can command them to be parked which is always at Safe Z level. I am having to sometimes adjust them slightly to be horizontal in order avoid accidental crush if any (even though it has not yet happened) . So i am looking for a way to make sure when commanded to park 0 they are completely horizontal -
What commands are you issuing to "park" them?
You may be running into a micro-stepping problem.
When unpowered the steppers, when turned by hand, will "step" from position to position by 1.8 or 0.9 degrees (assuming no gear boxes attached to the steppers.
But the Duets use micro-stepping which allows positions between those "fixed" positions.
If power to the steppers is removed the steppers will snap to the nearest "fixed" position.
Frederick
-
@developeralgo222 do they remain horizontal if commanded to some other position other than "0" and turn the motors off? is this still an issue if you allow the Z axis minimum to be slightly below 0?
-
-
undefined Phaedrux marked this topic as a question
-
config.g for easy access:
; Configuration file for Duet 3 MB 6XD (firmware version 3.6) ; executed by the firmware on start-up ; generated by RepRapFirmware Configuration Tool v3.6.0 on Wed Oct 16 2024 09:51:46 GMT-0500 (Eastern Standard Time) ; General preferences G21 ; Set millimeters mode G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"JABIT PNP" ; set printer name ; Wait a moment for the CAN expansion boards to start G4 S2 ; Network if {network.interfaces[0].type = "ethernet"} M552 P10.0.0.200 S1 ; enable network and set IP address M553 P255.255.255.0 ; set netmask M554 P10.0.0.1 ; set gateway else M552 S1 M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet M595 P120 R5 ; motion/movement commands queue length . Default M595 P60 R10 ; VERY IMPORTANT: Both Duet & OpenPnP uses 3D Cartesian Right-Hand coordinate system. ; (1) The X-axis moves to the Right (X+) and Left (X-). Right is Positive (X+) ; (2) The Y-axis moves to the Backward (Y+) and Forward (Y-). Backward is Positive (Y+) ; (3) The Z-axis moves to the Up (Z+) and Down (Z-). Up is Positive (Z+) ; (4) The C-axis (Rotation) rotates Anti-Clockwise (C+) and Clockwise (C-). Anti-Clockwise(Counter-Clockwise) is Positive (C+) ; Drives ;Physical Drives CAN ID = 0 M569 P0.0 S0 T2.5:2.5:2.5:2.5 ; X-Axis physical drive 0.0 moves Motor Backward/Reverse(axis rotates Anti-Clockwise = S0) in order to move X-axis to the Right(X+) on CAN ID = 0 - Duet 6XD Drive 0.0 with 2.5us timings between pulses M569 P0.1 S1 T2.5:2.5:2.5:2.5 ; Y-Axis physical drive 0.1 moves Motor Forward(axis rotates Clockwise = S1) in order to move Y-Axis Backward(Y+) on CAN ID = 0 - Duet 6XD Drive 0.1 with 2.5us timings between pulses ;Physical Drives CAN ID = 1 = All Shared Z Axes (Z, U, V ) each with a single Stepper Motor M569 P1.0 S1 ; Z1 & Z2 (Z = axis rotates Clockwise (S1 ) ) Axis physical drive 1.0 Rotates Motor Clockwise (Z1- & Z2+) or Anticlockwise/Reverse (Z1+ & Z2-) to move CAM driven dual nozzles down and up on Z axis on CAN ID = 1 - Duet 3HC Drive 1.0 M569 P1.1 S1 ; Z3 & Z4 (U = axis rotates Clockwise (S1 ) ) Axis physical drive 1.1 Rotates Motor Clockwise (Z3- & Z4+) or Anticlockwise/Reverse (Z3+ & Z4-) to move CAM driven dual nozzles down and up on U axis on CAN ID = 1 - Duet 3HC Drive 1.1 M569 P1.2 S1 ; Z5 & Z6 (V = axis rotates Clockwise (S1 ) ) Axis physical drive 1.2 Rotates Motor Clockwise (Z5- & Z6+) or Anticlockwise/Reverse (Z5+ & Z6-) to move CAM driven dual nozzles down and up on V axis on CAN ID = 1 - Duet 3HC Drive 1.2 ;Physical Drives CAN ID = 2 = C Axes ( W, A, B ) M569 P2.0 S0 ; C1 (W = axis rotates Anti-Clockwise/Reverse = S0) Axis physical drive 2.0 Rotates Motor Clockwise (W-) and Counter-Clockwise/Reverse (W+) on CAN ID = 2 - Duet 3HC Drive 2.0 - C 360°-continuous, but linear feed-rate M569 P2.1 S0 ; C2 (A = axis rotates Anti-Clockwise/Reverse = S0) Axis physical drive 2.0 Rotates Motor Clockwise (A-) and Counter-Clockwise/Reverse (A+) on CAN ID = 2 - Duet 3HC Drive 2.1 - C 360°-continuous, but linear feed-rate M569 P2.2 S0 ; C3 (B = axis rotates Anti-Clockwise/Reverse = S0) Axis physical drive 2.0 Rotates Motor Clockwise (B-) and Counter-Clockwise/Reverse (B+) on CAN ID = 2 - Duet 3HC Drive 2.2 - C 360°-continuous, but linear feed-rate ;Physical Drives CAN ID = 3 = C Axes (C, D, 'g) M569 P3.0 S0 ; C4 (C = axis rotates Anti-Clockwise/Reverse = S0) Axis physical drive 2.0 Rotates Motor Clockwise (C-) and Counter-Clockwise/Reverse (C+) on CAN ID = 3 - Duet 3HC Drive 3.0 - C 360°-continuous, but linear feed-rate M569 P3.1 S0 ; C5 (D = axis rotates Anti-Clockwise/Reverse = S0) Axis physical drive 2.0 Rotates Motor Clockwise (D-) and Counter-Clockwise/Reverse (D+) on CAN ID = 3 - Duet 3HC Drive 3.1 - C 360°-continuous, but linear feed-rate M569 P3.2 S0 ; C6 ('k = axis rotates Anti-Clockwise/Reverse = S0) Axis physical drive 2.0 Rotates Motor Clockwise (k-) and Counter-Clockwise/Reverse (k+) on CAN ID = 3 - Duet 3HC Drive 3.2 - C 360°-continuous, but linear feed-rate ; Axes: XYZUVWABCD abcdefghijkl mnopqrstuvwxyz are available in RepRapFirmware 3.5 and later on Duet 3 MB6HC and MB6XD only ; Best results is to configure all Controller Axes as Linear for OpenPNP, even if they are conceptually rotational this allows OpenPnP to control feed-rates, acceleration etc ; with better precision and smooth segments transitions ; X, Y Axis NEMA 34 Stepper Motor have 10mm Pitch LeadScrew, 1.8 degress/step = 360/1.8 = 200 steps/rev, 200 KHz at 16 Microstepping= 3200 pulses/rev, 320 Steps/mm (Linear ) ; Z, U, V Axis NEMA 17 Stepper Motor have 5mm (M5 = 0.8mm Pitch(Coarse = default) or 0.5mm(Fine)) Shaft diameter No Leadscrew , 1.8 degress/step = 360/1.8 = 200 steps/rev, 200 KHz at 16 Microstepping= 3200 pulses/rev, xxx steps/mm (Linear ) ; W, A, B, C , D, 'k Axis NEMA 11 Stepper Motors 1.8 degress/step = 360/1.8 = 200 steps/rev, 200 KHz at 16 Microstepping= 3200 pulses/rev ( Rotational Axes) ; Microstepping for all motors (NEMA 34, 17, 11 ) is set to 16 steps per rev , 200 kHz, with 1.8 Degree Motor = 3200 pulses/rev and Ballscrew pitch = 10 mm/rev for X & Y ; Max Speeds Tested @3200 pulses/rev: X & Y = 2800 mm/s = 168000, with accel = 18000 mm/s^2 but use 1800 mm/s with Accel = 10000 mm/s^2 for smooth movement and later adjust accordingly ; For X & Y-axis: The external Drivers (86HSE) is set to : Maximum Speed = 1600 pulse/s , Acceleration = 6400 pulse/s^2 , Deceleration = 6400 pulse/s^2 , Microstepping = 16 microsteps = 16 x 200 KHz = 3200 pulses/rev M584 X0.0 Y0.1 Z1.0 U1.1 V1.2 W2.0 A2.1 B2.2 C3.0 D3.1 'k3.2 R0 S0 ; LIN R0 = LINEAR, R1 = ROTATION M350 Z16 U16 V16 W16 A16 B16 C16 D16 'k16 I1 ; configure microstepping with interpolation. Irrelevant for external drives X & Y (X & Y = Dip Switches 3200= SW1=ON,SW2=ON,SW3=OFF,SW4=OFF,SW5=ON,SW6=ON) M92 X320.00 Y320.00 Z8.888 U8.888 V8.888 W8.888 A8.888 B8.888 C8.888 D8.888 'k8.888 ; set Axis steps per mm(microsteps/mm = pulses/mm), 10mm/rev. (X & Y = Currently 1000 pulses/rev / 10 mm/rev = 100 pulses/mm) M208 X0:340 Y0:447 Z-90:90 U-90:90 V-90:90 W-360000:360000 A-360000:360000 B-360000:360000 C360000 D-360000:360000 'k-360000:360000 ; Set axis minimum & Maximum axis Limts M566 X2000 Y2000 Z900.0 U900 V900 W900.0 W900.0 A900.0 B900.0 C900.0 D900.0 'k900.0 P1 ; set maximum instantaneous speed changes (Duet -- mm/min) and use Jerk policy 1 (Openpnp -- Jerk -- mm/s^3) M203 X100000.00 Y100000.00 Z150000.00 U150000.00 V150000.00 W120000.00 A120000.00 B120000.00 C120000.00 D120000.00 'k120000.00 ; set maximum speeds/feedrate (Duet -- mm/min) (Openpnp -- Feedrate -- mm/min) M201 X1000.00 Y1000.00 Z4000.00 U4000.00 V4000.00 W180000.00 A180000.00 B180000.00 C180000.00 D180000.00 'k180000.00 ; set accelerations (Duet -- mm/s^2) (Openpnp -- Acceleration -- mm/s^2 ) M906 Z1360.0 U1360.0 V1360.0 W560.0 A560.0 B560.0 C560.0 D560.0 'k560.0 I100 ; set motor currents (mA) and motor idle factor in per cent(I100 = "Always 100% ON = No idle time"). This is irrelevant for external drives (X & Y ) ; M84 S30 ; Set idle timeout M564 H0 ; Sets homing, H0 allows mvmnt wo homing ; Triggers -- Two triggers, one for X and one for Y, and set them to pause the machine ; Trigger number 0 causes an emergency stop as if M112 had been received. Trigger number 1 causes the print to be paused as if M25 had been received. Any trigger number # greater than 1 causes ; the macro file sys/trigger#.g to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed M581 T1 X Y S1 R0 ; invoke trigger 1 (pause) when an inactive-to-active edge (correct for NO switches) is detected on input 1 or input 2 at any time ; Endstops ; For X and Y Axis M574 X1 S1 P"!0.io1.in" ; configure active high endstop switch for low end on X via pin io1.in M574 Y1 S1 P"!0.io2.in" ; configure active high endstop switch for low end on Y via pin io2.in ; For Z-Axis (Shared Z,U,V) - Up/down) -- CAM Driven Dual Nozzles ( 1 Motor rotates up/down to drive 2 Nozzles ) M574 Z1 S1 P"!1.io0.in" ; configure active high endstop switch for low end on Z via pin 1.io0.in M574 Z2 S1 P"!1.io1.in" ; configure active high endstop switch for High end on Z via pin 1.io1.in M574 U1 S1 P"!1.io2.in" ; configure active high endstop switch for low end on U via pin 1.io2.in M574 U2 S1 P"!1.io3.in" ; configure active high endstop switch for High end on U via pin 1.io3.in M574 V1 S1 P"!1.io4.in" ; configure active high endstop switch for low end on V via pin 1.io4.in M574 V2 S1 P"!1.io5.in" ; configure active high endstop switch for High end on V via pin 1.io5.in ; For Rotational Axes only (W, A, B, C, D, 'G(g)) M574 W1 S1 P"!2.io3.in" ; configure active high endstop switch for low end on W via pin 2.io3.in M574 A1 S1 P"!2.io4.in" ; configure active high endstop switch for low end on A via pin 2.io4.in M574 B1 S1 P"!2.io5.in" ; configure active high endstop switch for low end on B via pin 2.io5.in M574 C1 S1 P"!3.io3.in" ; configure active high endstop switch for low end on C via pin 3.io3.in M574 D1 S1 P"!3.io4.in" ; configure active high endstop switch for low end on D via pin 3.io4.in M574 'k1 S1 P"!3.io5.in" ; configure active high endstop switch for low end on 'k via pin 3.io5.in ;***Inputs ; Integrated SMC CM85 Lingera Vacuum Generators (Negative pressure) IO pins for the Nozzles to pickup SMT parts ; Digital NPN Signal Outputs (Black wire (output 1) for direct control to switch it ON/OFF) . M950 J1 C"!0.io3.in" ; Duet 3 3HC CAN_ID 0 Port 3- VG1 - Vacuum Sensor Nozzle 1 M950 J2 C"!0.io4.in" ; Duet 3 3HC CAN_ID 0 Port 4- VG2 - Vacuum Sensor Nozzle 2 M950 J3 C"!0.io5.in" ; Duet 3 3HC CAN_ID 0 Port 5- VG3 - Vacuum Sensor Nozzle 3 M950 J4 C"!0.io6.in" ; Duet 3 3HC CAN_ID 0 Port 6- VG4 - Vacuum Sensor Nozzle 4 M950 J5 C"!0.io7.in" ; Duet 3 3HC CAN_ID 0 Port 7- VG5 - Vacuum Sensor Nozzle 5 M950 J6 C"!0.io8.in" ; Duet 3 3HC CAN_ID 0 Port 8- VG6 - Vacuum Sensor Nozzle 6 ; Sensors outputs ===> Duet3 inputs ; SMC NPN Vacuum Pressure Digital Sensors -ZSE30A-01-C-L (Not Z-Probe) - Model: ZSE30A-01-C-L has 2 Outputs OUT1 = 1 NPN output , OUT2 = 1 Analog Output (1 ~ 5V) ; Analog Signal Outputs (White wire (output 2) for reading Analog vacuum sensing and pressure values). M308 S0 P"2.io0.in" Y"linear-analog" A"VG1 Pressure" F0 B37 C-130 ; Duet 3 3HC CAN_ID 2 Port 0- Analog capable - Vacuum Sensor Nozzle 1 M308 S1 P"2.io1.in" Y"linear-analog" A"VG2 Pressure" F0 B35 C-130 ; Duet 3 3HC CAN_ID 2 Port 1- Analog capable - Vacuum Sensor Nozzle 1 M308 S2 P"2.io2.in" Y"linear-analog" A"VG3 Pressure" F0 B37 C-130 ; Duet 3 3HC CAN_ID 2 Port 2- Analog capable - Vacuum Sensor Nozzle 1 M308 S3 P"3.io0.in" Y"linear-analog" A"VG4 Pressure" F0 B35 C-130 ; Duet 3 3HC CAN_ID 2 Port 0- Analog capable - Vacuum Sensor Nozzle 1 M308 S4 P"3.io1.in" Y"linear-analog" A"VG5 Pressure" F0 B35 C-130 ; Duet 3 3HC CAN_ID 2 Port 1- Analog capable - Vacuum Sensor Nozzle 1 M308 S5 P"3.io2.in" Y"linear-analog" A"VG6 Pressure" F0 B35 C-130 ; Duet 3 3HC CAN_ID 2 Port 2- Analog capable - Vacuum Sensor Nozzle 1 ; SMC NPN Vacuum Pressure Digital Sensors -ZSE30A-01-C-L (Not Z-Probe) - Model: ZSE30A-01-C-L has 2 Outputs OUT1 = 1 NPN output , OUT2 = 1 Analog Output (1 ~ 5V) ; Digital NPN Signal Outputs (Black wire (output 1) for Direct control to switch it ON=1/OFF=0 , connect to x.iox.out ports OR ; Digital NPN Signal Outputs (Black wire (output 1) for Reading Pressure where True=ON=1=Level achieved /False=OFF=0=Below Level ,connect to x.iox.in ports M950 J7 C"!4.io0.in" ; Duet 3 3HC CAN_ID 4 Port IO0- Vacuum Sensor Nozzle 1-PSensorSMC1 M950 J8 C"!4.io1.in" ; Duet 3 3HC CAN_ID 4 Port IO1- Vacuum Sensor Nozzle 2-PSensorSMC2 M950 J9 C"!4.io2.in" ; Duet 3 3HC CAN_ID 4 Port IO2- Vacuum Sensor Nozzle 3-PSensorSMC3 M950 J10 C"!4.io3.in" ; Duet 3 3HC CAN_ID 4 Port IO3- Vacuum Sensor Nozzle 4-PSensorSMC4 M950 J11 C"!4.io4.in" ; Duet 3 3HC CAN_ID 4 Port IO4- Vacuum Sensor Nozzle 5-PSensorSMC5 M950 J12 C"!4.io5.in" ; Duet 3 3HC CAN_ID 4 Port IO5- Vacuum Sensor Nozzle 6-PSensorSMC6 ;***Outputs ; The VGs Discrete digital inputs therefore triggered with following commands to ON / OFF M950 P0 C"!0.out3" Q500 ; Duet 3 6XD (V_OUTLC1 , GND ) to Phoenix Contact 24V Relay 1 ( A1+, A2- ). Allocate OUT3 to Relay 1 M42 P0 S1 ; set 100% PWM on OUT3 out3 pin ( OFF or CLOSE VGs == X6(R1) is OFF) -- Start in a Closed VG status ;M42 P0 S0 ; set 0% PWM on OUT3 out3 pin ( ON or OPEN VGs == X6(R1) is ON) M950 P1 C"!0.out4" Q500 ; Duet 3 6XD (V_OUTLC1 , GND ) to Phoenix Contact 24V Relay 1 ( A1+, A2- ). Allocate OUT4 to Relay 2 M42 P1 S1 ; set 100% PWM on OUT3 out3 pin ( OFF or CLOSE VGs == X7(R2) is OFF) -- Start in a Closed VG status ;M42 P1 S0 ; set 0% PWM on OUT3 out3 pin ( ON or OPEN VGs == X7(R2) is ON) M950 P2 C"!0.out5" Q500 ; Duet 3 6XD (V_OUTLC1 , GND ) to Phoenix Contact 24V Relay 1 ( A1+, A2- ). Allocate OUT5 to Relay 3 M42 P2 S1 ; set 100% PWM on OUT3 out3 pin ( OFF or CLOSE VGs == X10(R3) is OFF) -- Start in a Closed VG status ;M42 P2 S0 ; set 0% PWM on OUT3 out3 pin ( ON or OPEN VGs == X10(R3) is ON) M950 P3 C"!0.out6" Q500 ; Duet 3 6XD (V_OUTLC1 , GND ) to Phoenix Contact 24V Relay 1 ( A1+, A2- ). Allocate OUT6 to Relay 4 M42 P3 S1 ; set 100% PWM on OUT3 out3 pin ( OFF or CLOSE VGs == X11(R4) is OFF) -- Start in a Closed VG status ;M42 P3 S0 ; set 0% PWM on OUT3 out3 pin ( ON or OPEN VGs == X11(R4) is ON) M950 P4 C"!0.out7" Q500 ; Duet 3 6XD (V_OUTLC1 , GND ) to Phoenix Contact 24V Relay 1 ( A1+, A2- ). Allocate OUT7 to Relay 5 M42 P4 S1 ; set 100% PWM on OUT3 out3 pin ( OFF or CLOSE VGs == X12(R5) is OFF) -- Start in a Closed VG status ;M42 P4 S0 ; set 0% PWM on OUT3 out3 pin ( ON or OPEN VGs == X12(R5) is ON) M950 P5 C"!0.out8" Q500 ; Duet 3 6XD (V_OUTLC1 , GND ) to Phoenix Contact 24V Relay 1 ( A1+, A2- ). Allocate OUT8 to Relay 6 M42 P5 S1 ; set 100% PWM on OUT3 out3 pin ( OFF or CLOSE VGs == X13(R6) is OFF) -- Start in a Closed VG status ;M42 P5 S0 ; set 0% PWM on OUT3 out3 pin ( ON or OPEN VGs == X13(R6) is ON) ;LIS3DH or LISwDW12 Accelerometer via SPI on Temp_DB connector . Use Input Shaping plugin to reduce ringing ; Default sampling rates and resolutions : LIS3DH: 1344 400 200 , LIS2DW12: 1600 800 400 200 M955 P0 C"spi.cs2+spi.cs1" ; All wires connected to temp DB connector, no temperature daughterboard. ;Collect accelerometer samples and save them to .csv file : default folder 0:/sys/accelerometer. Comment out when not collecting Accelerometer data M956 P0 S10 A0 ;MODBUS M575 P1 B115200 S7 ; Set Serial P1 comms ( IO0.in/out -Shared with PanelDue Header for UART Connection) parameters for TX and RX for the RS485 MODBUS RTU to FX3U-48MR PLC (All Comms ModBus RTU - Auxillary Serial Port 1) ;M575 P2 B115200 S7 ; Set Serial P2 comms ( IO1.in/out -Shared with RS485 Header on V1.02 and Later ) parameters for TX and RX for the RS485 MODBUS RTU to FX3U-48MR PLC (All Comms ModBus RTU - Auxillary Serial Port 2) ;M260.1 P1 A1 F{0x06} R{0x001E} B1 ; Test Modbus Write to Holding registers Corresponding to Coils on Base 1 Feeder 1 (Not Connected) ;M261.1 P1 A1 F{0x03} R{0x001E} B1 ; Test Modbus Read from Holding or Input registers / Coils on Base 1 ;M260.1 P1 A1 F{0x06} R{0x001E} B0 ; Test Modbus Write to Holding registers Corresponding to Coils on Base 1 Feeder 1 (Not Connected) ; Enable All the axes, drives and motors M17 ; Enable All Axes, and motors connected to Duet3 6XD Controller ; Heaters ; Fans ; Tools ; Custom settings are not defined G90 ; send absolute coordinates...Last Command.
I see from config.g that you allow the Z axis to go below zero:
M208 X0:340 Y0:447 Z-90:90 U-90:90 V-90:90 W-360000:360000 A-360000:360000 B-360000:360000 C360000 D-360000:360000 'k-360000:360000 ; Set axis minimum & Maximum axis Limts
What i was asking is are they perfectly level at heights other than 0, e.g. what if you send them all to Z1?
-
They are not perfectly aligned at Zero. Even if i try align them to let's Z1. i am no sure if that would help .
This are NEMA 11 & NEMA 17 Stepper motors , 1.8 Degrees Angle, 200 KHz . All i want is to make sure they are aligned correctly at Zero
-
@developeralgo222 If they are not aligned at any height then that's a different problem form the not being aligned at 0 only.
In your original post you mentioned
@developeralgo222 said in Perfect Horizontal Line alignment for Z-Axis Stepper motors:
I command the motor with Gcode to
move a distance 10 mm/Degree , then 5 mm/Degree and then 4 mm/Degreeafter moving to the Z20 position are they correctly aligned (or really, is the alignment the same as when they started the move. If not why not? I see you have 1 Z driver, but then also U, and V which are in the comments referred to a Z, each of those in the comments is described as having two motors per driver. what is getting out of sync. the motors on different drivers or the motors on the same drivers, or both?