Klipper3d / klipper

Klipper is a 3d-printer firmware
GNU General Public License v3.0
9.26k stars 5.27k forks source link

Due/RADDS: why UART1 (pins 18 and 19 on the Due) is not usable? #455

Closed micheleamerica closed 6 years ago

micheleamerica commented 6 years ago

I'm using Klipper on a Due/RADDS configuration and very happy with everything so far, except the fact I can only use the serial ports connected to the USB connectors, and not the UARTs that breakout on other Due pins, like Serial1 on pins 18 and 19. Is there a reason for this? Or does it require some specific configuration? It would be very practical if all available UARTs could be used. Thanks.

jakep82 commented 6 years ago

I've successfully used Serial0 (Pins 0 and 1) with Klipper on a Due/OULWare configuration. I had to disable serial console to make it work with my RPi.

StefanMeGit commented 6 years ago

@micheleamerica Can u please post your printer.cfg ? I have a lot of trouble using Radds. Thx.

micheleamerica commented 6 years ago

Here it goes... sorry this is not a file but .cfg files are not allowed. Take notice that this is for a delta... home made...

# This file serves as documentation for config parameters of delta
# style printers. One may copy and edit this file to configure a new
# delta printer. Only parameters unique to delta printers are
# described here - see the "example.cfg" file for description of
# common config parameters.

# DO NOT COPY THIS FILE WITHOUT CAREFULLY READING AND UPDATING IT
# FIRST. Incorrectly configured parameters may cause damage.

# The stepper_a section describes the stepper controlling the front
# left tower (at 210 degrees). This section also controls the homing
# parameters (homing_speed, homing_retract_dist) for all towers.
[stepper_a]
step_pin: ar24
dir_pin: ar23
enable_pin: !ar26
step_distance: 0.00625
endstop_pin: ^ar34
homing_speed: 50
homing_retract_dist: 10
position_endstop: 337.396399
#position_endstop: 337.319
#position_endstop: 336.669
#   Distance (in mm) between the nozzle and the bed when the nozzle is
#   in the center of the build area and the endstop triggers. This
#   parameter must be provided for stepper_a; for stepper_b and
#   stepper_c this parameter defaults to the value specified for
#   stepper_a.
arm_length: 281.907867
#   Length (in mm) of the diagonal rod that connects this tower to the
#   print head. This parameter must be provided for stepper_a; for
#   stepper_b and stepper_c this parameter defaults to the value
#   specified for stepper_a.
angle: 210.087642
#angle:
#   This option specifies the angle (in degrees) that the tower is
#   at. The default is 210 for stepper_a, 330 for stepper_b, and 90
#   for stepper_c.

# The stepper_b section describes the stepper controlling the front
# right tower (at 330 degrees).
[stepper_b]
step_pin: ar17
dir_pin: ar16
enable_pin: !ar22
step_distance: 0.00625
endstop_pin: ^ar36
position_endstop: 337.687068
angle: 330.145970

# The stepper_c section describes the stepper controlling the rear
# tower (at 90 degrees).
[stepper_c]
step_pin: ar2
dir_pin: ar3
enable_pin: !ar15
step_distance: 0.00625
endstop_pin: ^ar38
position_endstop: 337.091567
angle: 90.000000

[extruder]
step_pin: ar61
#analog7
dir_pin: ar60
#analog6
enable_pin: !ar62
# analog8
# step_distance: 0.01
step_distance: 0.011
nozzle_diameter: 0.300
filament_diameter: 1.750
heater_pin: ar13
sensor_type: ATC Semitec 104GT-2
sensor_pin: analog0
control: pid
pid_Kp: 4.838310
pid_Ki: 0.173971
pid_Kd: 33.639560
min_temp: 0
max_temp: 250

[heater_bed]
heater_pin: ar7
sensor_type: ATC Semitec 104GT-2
# EPCOS 100K B57560G104F
sensor_pin: analog4
#control: watermark
control: pid
pid_Kp: 483.599334
pid_Ki: 171.824234
pid_Kd: 340.272583
min_temp: 0
max_temp: 130

# Print cooling fan (omit section if fan not present).
#[fan]
#pin: ar9

[mcu]
serial: /dev/ttyACM0
#serial: /dev/serial0
#baud: 1000000
pin_map: arduino

