XYZPrinting Davinci 1.0a Klipper configs

anytime lazy!
The big update today is working on the temps:
Following recommendations I built both extruder and bed based on observations. I went back to 51k pullups as you will see in a bit.
The biggest hurdle I was facing was on the extruder not taking 3 temp’s without math domain error.
So I happend to be watching when both the extruder and bed reported 22c
I jumped in and looked and sure nuff 100k and 440k when 51k pullup is used.
So!!!
It looks like I got the temps dialed in but with 22c instead of 25 as base.
Ok so I redid all the math… I changed again to beta’s on extruder as it wont take the 3 temps (odd)
searched online @ klipper for math domain error…
I read that someone had put in a ticket on github for a PT100 giving math domain error, resolution was “its not a thermistor, use adc_temperature instead”
So I changed to adc_temperature for extruder and it WORKED;
and looks right at ambient temps;
and it completes pid calibration at 260 now !!! wohoo

So here is stripped down temperature work:

[adc_temperature DAVINCI_ext]
temperature1: 22 # This one is working fine
resistance1: 100000
temperature2: 200
resistance2: 5000
temperature3: 260
resistance3: 1800

[extruder]
sensor_type: DAVINCI_ext
pullup_resistor: 51000
sensor_pin: PB20
control = watermark

[thermistor DAVINCI_bed]
#temperature1: 22 # using 51k pullup
#resistance1: 440000.000
#beta: 4048.56 # 22c@440k 100c@25k
temperature1: 22 # so far so good pid calibrate completes at 260c
resistance1: 440000
temperature2: 40
resistance2: 200000
temperature3: 150
resistance3: 25000

[heater_bed]
pwm_cycle_time = 0.0166
heater_pin: PA12
sensor_type: DAVINCI_bed
sensor_pin: PB21
pullup_resistor: 51000
control = watermark
min_temp: -20
max_temp: 150


