3 AXIS CNC PLOTTER FROM DC MOTORS AND OPTICAL ENCODERS : 15 Steps (with Pictures) - brunineyes
Introduction: 3 AXIS CNC Machinator FROM DC MOTORS AND OPTICAL ENCODERS
I had one Dell printer that stops working and I disassembled it into small components. This printer head set up has 2 DC motors and 2 optical encoders which are even in good condition & can be reused to build XY axis for the CNC plotter.
Today, I'd like to share how to build 3 axis CNC plotter from this printer, as well American Samoa, how we prat control a DC efferent plus its optical encoder by P.I.D through 2 signals: STEP &adenylic acid; DIRECTION. In this project, DC motors can beryllium simulated as same as high stepper motors and we can check them via GRBL firmware for CNC application.
I was inspired by cswiger on his GitHub: https://github.com/cswiger/dcservodrive. He had a good idea to call on step/direction signals into DC servomechanism motor position verify.
Let's pay off started.
Update on October 10, 2022 at Pace 15: Better pictures with hatch fill extension.
Step 1: THINGS WE NEED
Main components:
- 1pcs x Arduino Uno R3.
- 1pcs x Arduino Mega 2560.
- 1pcs x Arduino CNC Shield V3 GRBL.
- 1pcs x Arduino L293D Efferent Shield.
- 1pcs x Stepper Motor Driver A4988.
- 1pcs x Mature Printer Head up Frame with 2 DC motors asset their sense organ encoders. I used old printer head frame from Dingle printer, extraordinary optical encoder is linear type and the otherwise is rotary type.
- 1pcs x Old CD/DVD Burner Writer Rom Player Drive.
- 4pcs x R10K (Or 2pcs x R5K).
- 1pcs x R150.
- 2pcs x XH2.54mm – 4P 20cm Wire Cable Double Connector.
- 2pcs x XH2.54mm – 2P 20cm Wire Cable Double Connector.
- 1pcs x Single/ Double Sided Printed Prototyping Board.
- 2pcs x 2.54mm Pitch 40 Long Thole I Stackable Harbour Female Header.
- 2pcs x Male & Female person 40pin 2.54mm Header.
- 1pcs x Aluminum Flexible Shaft Coupling, Intimate Hole out Size: 10mm x 10mm.
- 1pcs x Power Supply 12/24 VDC
- 1pcs x Force Provide 5 VDC.
- 2 beat x 8P Rainbow Ribbon Cable.
- Some itty-bitty cable ties.
Softwares:
- GRBL microcode.
- Inkscape.
- Universal Gcode Transmitter.
Step 2: CIRCUIT Plot
In my circuit plot, the X and Y high stepper motor driver are not plugged happening the Arduino CNC shield. The Pace and DIR signals of some X and Y axis of rotation on CNC Screen are used to control 2 x DC motors.
The schematic with PDF high resolution is HERE.
Step 3: DC Efferent AND OPTICAL ENCODER IN THE PRINTER
Details of printer components are described below:
1. DC MOTORS: In that location'Re 2 DC motors for X & Y axis as follows:
- X axis D.C. motor: RS-455PA-17150
- Y axis District of Columbia motor: RS-385SH-14180
Through my searches on cyberspace, perhaps these motors lie in to the MABUCHI MOTOR manufacturer. Just I could not find exterior the specifications of these motors on MABUCHI MOTOR site according to the order issue written connected the motors organic structure. I only saw cardinal DC motors equivalent to my pressman motors, As follows:
2. OPTICAL ENCODERS: There'Ra 2 kinds of optical encoders in Dingle printer as follows:
- X axis linear optical encoder
- Sensory receptor sensor and control board: Information technology is not realize, part identification number maybe J15 (0947).
- Encoder strip: H-06/1PM326727.
- Y axis rotary optical encoder:
- Cyclic disc: 1782CPR/300LPI (B-12).
- Optical sensor: H30 (0942).
- PCB board nameplate: 94V-O/ KY033H/ BJ4500F01CP4-1.
Notes:
- In the type of rotary encoders, resolution is specified as the cycles per revolution (CPR), some manufacturers use terms like "counts per revolution" (also abbreviated CPR) or pulses per revolution (PPR).
- Lines per inch (LPI) is a measurement of printing process resolution. High LPI indicates greater detail and sharpness.
Step 4: QUADRATURE OPTICAL ENCODER
The optical encoder is wide misused attributable its Sir David Low price and ability to provide signals that bathroom be easily understood to provide motion related information such as speed or lay out. The two output channels from an encoder, with one being offset by 90 electrical degrees, or one quarter of a cycle that ordinarily called quadrature encoder .
With a individual output encoder, information technology has no way of detecting in which direction the motion is happening. But for quadrature encoder, it produce two channels, named epithelial duct A and channel B. When IT moves/ rotates in a forward/ clockwise direction, channel A leads channel B, and in case information technology moves/ rotates in retroflex/ counterclockwise direction television channel B leads channel A. We can increase encoder's resolution away tally the rising and falling edges of two channels, contingent is explained below.
1. X1 ENCODING
X1 encoding: the rising or the falling edge of line A is counted. When channel B is leading, the campaign is well thought out as counterclockwise or backward, and the count number is decreased.
2. X2 Encryption
X2 encoding: some the rising and falling edges of convey A are counted. When X2 encoding is used, it increases encoder resolve by twofold.
3. X4 Encryption
X4 encryption: some the rising and decreasing edges of channels A and B are counted. When X4 encoding is used, it increases encoder solving by four times.
Mental picture below summarizes the quadrature routine of optical encoder:
For instance, we think a 1782CPR rotary optical encoder - Y axes of Dell pressman as described in previous step out:
- X1 – if we tally the rising edge of each Channel A pulse, we'll get 1 pulse per cycle or 1782 pulses per revolution (1782PPR).
- X2 – if we count each up edge and each falling edge of Line A, we'll commence 2 pulses per cycle, or 1782 x 2 = 3564 pulses per rotation (3564PPR).
- X4 – if we count each rising edge and falling edge of both Channel A and Channel B, we'll get 4 pulses per cycle, or 1782 x 4 = 7128 pulses per revolution (7128PPR).
Stride 5: DETERMINING Natural philosophy ENCODERS PINOUTS IN THE Printing machine
I have found a website that is rattling helpful in identifying the pins of optical encoder from the pressman:
https://reprap.org/wiki/Optical_encoders_01
I couldn't find depart count, maker or data sheets on these optical encoders. In this case, I used a multimeter to measure the resistance among optical sensor pins (6 pins in my case) to identify its pinouts: VCC, GND, carry A, communication channel B. As mentioned in previous step, there are 2 kinds of optical encoders in DELL printer: X bloc linear optical encoder and Y bloc circular physics encoder.
1. LINEAR OPTICAL ENCODER FROM PRINTER
On that point are many connectors / headers on the PCB board which confused me and I could not find the encoder pinout plot in these headers to get its feedback correctly. Finally, I decided to do my own negative feedback circuit for this optical detector as following steps:
- Firstly, I rhythmical the resistance among the optical sensing element pins (6 pins) and recorded them on a set back.
- Second, based on my knowledge about the IR LED and Photo-junction transistor, I figured out its connection conventional and reduplicate checkered whether I had any mistakes. With the resistor values measured, I guessed this linear optical sensor operative at 5V voltage level.
- Third, I remote the sensory system sensor from the PCB board. Mention that this optical sensor is rattling easy to personify broken if we hold the soldering tip on it too years.
- Fourth, for refuge, I supplied 3.3V potential difference level for powering this linear sense organ encoder. In my own schematic, I used 2 x 10K resistors contiguous in parallel because I did not have 5K resistors in my hand.
2. ROTARY OPTICAL ENCODER FROM PRINTER
At that place is 4 pins - heading connected the PCB control board and I easily found the encoder pinout diagram on this coping. I unbroken this original PCB negative feedback circuit, just removed 4 pins - header and replaced aside 4 cables.
Header pinout detail is as follows:
- Rowlock 1 – GND.
- PIN 2 – CHANNEL A.
- PIN 3 – VCC (3.3V).
- PIN 4 – CHANNEL B.
Abuse 6: THE P.I.D CONTROLLER
The PID controller is a closed-loop controller which is widely victimized in electrical, machine-driven, and physical science systems. The goal of PID controller is to adjust the assure value at the OUPUT by continuously evaluating the Misplay (e(t) = (SP - PV)) between a SETPOINT (SP) and the PROCESS VARIABLE (PV) being controlled and applies a rectification based on proportional, built-in, and derivative terms, to achieve the stability and rapid response in the system. PID algorithm for DC motor plus sense organ encoder is described in the diagram below:
You sack read one of the world-class blog articles about PID algorithmic program at website:
http://brettbeauregard.com/web log/2011/04/rising-...
In my project, Arduino Mega 2560 is used just equal a DC servomechanical controller. IT performs P.I.D operate for the X and Y axis vertebra DC motors.
Ordinarily, a motor will be compulsive by speed or situatio but with this PID restrainer, the setpoint are STEP plus Charge signals from Arduino Uno R3 which has GRBL firmware pre-installed.
The PID control signals are as follows:
- SETPOINT - SP: They are X.STEP/ X.DIR plus Y .STEP / Y.DIR signals that are sent from Arduino Uno R3 with a CNC Shield to Arduino Mega 2560. Note that Arduinno Uno has GRBL firmware pre-installed.
- PROCESS VARIABLE - PV: The rhythmical feedback appreciate from quadrature visual encoders to Arduino Mega 2560.
- OUTPUT: The PWM signals from Arduino L293D Motor Shield (restricted by Arduino Mega 2560) to printer Direct current motors.
Stair 7: ARDUINO L293D MOTOR Screen & CNC SHIELD V3
1. Arduino L293D Motor Shield Overview:
This centrifugal driver elaboration board is settled on the L293D chip which is planned to ride ascending to 4 bidirectional D.C. motors with someone 8-bit belt along selection. It commode also drive out 2 unipolar or bipolar stepper motors. It contains 4 H-bridges which provide up to 0.6 A per bridge (1.2A peak) at voltages from 4.5 V to 36 V. This buckler has cut down resistors to stay fresh the motors out of action during power up. It also features a 2-pin terminal block to ensure separate logic and motorial extrinsic power supplies. This motive driver shield is adequate to of driving:
- Four DC motors and two servos
- Two DC motors, stepper motor, and two-way servo
- Ii stepper motors and servos
The following pins are in expend along the L293D Centrifugal Shield:
- Digital fall 11: DC Centrifugal #1 / Stepper #1 (activation/speed control).
- Digital pin 3: DC Motor #2 / Hoofer #1 (activation/rush control).
- Digital pin 5: DC Motor #3 / Stepper #2 (activation/speed control).
- Digital pin 6: DC Motor #4 / Stepper #2 (activation/speed keep in line).
- Digital pin 4, 7, 8 and 12 are used to drive the DC/Stepper motors via the 74HC595 successive-to-parallel latch.
- Digital pin 9: Servo #1 control.
- Integer pin 10: Servomechanical #2 control.
2. CNC Shield V3
The Arduino CNC Buckler makes IT easy to set out your CNC projects up. It uses opensource firmware on Arduino to control 4 stepper motors using 4 x Stepper Motorial Driver.
Before using this CNC shield with Arduino Uno R3, a control firmware "GRBL" need to be downloaded into Arduino board.
Step 8: ASSEMBLY &ere; CONNECTION
I. CONTROL BOARDS Forum:
1. Transcriber Shield:
To do Adaptor Shell, I cut one PCB prototype board size up 60x90mm and soldered the wires connections following the tour on Ill-trea 2. Adapter Shield is old for connecting the Arduino Mega 2560 to the L293D Motor Shield and some male headers such atomic number 3: 4 pins - headers for encoders (Vcc, GND, Channel A, Conduct B), X.STEP, Y.STEP, X.DIR, Y.DIR are besides soldered on that.
-
Top purview of Adapter Shield:
-
Bottom view of Adapter Shield:
2. Control board assembly:
- Plug CNC Shield on Arduino Uno:
- Two copper pillars were installed at the bottom of Arduino Uno board.
- Connect Arduino Uno to L293D Motor Harbor by 2 copper pillars higher up.
- Plug L293D Motor Shield on Adaper Shield and finally hack Adapter Buckler to Aduino Mega 2560. I've got a neatly organized controller.
II. PRINTER Psyche FRAME ASSEMBLY
- The bottom of the printer head frame is not plane, it has nipple-shaped and concave supports. I had to use an insulation sheet and cut some long grooves similar to the convex supports so that the printer head frame could be fixed horizontally and vertically.
- For Z Axis, I used a DVD instrumentalist which is very compact, known as "HP Super Multi DVD Rewriter" atomic number 3 shown below:
- I mounted this Videodisk stepper drive frame on the printhead.
- I soldered a line to Y axis - circular optical encoder (See the detail how to dertimine its pinouts at STEP 5).
- X axis - linear optical encoder cable was soldered and geostationary along the printer frame. (See the detail how to determine its pinouts at STEP 5).
- My DIY linear encoder control add-in is hidden inside the printhead, I forgot to take pictures of information technology while I soldered the circuit. I cannot disassemble this printer frame once again because it can cause the linear encoder strip damaged. On my late disassembled, the encoder landing strip lost some black lines on it.
III. CONNECTIONS:
- Arduino Mega 2560 and Arduino Uno connect together by 4 signals: X.STEP, Y.STEP, X.DIR, Y.DIR to control 2 DC motors, in which the Arduino Mega 2560 acts Eastern Samoa a DC servo control and Arduino Uno nonnegative CNC Shield sends the control commands from its GRBL firmware.
- D.C. Motors and Receptor Encoders: Two DC motors are connected to L293D Drive Harbour at M1 & M2 terminals. And their optical encoders are connected to 4pins - headers happening Adapter Shield.
- I blocked stepper motor driver A4988 connected CNC harbor for Z axis and connected cablegram from DVD high stepper motor to A4988 driver.
- Mounting adaptable coupling to the DVD frame and put the pen into the flexible sexual union. To clamp the pen, we can tighten small screws on the yielding coupling. It looked care this, after my assemblies and connections were completed.
Step 9: ARDUINO LIBRARIES
Dance step 10: ARDUINO CODE
The 3 bloc CNC plotter code is available at my GitHub. Thanks to cswiger for inspiring ME.
In my inscribe, Arduino Mega 2560 pins usage are shown in table below. Take note that digital pin D3 (Interrupt 0) is used for L293D Motor Shield.
Encoders have 2 signals, which must be connected to 2 pins. There are three options when we use "Encoder" program library.
- Go-to-meeting Performance: Both signals connect to interrupt pins.
- Goodish Performance: First signal connects to an interrupt pin, second to a non-interrupt pin.
- Low Carrying into action: Both signals connect to non-interrupt pins.
I used the second option and IT was stated in course of study as follows:
// Set finished pins for the Quadrature Encoder #define EncoderX_ChannelA 18 // Interrupt 5 #define EncoderX_ChannelB 22 #define EncoderY_ChannelA 20 // Interrupt 3 #define EncoderY_ChannelB 24 ------------------------------------------------------------------------------------------------- // Encoders Encoder XEncoder(EncoderX_ChannelA, EncoderX_ChannelB); Encoder YEncoder(EncoderY_ChannelA, EncoderY_ChannelB);
With "AFMotor" library, when used with the L293D Motor Shield, the AF_DCMotor class provides stop number and direction control for heavenward to 4 DC motors. Here at a lower place is the constructor for X and Y axis DC motors
AF_DCMotor motorX(1, MOTOR12_8KHZ); AF_DCMotor motorY(2, MOTOR12_8KHZ);
To simulate a DC motor plus its encoder as same atomic number 3 a stepper motor, we used interrupts to detect uprising abut at STEP pulse and combine with DIR signal to determine motor way and position.
#delineate STEP_XPIN 19 // Interrupt 4 #define STEP_YPIN 21 // Interrupt 2 #define DIR_XPIN 23 #define DIR_YPIN 25 -------------------------------------------------------------------------------------------------- // Simulate DC motor as same as hoofer motor attachInterrupt(4, doXstep, Up); // PIN 19 (Interrupt 4) - Break up X step out at improving abut pulses attachInterrupt(2, doYstep, RISING); // PIN 21 (Interrupt 2) - Interrupt Y step at rising edge pulses -------------------------------------------------------------------------------------------------- void doXstep() { if ( digitalRead(DIR_XPIN) == HIGH ) SETPOINT_X--; else SETPOINT_X++; } void doYstep() { if ( digitalRead(DIR_YPIN) == HIGH ) SETPOINT_Y--; other SETPOINT_Y++; } PID controllers for X/Y axis of rotation are created and joined to the mere Input, Output, and Setpoint:
// PID PID myPID_X(&ere;INPUT_X, &OUTPUT_X, &adenosine monophosphate;SETPOINT_X, KP_X, KI_X, KD_X, DIRECT); PID myPID_Y(&ere;INPUT_Y, &OUTPUT_Y, &SETPOINT_Y, KP_Y, KI_Y, KD_Y, Flat-footed);
The parameters of the Pelvic inflammatory disease controllers are described at a lower place:
- SETPOINT_X/ SETPOINT_Y: The STEP and DIR signals are sent from GRBL CNC Shield of Arduino Uno to Arduino Mega 2560. Arduino Mega 2560 receive these STEP and DIR signals of each axis X/Y, then combine them to create the SETPOINT values for each PID controller.
- INPUT_X/ INPUT_Y: They are feedback signals which are read from quadrature encoders of X/ Y DC motors.
- OUTPUT_X/ OUTPUT_Y: They are PWM yield signals which insure the X/Y motors.
- K_P/ K_I/ K_D: They'ray tuning parameters. These affect how the Pelvic inflammatory disease will change the output.
Step 11: GRBL CALIBRATION
GRBL parameters for my pressman are every bit follows:
| $0 | 10.000 | Step pulse time |
| $1 | 25.000 | Step idle delay |
| $2 | 0.000 | Step pulse invert |
| $3 | 3.000 | Step direction invert |
| $4 | 0.000 | Invert step enable pin |
| $5 | 0.000 | Turn back specify pins |
| $6 | 0.000 | Invert probe rowlock |
| $10 | 1.000 | Status report options |
| $11 | 0.010 | Junction deviation |
| $12 | 0.002 | Arc leeway |
| $13 | 0.000 | Cover in inches |
| $20 | 0.000 | Soft limits enable |
| $21 | 0.000 | Hard limits enable |
| $22 | 0.000 | Homing cycle enable |
| $23 | 0.000 | Homing direction invert |
| $24 | 25.000 | Homing locate feed rate |
| $25 | 500.000 | Homing search seek range |
| $26 | 250.000 | Homing switch First State-bounciness delay |
| $27 | 1.000 | Homing tack pull-off outstrip |
| $30 | 1000.000 | Maximal spindle speed |
| $31 | 0.000 | Minimum spindle speed |
| $32 | 0.000 | Optical maser-mode enable |
| $100 | 24.500 | X-axis move around resolution |
| $101 | 192.000 | Y-axis travel resolution |
| $102 | 53.333 | Z-axis locomote resolution |
| $110 | 20000.000 | X-axis maximum rate |
| $111 | 20000.000 | Y-axis vertebra level bes rate |
| $112 | 2000.000 | Z-axis maximum rate |
| $120 | 50.000 | X-bloc acceleration |
| $121 | 20.000 | Y-axis acceleration |
| $122 | 50.000 | Z-axis acceleration |
| $130 | 210.000 | X-axis maximal travel |
| $131 | 297.000 | Y-axis maximum travel |
| $132 | 40.000 | Z-bloc maximum travel |
The primal parameters which I feature done the calibrations are highlighted in table above.
1. STEP/MM setting:
- Z AXIS - $102:
The stride/mm setting for Z axis stepper drive is shown in table below past rule:
Steps/mm = (Steps per Revolution)*(Micro-steps) / (mm per Revolution)
| The working length of the be intimate: | 40.00 | mm |
| Step angel: | 18 | ° |
| The numeral of stairs required for DVD stepper to ready 1 completed gyration: | 20 | step/rev |
| A4988 micro-stairs setting: | 8 | - |
| DVD stepper screw pitch (mm/revolution): | 3.0 | millimetre/rev |
| STEP/Millimeter: | 53.333 | step/mm |
- Y AXIS - $101
If we're using belts and pulleys, the XY steps/mm can represent calculated based along the motor, pulley, and belt specifications just in my case, the printer need to embody disassembled. I did it once and don't want to do it again because it can cause my printer damaged.
Y axis have a 1782CPR rotary optical encoder. When X4 encoding is used, IT increases encoder firmness past four times: 1782 x 4 = 7128 pulses per revolution (7128PPR). For setting step/mm of Y Axis, I did shadowing steps:
- First, I connected Adaptable Gcode Sender political program to Arduino Uno (with GRBL), coiffur $101 = 7128 in tab "Microcode Setting". The purpose is I want to check when I dominate Y axis to move 1mm, the Arduino Mega 2560 will return PMW to move the DC motor and bet 7128 pulses feedback from optical encoder.
- Second, I opened Arduino IDE serial interface for Arduino Mega 2560 and turn on debug modal value for Y axis in program to ride herd on all parameters.
- Third, I marked the home situatio of Y bloc.
- Fourthly, I used the "Machine Control" tab in Universal Gcode Transmitter, instruct the pressman Y axis vertebra to move 1 millimeters. Chequered:
- Is it splay 1 revolution?
- Is count number from encoder in serial monitor round the value of 7128?
- Fifthly, I ready-made a measurement of the true movement from home put over: 37.59mm.
- Sixthly, I applied this formula to calculated the inexperienced step/millimeter = (old footprint/mm) x (1mm/ real measured value)=192.0 step/millimeter then update to $101 GRBL.
- Eighthly, I readjust the Arduino Uno (with GRBL), marked the home placement and instructed extraordinary more commands to make a motion Y axis with difference position. I made a measurement of trueness movement and repeated the above step. Finally, step/mm for X was determined to be: 192.0.
- X AXIS- $100
- For X bloc linear optical encoder, firstly I counted the figure of black lines per 1mm along the encoder strip. In my case, it is betwixt 6 and 7 covert lines per 1mm. When X4 encoding is used, IT increases encoder resolution by four times so step/mm could be between 24 to 28 .
- Same every bit Y axis, I marked the X axis home location and instruct some commands to move X axis vertebra with difference position then successful a measurement of the true movement. At last, step/millimetre for X axis is: 24.5
2. MAXIMUM RATE AND ACCELERATION
- To race dormie the printer, some X and Y axis maximum rate ($110 and $111) are set to 20000.
- The Y-axis quickening ($121) is set to 20 if we set it at a banging value then when the motor switches from forward to backward and frailty versa its whang wish pillow slip and there is a gaudy noise.
3. AXIS MAXIMUM Go around
- X-axis maximum travel ($130): A4 size width 210 mm.
- Y-axis utmost travel ($131): A4 size up length 297 millimetre.
- Z-bloc maximum travel ($132): DVD working length 40 mm.
Step 12: P.I.D TUNNING
GRBL and P.I.D parameters fine-tuning are the most important and the most difficult whole caboodle of this jut. They affect to the printer operation, for object lesson when I draw a delineate in the X and Y axes with 20mm length, the printer did information technology precisely, but when I draw a 20mm diameter circle, it got distorted.
That means, in order for the printer to employment correctly, the X and Y axes both take to forg precisely when separated each early, besides American Samoa, ensure their synchronization when cooperative together. These calibrations are not easy for some PID and GRBL parameters. It is time consuming and I wished I had a oscilloscope in my hand to figure unconscious all things quickly. I finally found out the PID optimal parameters which are in accordance to the GRBL setting values in the previous step. With these values, my plotter has worked very well.
// The PID parameters double KP_X = 20.0; // P for X motor double KI_X = 0.03; // I for X motor stunt man KD_X = 0.01; // D for X motor double KP_Y = 9.0; // P for Y motor double KI_Y = 0.02; // I for Y motor double KD_Y = 0.01; // D for Y causative
In postindustrial field, the PID controller is usually integrated with a "deadband" affair. The destination is saving maintaince monetary value, it keep our equipment, for example big valves, oscillating all the time or so the setpoint by humble worthless movements and cause equipment wear and tear or strange overheat issues.
The deadband represents the range at which the PID controller will permit the process variable (PV) to deviate from setpoint (SP) without applying whatever correction. For instance, imagine that we are trying to maintain the printer's Y-Axis at 100mm from home position. When the Y axis moves to the set point, if its position was to vacillate 'tween 99.9mm and 100.1mm, the PID controller would exert no more correction. The stagnant band or acceptable error would be 0.1mm .
#define STEPSPERMM_X 24.5 // Footstep/millimetre ($100) is used in the GRBL for DC motor X axis. #delineate DEADBW_X 4.5 // Deadband breadth in pulses = 4.5 --> Acceptable erroneous belief for positioning in mm: 0.18mm. #define STEPSPERMM_Y 192.0 // Stride/mm ($101) is used in the GRBL for DC motor Y axis. #delimitate DEADBW_Y 19.2 // Deadband width in pulses = 19.2 --> Acceptable error for positioning in mm: 0.1mm.
When we apply the deadband in Pelvic inflammatory disease controller, it will increase the service life of the motor because IT volition stop when its cognitive process values are in deadband window. Otherwise, the printing machine D.C. causative is always oscillating around the setpoint by PID regulators and it can atomic number 4 getting hot or overheat.
ERROR_X = (INPUT_X - SETPOINT_X); if (abs(ERROR_X) < DEADBW_X) // If the motor is in position within the deadband width (fit error) { motorX.setSpeed(0); // Put off the motive } else { motorX.setSpeed(abs(int(OUTPUT_X))); // Motor is regulated by PID restrainer ouput } We can turn along the debugging mode in Arduino program and check the PID parameters happening the serial monitor:
As we can see, the error between the X axis setpoint (735) and actual counting feedback from encoder (731) is 4, in this case X-axis motor stops because it is within the deadband range (4.5).
Footstep 13: Examination
1. PREPARATIONS AND FINAL CALIBRATIONS:
- For testing, I used a thin ruler to creat plotting surface of Y axis. Take promissory note that the distance from the revolve around of printing machine hair curler to the pen tip is as sawn-off as possible, it is more or less 20 mm in my case.
- At last, I added the A4 paper to printer. It's ready to do examination.
- We should coif the PID and GRBL final calibrations and fine-tunings in this step when the printer is working with load. It can work smoothly when we do a no onus test merely it can shake crazily when paper is loaded. Making a printer acts like a CNC conspirator is really non comfy!!!
2. INKSCAPE
- From the Inkscape carte du jour go to File ‣ Properties and in the Page Lozenge fix the Display Units (millimeters), the Orientation to Portrait and Page Sized A4: 210.0 x 297.0mm.
- Import a suitable image by using the menu File ‣ Import. In the menu, go to Path ‣ Trace Bitmap and convert the Aim to Path.
- Go to Extensions ‣ Gcodetools ‣ Tools Libary
- Select Tools Type: Cylindrical and click Apply.
- I tried feed speed: 5000mm/s. My CNC plotter worked fast and stable at this speed rate.
- Attend Extensions ‣ Gcodetools ‣ Orientation Points
- Orientation type: 2-points mode.
- Z Come up: 0.0mm. This is the top of your paper surface.
- Z Depth: -1.0mm. This is working position of Z axis when CNC conspirator is drafting object. This negative number control that the write out tip bottom touch modality the paper.
- Go to Extensions ‣ Gcodetools ‣ Path to Gcode
- Z safe height: 3mm. It is height in a higher place the plotting surface when moving betwixt drawing points.
- Detent the Path to Gcode Tab earlier clicking Apply. This creates the G-codification file.
3. UNIVERSAL GCODE Political platform
- Open Universal Gcode Platform, choice Port and set Baud to 115200, click on Connect tab key.
- Select the appropriate set back aside moving X axes left - right hand, Y axes forward - backward and set the avant-garde coordinates by button Reset Zip.
- Click Open ‣ Browse to the G-code file that generated by INKSCAPE.
- Click Send and CNC plotter will execute draft picture following the G-code.
- Monitor the plotter in execute on the Visualiser tab.
And here below is my result:
Here's a slightly more complicated drawing, a flower. CNC plotter has worked very well.
We can see CNC plotter lock as the video below. I set information technology in low speed rate: 500mm/s.
With pliant coupling diam 10mm, we can easily modification to many kind of pens/ pencils by two small screws.
You can watch the video below after I changed a contrastive people of color pen and eat hotfoot has been set to 15000 mm/s.
Step 14: FINISH
You can get word some pictures of this project. My 3 bloc CNC plotter works beautiful nifty but it need to be more fine-tuned and improvement.
Thank you very much for reading my bring up and Leslie Townes Hope you enjoyed my article this time!
Dance step 15: BETTER PICTURES WITH HATCH FILL EXTENSION
AxiDraw Software 2.6.3 by Evil Mad Man of science Laboratories - This extension fill the standard hatch and crosshatch on selected blinking objects in an Inkscape 1.0. It is really useful and now my plotter can buoy draw some better quality images.
You can check at video below:
Cost the First to Divvy up
Recommendations
Source: https://www.instructables.com/3-AXIS-CNC-PLOTTER-FROM-DC-MOTORS-AND-OPTICAL-ENCO/
Posted by: brunineyes.blogspot.com

0 Response to "3 AXIS CNC PLOTTER FROM DC MOTORS AND OPTICAL ENCODERS : 15 Steps (with Pictures) - brunineyes"
Post a Comment