[printer]
kinematics: delta
#   This option must be "delta" for linear delta printers.
max_velocity: 500
#   Maximum velocity (in mm/s) of the toolhead relative to the
#   print. This parameter must be specified.
max_accel: 2000
#   Maximum acceleration (in mm/s^2) of the toolhead relative to the
#   print. This parameter must be specified.
max_z_velocity: 500
#150
#   For delta printers this limits the maximum velocity (in mm/s) of
#   moves with z axis movement. This setting can be used to reduce the
#   maximum speed of up/down moves (which require a higher step rate
#   than other moves on a delta printer). The default is to use
#   max_velocity for max_z_velocity.
minimum_z_position: -1.0
#   The minimum Z position that the user may command the head to move
#   to.  The default is 0.
delta_radius: 164.644571
#delta_radius: 164.0
#   Radius (in mm) of the horizontal circle formed by the three linear
#   axis towers. This parameter may also be calculated as:
#    delta_radius = smooth_rod_offset - effector_offset - carriage_offset
#   This parameter must be provided.

# The delta_calibrate section enables a DELTA_CALIBRATE extended
# g-code command that can calibrate the tower endstop positions and
# angles.
[delta_calibrate]
radius: 100
#   Radius (in mm) of the area that may be probed. This is typically
#   the size of the printer bed. This parameter must be provided.
speed: 100
#   The speed (in mm/s) of non-probing moves during the
#   calibration. The default is 50.
#horizontal_move_z: 5
#   The height (in mm) that the head should be commanded to move to
#   just prior to starting a probe operation. The default is 5.
#manual_probe:
#   If true, then DELTA_CALIBRATE will perform manual probing. If
#   false, then a PROBE command will be run at each probe
#   point. Manual probing is accomplished by manually jogging the Z
#   position of the print head at each probe point and then issuing a
#   NEXT extended g-code command to record the position at that
#   point. The default is false if a [probe] config section is present
#   and true otherwise.

# "RepRapDiscount 128x64 Full Graphic Smart Controller" type displays
[display]
lcd_type: st7920
cs_pin: ar42
sclk_pin: ar44
sid_pin: ar43
encoder_pins: ^!ar50, ^!ar52
click_pin: ^!ar48
#click_button_pin: ar48
#encoder_resolution: 1
root: main1

# Z height probe. One may define this section to enable Z height
# probing hardware. When this section is enabled, PROBE and
# QUERY_PROBE extended g-code commands become available. The probe
# section also creates a virtual probe:z_virtual_endstop pin. One may
# set the stepper_z endstop_pin to this virtual pin on cartesian style
# printers that use the probe in place of a z endstop.
[probe]
pin: ^!ar32
#   Probe detection pin. This parameter must be provided.
z_offset: -0.45
#   The distance (in mm) between the bed and the nozzle when the probe
#   triggers. This parameter must be provided.
speed: 50.0
#   Speed (in mm/s) of the Z axis when probing. The default is 5mm/s.
#activate_gcode:
#   A list of G-Code commands (one per line) to execute prior to each
#   probe attempt. This may be useful if the probe needs to be
#   activated in some way. The default is to not run any special
#   G-Code commands on activation.
#deactivate_gcode:
#   A list of G-Code commands (one per line) to execute after each
#   probe attempt completes. The default is to not run any special
#   G-Code commands on deactivation.

# Heater and temperature sensor verification. Heater verification is
# automatically enabled for each heater that is configured on the
# printer. Use verify_heater sections to change the default settings.
[verify_heater extruder]
heating_gain: 1
#   The minimum temperature (in Celsius) that the heater must increase
#   by when approaching a new target temperature. The default is 2.
check_gain_time: 30
#   The amount of time (in seconds) that the heating_gain must be met
#   in before an error is raised. The default is 20 seconds for
#   extruders and 60 seconds for heater_bed.
hysteresis: 5
#   The difference between the target temperature and the current
#   temperature for the heater to be considered within range of the
#   target temperature. The default is 5.
max_error: 150
#   The maximum temperature difference a heater that falls outside the
#   target temperature range may accumulate before an error is
#   raised. For example, if the target temperature is 200, the
#   hysteresis is 5, the max_error is 120, and the temperature is
#   reported at 185 degrees for 12 seconds then an error would be
#   raised (or 24 seconds at 190, or 120 seconds at 194, etc.). The
#   default is 120.