Also attaching today’s printer.cfg and macros.cfg
Next is working on the Display, (not high priority :wink:
and then accessing the Filament Cartrige Chip to obtain Material Details.

Have Fun ALL!
printer.cfg (8.6 KB)
macros.cfg (2.2 KB)

(Also please note, I turned the coordinate system around on the DaVinci so now 0,0 is front left)
edit: I had the wrong upper temp on the bed, its now 150 not 100. looks much better now. I still have yet to get the commercial temp probe. Maybe soon though… I’ll post updates as soon as I can.

Using adc_temperature in that way will not do what you want - you’ll have notably less accurate temperatures than using beta.

Can you attach here the full klipper log that reports the math domain error?

-Kevin

Thanks Kevin
I’ve been seeing that, as it heats up; the temps rise then begin to curve. Then straighten and begin a new curve. *see pic

FYI, I got the betas value from entering the three temp/resist into the calculator.

temps1

So I built 3 sections and uncomment them one at a time for testing each.

I started a new log, booted with the beta values, then made the change to 3 temps and restart with domain error and grabbed the log for you.
The change captured in the log was to comment out the beta and uncomment 3 temps entries only. the adc was not captured in the log. The picture above was using the adc_temperature meathod if you would like the log with that too. let me know

[thermistor DAVINCI_ext]
temperature1: 22 # Works but fails to calibrate above 200
resistance1: 100000
beta: 2350.31

[thermistor DAVINCI_ext]
temperature1: 22 # Gives Math Domain Error
resistance1: 100000
temperature2: 200
resistance2: 5000
temperature3: 260
resistance3: 1800

[adc_temperature DAVINCI_ext_adc]
temperature1: 22 # This one is working (but odd temp curve)
resistance1: 100000
temperature2: 200
resistance2: 5000
temperature3: 260
resistance3: 1800

klippy (7).log (20.0 KB)

edit: adding another file for reference. Its temps and query_adc outputs. I used the Beta config above and ran the temps up, documenting as they stabilze at each step. My plan was to build a table like they did in Repetier .92

Temps.cfg (14.5 KB)

#if MODEL==0
#define NUM_TEMPS_USERTHERMISTOR0 33
#define USER_THERMISTORTABLE0 {{96,2400},{99,2320},{113,2240},{132,2160},{155,2080},{180,2000},{211,1920},{247,1840},{293,1760},{350,1680},{421,1600},{508,1520},{611,1440},{732,1360},{871,1280},{1024,1200},{1192,1120},{1369,1040},{1552,960},{1737,880},{1900,800},{2070,720},{2219,640},{2361,560},{2478,480},{2565,400},{2628,320},{2673,240},{2710,160},{2746,80},{2783,0},{2824,-80},{2864,-160}}

/** Number of entries in the user thermistor table 1. Set to 0 to disable it. */
#define NUM_TEMPS_USERTHERMISTOR1 19
#define USER_THERMISTORTABLE1 {{628,1280},{859,1200},{1113,1120},{1382,1040},{1660,960},{1938,880},{2211,800},{2473,720},{2718,640},{2945,560},{3148,480},{3328,400},{3482,320},{3613,240},{3722,160},{3815,80},{3895,0},{3972,-80},{4055,-160}}

Last edit for the post I swear :wink:

I changed them to the following so to select one, I only need to uncomment one line at a time under the extruder.

[thermistor DAVINCI_ext_beta]
temperature1: 22 # Works but fails to calibrate above 200
resistance1: 100000
beta: 2350.31

[thermistor DAVINCI_ext]
temperature1: 22
resistance1: 100000
temperature2: 200
resistance2: 5000
temperature3: 260
resistance3: 1800

[adc_temperature DAVINCI_ext_adc]
temperature1: 22
resistance1: 100000
temperature2: 200
resistance2: 5000
temperature3: 260
resistance3: 1800

[extruder]
pwm_cycle_time = 0.0166
step_pin: PB7
dir_pin: PB6
enable_pin: !PB8
microsteps: 16
rotation_distance: 32.3232
full_steps_per_rotation: 200
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA13
#sensor_type: DAVINCI_ext
#sensor_type: DAVINCI_ext_beta
sensor_type: DAVINCI_ext_adc
pullup_resistor: 51000
sensor_pin: PB20
#control = watermark
#control = pid
#pid_calibrate @ 230c pasted from bottom for info only.
#pid_kp = 24.544
#pid_ki = 1.352
#pid_kd = 111.366
min_temp: -20
max_temp: 300
min_extrude_temp: 170

So its been awhile since I posted an update. I’ve been busy the last weeks learning klippers guts and my printer config is getting to be a mile long and am now completly out of filament, and even stole the last bit of trimmer line out of the shed. So have been concentrating on things that I can do without pushing plastic. :wink:

I’ve made some progress on getting the display working, but still not operational.

Quick question:
Does anyone know what these values (0x80 and 0xc0) are in this file: \klipper\klippy\extras\display\hd44780.py line 44-48 (?line offset?)
# Text framebuffers
(self.text_framebuffers[0], bytearray(b’~‘2self.line_length),
0x80),
(self.text_framebuffers[1], bytearray(b’~'2self.line_length),
0xc0),

My assumption is its Line Offset?? As I dont see line offset values anywhere else in the klipper files.
One of the issues I may be having could be the wrong line offsets for the Winstar 1604, as with alot 44780 16x4’s the line order in memory is 1, 3, 2, 4

The defines in repetier .92 were listed like this.
#define UI_LINE_OFFSETS {0,0x40,0x10,0x50} // 4x16 with WINSTAR
//#define UI_LINE_OFFSETS {0,0x20,0x40,0x60} // 4x20 with KS0073
//#define UI_LINE_OFFSETS {0,0x40,0x14,0x54} // 4x20 with HD44780
I cant find the equivilant in Klipper yet.
At this time, since I cant get it going for using the menus, I have managed to convert the code to use 8bit mode and rw pin control too. as it may allow for some graphic animations and Large Digit readouts.

I also made some progress on reading the eeproms on the Filament Cartriges. I’ve been hacking at the smart_effector eeprom save klipper code to try and read the chip, but I’ve got to learn more (k)oding to get into it further. However I did find out the pins for the cartriges are hardware pwm enabled.
So I started instead down a different rabit hole. Using the signal pins for PWM servo control. The goal would be for automatic adjustment of bed leveling screws like xyz has added to the newest davinci) :wink:
I was able to connect and control a pair of hs82-mg servos by connecting it to the cartrige slot pins (5v Signal and Ground) and setting pwm values between 0.1 - 0.2 with 0.15 being initial value @center, and it worked. As its current draw @Idle is only 10mA it wasnt like I was going to blow a fuse :wink: However I dont think it would be wise or have enouth amps with a Stall Current Draw of 1,800 mA.
I wouldn’t want to power the servos from the power to the cartrige slots in the long run.

So I’ve incorporated a 6v supply to the servos from an RC style BEC powering an RC receiver. Whats kinda neat with this is I’m also able to use manual servo control with a bound rc transmitter for testing while I get the servo mounts desinged as well as geared knob/horn combinations. I think 180* is sufficient travel. But I do have a modified 360+ servo for testing as well if need be.
Each servo has a Torque rating of @4.8V 38.88oz/in / @6.0V 47.22oz/in so in theory they should have enough oomf to turn a leveling screw. :wink:

I’ve also spent alot of time on tweaking the bed leveling process on the DaVinci 1.0.

To give some insight for those not familiar with how the DaVinci bed probe works. and appologize to those who do )
It uses a conductive bed probe.
A brass pin has been inserted into a hole in the nozzles heatblock.
The entire Nozzle assembly is connected to ground.
The probe is x and z offset slightly from the nozzle the z is -0.28mm. The probe touches a metal plate in the corners that is 0.28 above the glass bed.
The nozzle to probe z offset is supposed to (cancel out) the offset of pad to bed height, therby making the nozzle equal to the glass.
The glass heatbed is held down in four corners with stainless steel plates and screws.
The 4 corners are electricly connected to the SAM3x8e by two pins, that both go low when when the bed probe touches any corner pad.
This allows user feedback for using the 3 bed screws for manual bed level. As well as automatic support with the Klipper Bed_Tilt functionality and works ok.

