Difference between revisions of "Stratasys uPrint Retrofit"
Line 29: | Line 29: | ||
Reading either channel A or channel B is adequate for determining how many divisions the servo motor has changed, but in order to determine the direction the motor is spinning, both channels must be compared to one another. By comparing the data between channel A and B it can be seen which direction the motor is spinning based on which channel sends a High Logic level signal first. | Reading either channel A or channel B is adequate for determining how many divisions the servo motor has changed, but in order to determine the direction the motor is spinning, both channels must be compared to one another. By comparing the data between channel A and B it can be seen which direction the motor is spinning based on which channel sends a High Logic level signal first. | ||
− | For example if channel A sends a logic high signal before channel B sends a logic high signal, the motor may be spinning clockwise. If channel B sends a logic high signal before channel does, it may be spinning counter-clockwise. The actual directions are not important, as your main logic controller should be able to invert the direction on the trough configuration settings should it not be correct initially. | + | For example if channel A sends a logic high signal before channel B sends a logic high signal, the motor may be spinning clockwise. If channel B sends a logic high signal before channel A does, it may be spinning counter-clockwise. The actual directions are not important, as your main logic controller should be able to invert the direction on the trough configuration settings should it not be correct initially. |
==== PID Control ==== | ==== PID Control ==== |
Revision as of 22:59, March 28, 2020
Contents
Controlling Stepper Motors
The X, Y and Z axis stepper motors are powered by two Allegro A3959 Full Bridge PWM Motor Drivers, one for each of the two coils in the stepper motors.
The inputs for each of the stepper motors can be found on PDB connector J13. Each axis contains the following individual connections: Phase A, Phase B & Voltage Reference A, Voltage Reference B. Additionally all motor drivers can be put to sleep simultaneously though J13 Pin #45.
Controlling Servo Extruder Motor
The servo motor for the filament extruder is controlled with an STMicroelectronics L298P Dual Full Bridge Motor Driver. The extruder motor is a DC powered motor with a built in quadrature encoder that sends a signal back for computation of the current position.
The inputs for the servo motor are found on PDB Connector J13. There are two input pins for each of the motor driver signals: Phase A & B, as well as two outputs to be read from the quadrature motor encoder: Channel A & B. Additionally all motor drivers can be put to sleep simultaneously though J13 Pin #45.
Motor Control Phases
The L298P requires two inputs in order to control both the speed and direction of the servo motor. The signal involved uses pulse width modulation (PWM) in order to provide varying values of speed and direction to the motor. This is best done by providing an analog TTL voltage signal to the motor controller where a voltage of 0VDC is a stopped motor and 5VDC is a motor running at full speed.
While sending a full TTL signal to the motor chip will run it at full speed, we also need to control the direction. This can be done by only sending signals to one input at a time. For example, to run at 100% clockwise, we will send a 100% signal to Phase A and a 0% signal to Phase B. To run counter-clockwise we would send the opposite, 0% signal to Phase A and 100% signal to Phase B. A stopped motor would need a 0% signal on both Phase A and Phase B.
Since running the motor at 100% speed at all times would not be very useful, the logic controller must control the speed accurately. It should slowly ramp up and down to prevent large inrushes of current and bursts of speed that may be unnecessary. This should be done by the logic controller once the data from the encoder is read.
Quadrature Encoder
The Quadrature Encoder is a simple set of square wave pulses that are sent back to the logic board using two offset encoding wheels physically connected to the rotating motor shaft. They send a set number of pulses per rotation of the motor shaft and can also determine what direction the motor is spinning. At this time it is believed the encoder used on the servo motor is capable of 1000 counts per rotation. The exact number is not necessary to be known, but whatever method is used to read the signal, must be capable of reading the data in at a quick enough rate to accurately count the rotational position.
For example, a motor spinning at 100 RPM is 1.6 rotations per second. With 1000 signal steps per rotation, the logic computer must be able to read 1600 state changes per second at a minimum. It is recommended that there be 4-5 times that number to accurately account for all state changes, so an input signal of 8,000 readings per second (or 8Khz) would be sufficient at that speed. For our purposes, we recommend using a device that is capable of 30Khz or higher to prevent steps from being missed. The extruder servo motor shouldn't rotate more than approximately 200 RPM (16Khz minimum encoder read rate).
Reading either channel A or channel B is adequate for determining how many divisions the servo motor has changed, but in order to determine the direction the motor is spinning, both channels must be compared to one another. By comparing the data between channel A and B it can be seen which direction the motor is spinning based on which channel sends a High Logic level signal first.
For example if channel A sends a logic high signal before channel B sends a logic high signal, the motor may be spinning clockwise. If channel B sends a logic high signal before channel A does, it may be spinning counter-clockwise. The actual directions are not important, as your main logic controller should be able to invert the direction on the trough configuration settings should it not be correct initially.
PID Control
Knowing the motor's position and having the ability to control the speed and direction of the motor is only half the battle. We need to close the loop between the encoder signals and the motor output signals through a Proportional - Integral - Derivative (PID) control system.
In order to move the motor, for example 1000 steps based on the encoder readout, we will need to supply power to the motor to spin in the correct direction. Let's say the motor starts spinning at 100% speed and then counts 1000 steps on the encoder and then turns off the motor power. The motor will keep spinning beyond 1000 steps, and perhaps stop at 1200 steps, this is called overshoot.
We need a system that will slowly ramp up the motor speed at the beginning of the movement, reach the highest possible speed and then as it approaches the 1000 count, slowly ramp down the motor speed until it stops on exactly 1000 counts. This can best be accomplished with a PID Controller, which takes into account the speed, acceleration and position of the motor and monitors how those numbers change over time.
There are three factors that must be determined for the PID system:
Proportional
The Proportional value is the most important factor in the movement of the system. It determines how much power is to be supplied to get the motor to the correct position. As an example, if we wanted to move a motor 1000 positions on the encoder counter, a proportional approach would supply 100% power the farther away from the intended target and reduce power the closer you get. This approach generally works, but it results in overshoot, or takes a long time to reach the 1000 count.
Integral
The Integral value aids the power calculation by looking at the speed at which the motor is spinning as it approaches the intended value. If we add an integral value, it will greatly help reducing the potential for overshooting by adjusting the power accordingly. The Integral value effectively helps the motor spin as fast as it can given the speed it is currently rotating.
Derivative
Similar to the Integral, the Derivative value works works by adjusting the motor power to ensure it reaches the intended target in relation to how close the motor is from the intended value. In our example if we want to reach 1000 positions on the encoder counter, but we arrive at 1001, the Derivative function will aid in reaching 1000 without going too deeply into the opposite direction and creating an oscillation called ringing.
PID Tuning
In order to build an effective PID system, the motor must be tuned to determine what the proportional, integral and derivative values are for the system. This is something that needs to be determined for the uPrint servo directly with your intended control system by adjusting PID values.
The goal of tuning is to achieve the fastest response from a given input without overshooting and without ringing. There are many tuning methods, but it is generally best to adjust the values one at a time in order.
For your reference a known PID configuration for the uPrint Servo motor is here:
Parameter | Value for uPrint Servo Motor |
---|---|
KP Proportional | Unknown |
KI Integral | Unknown |
KD Derivative | Unknown |
Power Distribution Board (PDB)
Diagram | PCB Designation | Connection | Function |
---|---|---|---|
A | J1 | AC Power In | |
B | J2 | Power Switch / Thermal Safety Switch | |
C | J3 | Chamber Heaters | |
E | J22 | Auxiliary 120VDC Power Supply | |
E | J8 | Z-Axis Limit Switches, Chamber Fans & Machine Serial Number | |
F | J9 | Z-Axis Motor | |
G | J10 | I/O Board Connection | |
H | J11 | I/O Board Connection | |
I | J7 | 24VDC Power Supply | |
J | TEST PTS | Test points where you can diagnose signals and voltages | |
K | J4 | 5/12VDC Power Supply | |
L | TEST PTS LED's | LEDs that indicate various functions on/off | |
M | J12 | Serial Connection to Material Bay | |
N | J16 | Serial Connection to Uninterruptible Power Supply (UPS) | |
O | J18 | Front Panel LCD Connector | |
P | J15 | Samtech EHT-125-01-F-D | Controller Board Connection |
Q | J14 | Samtech EHT-110-01-F-D | Controller Board Connection |
R | J13 | Samtech EHT-125-01-F-D | Controller Board Connection |
J13
Pin | Function |
---|---|
1 | X-Axis Voltage Reference #1 |
2 | Ground |
3 | X-Axis Voltage Reference #2 |
4 | Ground |
5 | Y-Axis Voltage Reference #1 |
6 | Ground |
7 | Y-Axis Voltage Reference #2 |
8 | Ground |
9 | Z-Axis Voltage Reference #1 |
10 | Ground |
11 | Z-Axis Voltage Reference #2 |
12 | Ground |
13 | Ground |
14 | Ground |
15 | N/C |
16 | Ground |
17 | X-Axis Phase #1 PWM |
18 | Ground |
19 | X-Axis Phase #2 PWM |
20 | Ground |
21 | Y-Axis Phase #1 PWM |
22 | Ground |
23 | Y-Axis Phase #2 PWM |
24 | Ground |
25 | Z-Axis Phase #1 PWM |
26 | Ground |
27 | Z-Axis Phase #2 PWM |
28 | Ground |
29 | Extruder Servo Motor Encoder #1 |
30 | Ground |
31 | Extruder Servo Motor Encoder #2 |
32 | Ground |
33 | Extruder Servo Motor PWM #1 |
34 | Ground |
35 | Extrider Servo Motor PWM #2 |
36 | Ground |
37 | N/C |
38 | Ground |
39 | N/C |
40 | Ground |
41 | N/C |
42 | Ground |
43 | N/C |
44 | Ground |
45 | Motor Enable (0V = Off, 5V = On) |
46 | Ground |
47 | +5VDC |
48 | +5VDC |
49 | +12VDC |
50 | +12VDC |
J14
Pin | Function |
---|---|
1 | Ground |
2 | N/C |
3 | N/C |
4 | Print Head Blower Enable (0V = Off, 5V = On) |
5 | Ground |
6 | Print Head Type B (Unknown function) |
7 | N/C |
8 | Print Head Model Toggle Switch (5V when model extruder is enabled) |
9 | Ground |
10 | Print Head Support Toggle Switch (5V when support extruder is enabled) |
11 | N/C |
12 | N/C |
13 | Ground |
14 | N/C |
15 | Ground |
16 | Ground |
17 | +5VDC (NEED TO VERIFY) |
18 | Ground |
19 | N/C |
20 | Ground |
J15
Pin | Function |
---|---|
1 | Ground |
2 | X-Axis End of Travel Limit Switch |
3 | X-Axis Home Limit Switch |
4 | Y-Axis End of Travel Limit Switch |
5 | Y-Axis Home Limit Switch |
6 | Z-Axis End of Travel Limit Switch |
7 | Z-Axis Home Limit Switch |
8 | Print Bed Touch Probe Limit Switch |
9 | Ground |
10 | N/C |
11 | Chamber Heater Enable (Off = 0V, On = 5V) |
12 | LED Lights Enable (Off = 0V, On = 5V) |
13 | Door Solenoid Enable (Off = 0V, On = 5V) |
14 | Door Switch |
15 | N/C |
16 | Power Enable (turns on machine) |
17 | Ground |
18 | Extruder Model Heater Enable (Off = 0V, On = 5V) |
19 | Extruder Support Heater Enable (Off = 0V, On = 5V) |
20 | Ground |
21 | N/C |
22 | N/C |
23 | On / Off Power Switch |
24 | Uninterruptible Power Supply Signal (5V when power outage?) |
25 | N/C |
26 | N/C |
27 | N/C |
28 | Ground |
29 | N/C |
30 | N/C |
31 | Head Type A (unknown function) |
32 | Print Head Temperature Alarm |
33 | Chamber Temperature Alarm |
34 | Ground |
35 | Print Head Model Thermocouple Signal |
36 | Ground |
37 | Print Head Support Thermocouple Signal |
38 | Ground |
39 | Chamber Temperature Thermocouple Signal |
40 | Ground |
41 | Material Bay Serial Data (In) |
42 | Material Bay Serial Data (Out) |
43 | N/C |
44 | N/C |
45 | Ground |
46 | Ground |
47 | +5VDC |
48 | +5VDC |
49 | +12VDC |
50 | +12VDC |
I/O Board
The I/O Board is the main place where connections are made to the ancillary boards in the extrusion head, X, Y motors, limit switches and front panel display. It is also where the main chamber's thermocouple is connected along with an on board analog-to-digital converter.
Diagram | PCB Designation | Connection | Function |
---|---|---|---|
A | J510 (PDB 1) | Board to Board Interconnect to the Power Distribution Card (PDC) | |
B | J511 (PDB 2) | Board to Board Interconnect to the Power Distribution Card (PDC) | |
C | J507 (CHAMBER TC) | Omega PCC-SMP-K | Chamber Thermocouple |
D | J501 (Y-MOTOR) | Molex Microfit 3.0 (4-Pin) | Y-Axis Motor |
E | J502 (X-MOTOR) | Molex Microfit 3.0 (6-Pin) | X-Axis Motor |
F | J503 (Y SENSORS) | Molex Microfit 3.0 (18-Pin) | Y-Axis Limit Switches |
G | J504 (UPPER HARNESS) | Molex Microfit 3.0 (24-Pin) | Front Panel & Chassis wiring (blower fan, on/off switch, chamber lights, door solenoid and magnetic door switch) |
H | J505 (UMB1) | Molex Microfit 3.0 (22-Pin) | Umbilical head harness 1. (Model and support heaters, toggle switch sensor, X-axis limit switches) |
I | J506 (UMB2) | Molex Microfit 3.0 (12-Pin) | Umbilical head harness 2 (Print bed level sensor, head drive motor, model and support thermocouple) |
J501 (Y-MOTOR)
This connection connects the electronics to the Y-Axis motor (forward and back motion). This is a Molex Microfit 3.0 connector with 4 positions.
Pin | Wire Color | Function |
---|---|---|
1 | Black | A+ |
2 | Blue | B+ |
3 | Green | A- |
4 | Red | B- |
J502 (X-MOTOR)
This connection connects the electronics to the X-Axis motor (side to side motion). This is a Molex Microfit 3.0 connector with 6 positions.
Pin | Wire Color | Function |
---|---|---|
1 | Black | A+ |
2 | - | N/C |
3 | Black | B+ |
4 | Black | A- |
5 | - | N/C |
6 | Black | B- |
J503 (Y SENSORS)
Pin | Wire Color | Function |
---|---|---|
1 | - | NC |
2 | - | NC |
3 | Red | +Vcc |
4 | Red | +Vcc |
5 | Yellow | Y-Axis End of Travel Limit Switch |
6 | - | NC |
7 | - | NC |
8 | - | NC |
9 | - | NC |
10 | - | NC |
11 | Green | Ground |
12 | Yellow | Y-Axis Home Limit Switch |
13 | Green | Ground |
14 | - | NC |
15 | - | NC |
16 | - | NC |
17 | - | NC |
18 | - | NC |
J504 (UPPER HARNESS)
Pin | Wire Color | Function |
---|---|---|
1 | Red | Front LCD, unknown function |
2 | White | Front LCD, unknown function |
3 | Blue | Front LCD, unknown function |
4 | Orange | Front LCD, unknown function |
5 | - | NC |
6 | Yellow | Power Switch |
7 | Yellow | Magnetic Sensor |
8 | White | Door Solenoid |
9 | Black | LED Lighting (Negative) |
10 | Black | LED Lighting (Negative) |
11 | - | NC |
12 | Black | Head Blower Fan (Positive) |
13 | Green | Front LCD, unknown function |
14 | Yellow | Front LCD, unknown function |
15 | Green | Front LCD, unknown function |
16 | - | NC |
17 | - | NC |
18 | Green | Power Switch |
19 | Green | Magnetic Sensor |
20 | Black | Door Solenoid |
21 | Red | LED Lighting (Positive) |
22 | Red | LED Lighting (Positive) |
23 | - | NC |
24 | Red | Head Blower Fan (Negative) |
J505 (UMB1)
Pin | Wire Color | Function |
---|---|---|
1 | Black | Model Heater (Negative) |
2 | Blue | Model Heater (Positive) |
3 | Green | Support Heater (Positive) |
4 | Black | Support Heater (Negative) |
5 | Green | Ground |
6 | Blue | Ground |
7 | Purple | TBD, Thermocouple Wiring |
8 | - | NC |
9 | - | NC |
10 | Black | Toggle Limit Switch |
11 | Grey | X-Axis End of Travel Limit Switch |
12 | - | NC |
13 | - | NC |
14 | - | NC |
15 | - | NC |
16 | - | NC |
17 | White | TBD, Thermocouple Wiring |
18 | - | NC |
19 | - | NC |
20 | - | NC |
21 | White | Toggle Limit Switch |
22 | Red | X-Axis Home Limit Switch |
J506 (UMB2)
Pin | Wire Color | Function |
---|---|---|
1 | Brown | Ground |
2 | Red | +5VDC |
3 | Orange | Extruder Servo Motor Encoder Pin 8 |
4 | Yellow | Extruder Servo Motor Power (Positive) |
5 | Black | TBD, Thermocouple Wiring |
6 | Red | TBD, Thermocouple Wiring |
7 | Purple | Print Bed Limit Switch |
8 | Grey | Extruder Servo Motor Encoder Pin 6 |
9 | White | Extruder Servo Motor Power (Negative) |
10 | Black | TBD, Thermocouple Wiring |
11 | Yellow | TBD, Thermocouple Wiring |
12 | Black | TBD, Thermocouple Wiring |