# A virtual sdcard may be useful if the host machine is not fast
# enough to run OctoPrint well. It allows the Klipper host software to
# directly print gcode files stored in a directory on the host using
# standard sdcard G-Code commands (eg, M24).
#[virtual_sdcard]
#path: ~/.octoprint/uploads/
#   The path of the local directory on the host machine to look for
#   g-code files. This is a read-only directory (sdcard file writes
#   are not supported). One may point this to OctoPrint's upload
#   directory (generally ~/.octoprint/uploads/ ). This parameter must
#   be provided.

# Panel buttons
#[buttons]
#pins = ^!ar50, ^!ar52, ^!ar48

# Menu manager
#[menu]
#root: main1
#rows: 4
##cols: 20
#cols: 16

[menu main1]
type: group
name: Main menu
#enter_gcode:
#leave_gcode:
items: menu0, menu00, menu1, menu2, menu3

[menu menu0]
type: row
enable: !toolhead.is_printing
items: menu25,menu26,menu27

[menu menu00]
type: command
name: Kill
gcode: M112

[menu menu1]
type: group
enable: !toolhead.is_printing
name: Temperature
items: menu11, menu12, menu13, menu14, menu15

[menu menu11]
type: command
name: Preheat Pla
gcode: M140 S60;M104 S230

[menu menu12]
type: command
name: Preheat Abs
gcode: M140 S110;M104 S245

[menu menu13]
type: command
name: CoolDown
gcode: M104 S0;M140 S0

[menu menu14]
type: command
name: Fan On
gcode: M106 S255

[menu menu15]
type: command
name: Fan Off
gcode: M106 S0

[menu menu2]
type: group
enable: !toolhead.is_printing
name: Movement
items: menu211, menu21, menu22, menu23,menu24, menu25, menu26, menu27

[menu menu211]
type: command
name: Home XYZ
gcode: G28

[menu menu21]
type: command
name: Home X
gcode: G28 X

[menu menu22]
type: command
name: Home Y
gcode: G28 Y

[menu menu23]
type: command
name: Home Z
gcode: G28 Z

[menu menu24]
type: command
name: Disable Steppers
gcode: M84; M18

[menu menu25]
type: input
name: X:{0:.2f}
parameter: toolhead.xpos
input_min: 0
input_max: 190
input_step: 5.0
gcode: G1 X{0:.2f}

[menu menu26]
type: input
name: Y:{0:.2f}
parameter: toolhead.ypos
input_min: 0
input_max: 190
input_step: 5.0
gcode: G1 Y{0:.2f}

[menu menu27]
type: input
name: Z:{0:.2f}
parameter: toolhead.zpos
input_min: 0
input_max: 180
input_step: 1.0
gcode: G1 Z{0:.2f}

[menu menu3]
type: group
name: Status
#enter_gcode:
#leave_gcode:
items: menu31, menu32, menu33

[menu menu31]
type: command
name: Printing: {1:>3s}
parameter: toolhead.is_printing:b['NO','YES']

[menu menu32]
type: command
name: Pause Print
gcode: @//pause

[menu menu33]
type: command
name: Resume Print
gcode: @//resume

#[menu menu4]
#type: input
#name: Choose: {1:s}
#parameter: 0:i('----', 'cola','pepsi','fanta','sprite')
#input_min: 0
#input_max: 4
#input_step: 1
#gcode: M117 My favorite: {1}
KevinOConnor commented 6 years ago

On Tue, Jul 03, 2018 at 04:05:05PM +0000, micheleamerica wrote:

I'm using Klipper on a Due/RADDS configuration and very happy with everything so far, except the fact I can only use the serial ports connected to the USB connectors, and not the UARTs that breakout on other Due pins, like Serial1 on pins 18 and 19. Is there a reason for this? Or does it require some specific configuration?

The only reason is that no one has done the development work to support other configurations.

-Kevin

micheleamerica commented 6 years ago

That is an understandable reason. I'll take a look at the code and see if it is something that I do to contribute to this great project.

KevinOConnor commented 6 years ago

Sounds good. Feel free to open a pull request when ready.