BUT… having that little pin sticking out can sometimes lead to it touching a print in progress, and or picking up little bits of plastic depositing it somewhere that can sometimes be really inconvient or detrimental at times. It needs special cleaning to function reliably; and genually gets in the way.
So basicly a side effect of using the Nozzle as the Probe allows removing the old probe pin itself and throws out any need for z probe offsets.

Having a Heated Glass Bed is great, but I know its not perfectly flat especially when hot. And even now with Klipper that first layer is never been the best with the corner leveling. And buying a new bed plate or changing to a different type of probe seemed overkill just to get bed mesh.

So the thing is… its not a bed mesh… and I wanted a bed_mesh.

Recently I watched a video of somebody doing a manual bed mesh with the nozzle using the paper meathod and thought cool. But no way spending an hour bent over doing that, too painful; my back wouldnt take that kind of abuse :slight_smile:

So the new Goal: Using the Nozzle as the Probe to obtain a bed_mesh from the bed itself. Just requires a clean nozzle and a conductive bed surface to work.

Now comes the magic:
So how to get a bed mesh on a glass bed? How to get the nozzle to ground out on a piece of glass… Well laminate it in tinfoil of course (tada)

I laid it down as I would a new sheet of Kapton. Or similarly how installing window tint or some vinal wraps. slightly wet the surface apply laminate, and squeegy out the air bubbles.

  1. First cleaned the glass well with glass cleaner followed by a quick rub with alcohol all while cold.

  2. I then took a precut sheet of aluminum foil, laid it out on a clean glass table and ran a glue stick across the dull surface side. The sheets I have are embossed with a pattern of tiny dots in the surface, which although I tried to flatten them along with any wrinkles and such. The textured surface actually helped by retaining just the tinyest bit of extra glue :wink:

  3. I laid the piece down with the straightest edge along the back edge of the glass, not going over the pads and avoiding the rear wires going to the heating element and thermistor. and folded down each side and laid down over the front pads for the electrical connection.

  4. With the aid of a felt tipped squeegy from an old phone screen protector installation kit. I initially laid it down cold (pic1) then heated to 40c for initial squeegeeing… (is that a word?) to remove air bubbles and wrinkles as the aluminum expands slightly as it heats up.

  5. Then up to 90c for final squeegee to a mirror like finish. (pics and video short)
    Its now been through several hot cold cycles now and hasnt lifted yet (but it did in one spot on the first attempt without glue stick.)
    It so nice I may even be tempted to print on this, it really took about 10min to lay down.

I then proceeded to run a series of tests.
First starting with the current setup bed_screws and bed_tilt with slightly different probe points (see note about crashing above) to get better level than before at just the corners.
But the best feeling ever was commenting out bed_tilt and performing a Bed_Mesh with No Z offsets at all, remember the nozzle is the probe. (like you needed reminding :slight_smile:
And my theroy was correct in the Glass not perfectly level at all, and gets worse from cold to hot. However now a quick 2min scan preprint can see what it is and can adjust I can now even decide for the best part placement. This is So COOL… although at the moment all I can really wish for is Santa to bring some plastic… or maybe win some polymaker watching Nero 3d’s livestreams (onlyBenchies :wink:

Well hope that everyone has a great holiday season!

I’ll update yall hopefully soon on the Thermistors when I finally get my hands on a good temp gun instead of a meat thermomiter. lol But for now it does melt plastic so I’m at least in the ball park hehe.
Peace out!

edit: Ill post the config I’m using right now for bed_mesh below:

[bed_mesh]
speed: 120
horizontal_move_z: 2.5
mesh_min: 10, 10
mesh_max: 180, 180
probe_count: 10,10
mesh_pps: 2, 2
algorithm: bicubic
bicubic_tension: 0.2

## [bed_mesh default]
#
# version = 1
## points =
#
# 0.479102, 0.460156, 0.434570, 0.429687, 0.425781, 0.425195, 0.425781, 0.435742, 0.444336, 0.464453
## 0.515820, 0.495312, 0.478711, 0.470703, 0.468945, 0.474219, 0.470703, 0.483398, 0.495117, 0.515234
#
# 0.539258, 0.527148, 0.510352, 0.509375, 0.514062, 0.520312, 0.517383, 0.530078, 0.540039, 0.563281
## 0.554297, 0.539453, 0.529883, 0.525586, 0.521875, 0.526562, 0.534961, 0.549219, 0.567969, 0.590625
#
# 0.561719, 0.546289, 0.535937, 0.533398, 0.534570, 0.543359, 0.552930, 0.569727, 0.589062, 0.614258
## 0.557031, 0.541211, 0.530273, 0.530859, 0.533789, 0.546289, 0.555273, 0.575000, 0.597070, 0.628125
#
# 0.547656, 0.528906, 0.520312, 0.522461, 0.526562, 0.537891, 0.552539, 0.573242, 0.596484, 0.623828
## 0.520508, 0.505859, 0.496289, 0.496680, 0.502734, 0.518750, 0.531250, 0.556250, 0.582617, 0.613086
#
# 0.493164, 0.478711, 0.470312, 0.472266, 0.478711, 0.492773, 0.510937, 0.535156, 0.562109, 0.592383
## 0.458594, 0.439062, 0.430078, 0.430078, 0.436914, 0.451562, 0.469922, 0.497266, 0.524219, 0.563281
#
# x_count = 10
## y_count = 10
#
# mesh_x_pps = 2
## mesh_y_pps = 2
#
# algo = bicubic
## tension = 0.2
#
# min_x = 10.0
## max_x = 179.93
#
# min_y = 10.0
## max_y = 179.93
#
#

Final edit I swear: How would one go about posting a short 4 sec mp4 clip on here?

After reading more on bed_mesh, I incorporated marking out the areas around the bed hold down screws. This worked great as seen in the screenshot I got my best one yet.

Have Fun and Keep Printing :slight_smile:

[bed_mesh]
speed: 120
horizontal_move_z: 2.5
mesh_min: 5, 5
mesh_max: 195, 195
probe_count: 10,10
mesh_pps: 2, 2
algorithm: bicubic
bicubic_tension: 0.2
faulty_region_1_min: 0.0, 0.0 # Avoid Four Corner Screws
faulty_region_1_max: 20.0, 9.0
faulty_region_2_min: 180.0, 0.0
faulty_region_2_max: 200.0, 9.0
faulty_region_3_min: 200.0, 200.0
faulty_region_3_max: 180.0, 189.0
faulty_region_4_min: 20.0, 200.0
faulty_region_4_max: 0.0, 189.0

[bed_mesh 60c]
## version = 1
#
# points =
## 0.154492, 0.139453, 0.118555, 0.111328, 0.108984, 0.103906, 0.098047, 0.096680, 0.094922, 0.101562
#
# 0.189648, 0.174805, 0.158203, 0.149219, 0.146875, 0.139844, 0.133594, 0.129883, 0.131445, 0.139258
## 0.213086, 0.203516, 0.188672, 0.183984, 0.181055, 0.177148, 0.168945, 0.172070, 0.170508, 0.175977
#
# 0.227734, 0.217383, 0.207031, 0.192578, 0.187695, 0.183984, 0.185156, 0.185352, 0.190039, 0.199219
## 0.242383, 0.228320, 0.215234, 0.208984, 0.208398, 0.208984, 0.205859, 0.210156, 0.210547, 0.218359
#
# 0.237891, 0.224609, 0.211914, 0.211914, 0.203516, 0.207031, 0.205469, 0.213477, 0.220312, 0.233203
## 0.232422, 0.215820, 0.203711, 0.205469, 0.203516, 0.198828, 0.210156, 0.211914, 0.218359, 0.228711
#
# 0.211914, 0.200781, 0.190039, 0.186328, 0.180078, 0.187891, 0.188281, 0.194336, 0.204102, 0.212500
## 0.191211, 0.177539, 0.165430, 0.166211, 0.164258, 0.166016, 0.174805, 0.178320, 0.184766, 0.195898
#
# 0.183984, 0.144922, 0.139062, 0.135156, 0.136719, 0.145117, 0.146094, 0.152930, 0.158789, 0.167578
## min_x = 10.0
#
# max_x = 179.93
## min_y = 10.0
#
# max_y = 179.93
## x_count = 10
#
# y_count = 10
## mesh_x_pps = 2
#
# mesh_y_pps = 2
## algo = bicubic
#
# tension = 0.2
#*#

Short Clip of DaVinci performing Klipper Bed_Mesh

It’s the framebuffer offset in the hd44780. It’s the fb_id used in line 87 (self.send([fb_id + chip_pos])).

-Kevin

Thanks Kevin happy new year!

Hello and good day

I have a Da Vinci 2.0 a flashed on a repeater and would like to switch to a clipper

Can someone please let me know what I need for this

I’m looking forward to a short info

Many Thanks

first things first, 2.0 or 2.0A??

2.0a Duo

Hello All,
I’ve been working on getting the winstar display working with my davinci 1.0a.
I’ve got a largely working prototype, you can navigate and go into the menus. However, I run into a very strange issue. The first character in each data buffer always prints from the corresponding Japanese character table as seen in the data sheet.

See

Once I can figure out what’s going on here, I can get the code cleaned up/separated out and get a proper PR in place.

My draft code Klipper code is here GitHub - multidest/klipper at winstar-display As you can see it’s a bit of a mess. If you go through the commit history, you can see my increasingly desperate attempts to figure out what’s going on.
I’ve hard coded much of the Repetier init sequence and character/data writing.

And the rest of my klipper project files, notes, datasheets are here GitHub - multidest/Da-Vinci-1.0A: Davinci 1.0A Mods

Anyone have any ideas? I’m starting to run out.

1 Like

Hello @multidest,
I’m trying to do the same thing as you, but with less success. Would it be possible to have more info on your installation? (which raspberry pi?, is the printer original?, …) thanks.

Sure thing @super. I’m using a Pi ZeroW. The printer is a 1.0A. I have an E3D V6 Bowden with MK8 Extruder. I use the stock heater and the Semitec 104gt2 thermistor. The bed’s temp table in my config should be pretty accurate to at least ±2deg (I just use the table from repetier). I’m away from my printer atm, but I’ll be using a thermocouple to build a new table for the Semitec since every calculator and table I’ve found out there is too far off with my printers thermistor circuit. I suspect if you have an all original printer, you’d be able to directly use the tables from repetier without issue. Let me know if you have any other questions.

Sorry for the late reply, and thanks for the details. Do you use a fan duct?

@super I haven’t fully tested the fan duct. I needed to add a transistor to my board. I’ve done that, but haven’t had a chance to test it.

Hello all i just picked up a davinci 1.0 and found this thread I’m just kind of confused as the steps i need for converting to klipper or would it be easier to drop in a new board.

@Trublu289 is it a 1.0 or a 1.0a? but either way, yes its very easy to use the original board with klipper on a 1.0x
you can DM me on klipper discord server (same name) if you need help too

sorry Tilli, I didnt see your responce.

What would I need to change to use your printer.cfg file on a stock DaVinci 1.0A printer ?

Amazing work to figure this all out. A daVinci AiO just landed here with a 2 Black Bar display. Converting to Klipper is my dream.

Flashing the original board will be the stumble for me with out a step by step. Can you point me in the right direction ?

Managed a Manta and CB1 on to a Mendel90 as my first Klipper but BTT had it all laid out.

1 Like