How to use GPIO pins with Klipper

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มิ.ย. 2024
  • Tutorial on how to use your Raspberry Pi GPIO pins to expand your 3D printer board. Connect and control all kinds of devices with Klipper MCU running on the Pi.
    Klipper Pi MCU: www.klipper3d.org/RPi_microco...
    Klipper config reference: www.klipper3d.org/Config_Refe...
    Relay board: amzn.to/30vGnca
    Mosfet: s.click.aliexpress.com/e/_ANx5l9
    SSR relay: amzn.to/2YMhclb
    Power distribution board: amzn.to/3GjQJMK
    Please join us on FB: / 40988. .
    Disord: / discord
    If you wish to support: ko-fi.com/vez3d
    SliceEngineering discount link : www.sliceengineering.com?p=ry...
    Or use this code: SIMOV5

ความคิดเห็น • 108

  • @ApexNick
    @ApexNick ปีที่แล้ว +9

    My whole life I worked in I.T. I've also tinkered a LOT with electronics (entire workbench with oscilliscope, sweep function generator, I have my extra class radio license, etc.). I never learned to control physical items because learning firmware/microcontroller coding was a MAJOR time and cost issue - Plus, every single video I've ever looked at there is crap (parts and equipment) strewn everywhere. This is SO easy! Thank you so much for this video and for making one of my techie/geek dreams come true!

  • @johnbeima6413
    @johnbeima6413 2 ปีที่แล้ว +23

    More content like this is really needed. VERY nice job!

  • @JoelRehra
    @JoelRehra 2 ปีที่แล้ว +9

    The hardware pwm has one very important advantage: It does not vary when the cpu is overloaded... So if a process freezes the cpu for a few ms (which hopefully wont happen) the software-pwm will freeze as well...
    And as some others said the hardware-pwm gives a much cleaner signal...

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว +1

      valid good point

    • @GnuReligion
      @GnuReligion 2 ปีที่แล้ว

      This is probably reason the Pi is not used to drive steppers directly, as well.

    • @charmio
      @charmio 9 หลายเดือนก่อน

      Spot on!
      As the name suggests, hardware PWM is literally controlled by a separate hardware circuit in the processor that is dedicated to nothing other than generating a PWM signal.
      It's very useful! If you need a PWM signal that'll be stable regardless of what the rest of the processor is doing, these are what you want to use.
      Generally speaking it's a good idea to use them even if you don't strictly need the stability as software PWM often involves the processor actively managing the pulse's high and low timings. This usually requires continuously polling or checking a timer, which can consume significant processor time, especially at higher PWM frequencies.

  • @winandd8649
    @winandd8649 8 หลายเดือนก่อน +2

    @22:35 You can simply select some lines of text en (un)comment them using ctrl + / ☝😌

  • @2iinfinite
    @2iinfinite 2 ปีที่แล้ว +2

    I recently updated to klipper firmware on my ender3 reading the documentation seeing the part about sensors like thermometers, when I realized I had one of those pi starter kits with a bunch of sensors and even an accelerometer(mpu6050 no SPI interface unfortunately). This video came at a perfect time!

  • @DavidCook42
    @DavidCook42 2 ปีที่แล้ว

    Wow. This really opened my eyes. Just converted my FL Sun SR to Klipper. Thank you!!!

  • @jackparlee6748
    @jackparlee6748 2 ปีที่แล้ว +2

    Thank you for this video. I’ve needed this information for weeks and this is amazing.

  • @Tinker_Box
    @Tinker_Box 2 ปีที่แล้ว

    This is so revolutionary! Your video helped me a lot, and my system is day and night different! Thank you so much!

  • @un-review
    @un-review 2 ปีที่แล้ว +2

    Super useful info. Thanks for your work!

  • @Drew_pew_pew_pew
    @Drew_pew_pew_pew 2 ปีที่แล้ว +1

    I have a spare fan and MOSFET laying around. Guess I know what I will be doing next weekend 😃

  • @Mainsail-Crew
    @Mainsail-Crew 2 ปีที่แล้ว +3

    #mainsaillove

  • @95LegendGS
    @95LegendGS 2 ปีที่แล้ว +16

    Would be good to cover using GPIO pins with external momentary switches to run gcode, like a physical preheat button, etc.

    • @leonnundel2443
      @leonnundel2443 หลายเดือนก่อน

      Or a basic movement system

    • @denis2381
      @denis2381 8 วันที่ผ่านมา

      Like those from pc cases? They 100% can be used for this purpose

  • @Sixpack0000473
    @Sixpack0000473 ปีที่แล้ว

    this was extremely helpful!! Thank you so much for posting it. Great info.

  • @mariusj8542
    @mariusj8542 ปีที่แล้ว

    thanks a lot, had an old creality 4.2.2 board, but needed to add some extra fans and some lights ( neopixles) but the 4.2.2 is very limited, but this video solved that.

  • @vmx200
    @vmx200 2 ปีที่แล้ว +1

    Thank you for this walk through is is Fantastic!

  • @martintischer6217
    @martintischer6217 2 ปีที่แล้ว +1

    Thank for this video. Thats what i looking for, now i have more options to control fans, without using stock board of my mega zero.

  • @viktorcoopman5479
    @viktorcoopman5479 2 หลายเดือนก่อน

    Amazing work! Really helpfull

  • @grzegorzboduszek8687
    @grzegorzboduszek8687 2 ปีที่แล้ว +3

    Really helpfull. More tutorials please.

  • @MrW3iss
    @MrW3iss 3 หลายเดือนก่อน

    Thanks a lot for all of the great videos man 👍

  • @jay1st1st
    @jay1st1st ปีที่แล้ว

    That's cool, you can run what ever you want with relays or mosfets for low voltage.

  • @krafterHD
    @krafterHD 4 หลายเดือนก่อน

    This is an awesome video! Thanks for sharing your knowledge.

  • @Accessgp
    @Accessgp ปีที่แล้ว

    Very very nice video and concepts very clearly explained. Thank you 😊. I am very new to klipper but funny enough I find it much more easier to configure than marlin which I was never able to get my head around. I see a good opportunity here with your relay control part, all of know the fan noise we get sitting alongside a idle printer especially with the controller and hot end fans running all the time, what if we could configure the hot end fan to only switch on when the hot end temperature goes above say 50* and the controller fan to switch on when the board controller goes above say 60*. That way fans will only kick in when the printer starts a print job and switch off when done and all the temperatures are back to normal. You could also switch on or off the enclosure lights only when printing. That way we can avoid unnecessary power being consumed and also have a much more quieter printer. So please help with some examples as to how to configure this condition. Thanks again 👍

  • @solders2004
    @solders2004 2 ปีที่แล้ว

    very useful video! thanks

  • @shangtsung2450
    @shangtsung2450 2 ปีที่แล้ว

    Thank you for sharing this information. I wonder, which boards did you refer, when you mentioned that there are ones that have a lot of outputs and inputs? Are those still RPi? Some STM32 ones? Do you have specific series names / references?

  • @bogdyy13
    @bogdyy13 2 ปีที่แล้ว +1

    damn, i was just looking for this yesterday

  • @MitchCrane
    @MitchCrane หลายเดือนก่อน

    Very well done.

  • @the_guy_next_door_31
    @the_guy_next_door_31 10 หลายเดือนก่อน

    Amazing content ! can't thank you enough

  • @michaelswinney9154
    @michaelswinney9154 ปีที่แล้ว

    Thank you sooooooo much for this video.

  • @kingofnfsfan
    @kingofnfsfan 2 ปีที่แล้ว +5

    If i remember correctly the software pwm is ok for fans but crappy for servos because the pwm isnt perfectly timed. You dont notice it on fans but servos can stutter a bit.

    • @lightningfpv9012
      @lightningfpv9012 2 ปีที่แล้ว

      I tried servo with sofware pwm and it's jittering alot, tried hardware pwm but I can not get It working, do you have any step by step tutorial on active hardware pwm?

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว

      I don't sorry. Never experimented with it

  • @infocusaerialmedia8041
    @infocusaerialmedia8041 7 หลายเดือนก่อน

    Thanks for the great video.
    Have you been able to get a Neopixel led working from Klipper on the RPi gpio ports?
    Thanks

  • @jooilpark9304
    @jooilpark9304 ปีที่แล้ว

    Thank you

  • @DyminoCzyliLolek
    @DyminoCzyliLolek 2 ปีที่แล้ว +2

    Software PWM use some code to turn on and off pin quickly. It use some cpu computation power and its not realy quick. Also timing of switching is a bit off due to OS processes.
    In hardware PWM special timers is utilized to do switching. It can be REALY fast, timing is perfect and do not use CPU computation power.
    In case of regulating fans software PWM is good enought but for eg. servo it can be a problem

  • @rokkweiler9166
    @rokkweiler9166 6 หลายเดือนก่อน

    Good video thanks, any way to control neopixels using the rpi gpio? Cant seem to get it working using this method of having the pi as a second mcu

  • @stevehanwright481
    @stevehanwright481 ปีที่แล้ว

    Thanks 😊

  • @fab65400
    @fab65400 2 ปีที่แล้ว +1

    Hi, thank you for your great videos !!!!! Really helpull and amasing.
    Really appreciated if you could make a video to add an arduino uno as aditionnal "secondary/third" mcu to add more gpio pins . Thanks

    • @fab65400
      @fab65400 2 ปีที่แล้ว

      Do you think you Can Do this ? 😜

  • @jbrande
    @jbrande 2 ปีที่แล้ว

    Hi thanks for the video, do you know if its possible to use rpi pins as uart pins for the drivers by setting it up this way?

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว

      I think its doable yes. never done it though

  • @willl84
    @willl84 ปีที่แล้ว

    26:40 - THANK YOU! I added a 2CH relay board to control LED lights (and something else in the future) and couldn't for the life of me figure out how to default them to off at startup. Simply adding the "value: 1" and "shutdown_value: 1" was what I needed!

    • @denis2381
      @denis2381 8 วันที่ผ่านมา

      Why relay? I have usb powered led and I Plan to use just 5v and gnd to turn off and on and maybe Set brightnesss. Don't care about color

    • @willl84
      @willl84 8 วันที่ผ่านมา

      @@denis2381 it's a 12v LED Strip. Just white.

    • @denis2381
      @denis2381 8 วันที่ผ่านมา

      @@willl84 oh okay makes sense. I was already a bit scared to not connect it. Already glued it in the ikea lack enclosure and prepared pi (as mcu in klipper) and cable

  • @Tensopiseth
    @Tensopiseth 2 ปีที่แล้ว

    hi. i got one stupid question. can i use (assigned) gpio pin as switch? if could it would be great.. so i can use it as light switch control manual or via web interface. also i maybe useful for assigned as pause, stop, ... since i have no scree to use

  • @valerioranalli3046
    @valerioranalli3046 ปีที่แล้ว +1

    Is it possibile to connect a fan that controls the temperature of an emclousore that read the data from a dh11 or dht22 and power on the fan when is needed to keep the enclousore temperature at the right value? Can someone help me?

  • @EduardoSousa-fk6oy
    @EduardoSousa-fk6oy 2 ปีที่แล้ว

    Hi thanks for the very God vídeo, i have a question, can i use the rasp to Control my hotend fan ? So it stop at 30° , or the fan and thermister have to be on same MCU? i AM out off pwm pins on my skr 1.4 , i can not use 2 hotend MOSFET to do that . thanks

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว +1

      Sure you can. Just define a heater fan. See klipper config reference

    • @EduardoSousa-fk6oy
      @EduardoSousa-fk6oy 2 ปีที่แล้ว

      @@Vez3D thank you

  • @MrKiar1611
    @MrKiar1611 3 หลายเดือนก่อน

    if I understand correctly, is it mean I can plug the g-code into the one generated by slicer and make the external fan on&off at some speciific position during the print automatically?
    I recently bought an ender 3 s1 pro to make a UV glue dispenser but it's kinda tricky. Because i couldn't really find an unused pin to trigger a mode switching function from glue dispensing to turn on UV led from my customised toolhead.
    And turning it on all the time is not an option as I need the glue to set still before curing it with UV.

  • @livewiya
    @livewiya ปีที่แล้ว

    I want to make sure I understand: if you're already using an rPi for klipper, do you need another Pi to use it as a secondary MCU? Or would I be able to do this on the one Pi that's already being used for klipper.

    • @Vez3D
      @Vez3D  ปีที่แล้ว +1

      The one that runs klipper. No need for a second one

    • @livewiya
      @livewiya ปีที่แล้ว

      @@Vez3D Awesome, thanks!!

  • @micromagic31
    @micromagic31 2 ปีที่แล้ว

    My rpi 3b+ can swith a 12v led strip with irf520 mosfet, but I can't get it to work with a 24v fan. Without fan attached the output of the mosfet is reacting to the slider in mainsail as expected. As soon as I attach the fan the voltage drops below 1v and the fan won't start. Any ideas? What mosfet are you using in your example?

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว +1

      It's a bed mosfet I got from Amazon. But any mosfet should work

    • @micromagic31
      @micromagic31 2 ปีที่แล้ว

      @@Vez3D The mosfet I'm using is a irf520N. This one is working with a gpio pin on the mainboard of my printer, but not with the Pi. It might have something to do with the control voltage of the Pi, but can't find proof for it..

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว +2

      @@micromagic31 pi will send 3.3 I think..so your mosfet needs to trigger with that low voltage

  • @markusn1365
    @markusn1365 2 ปีที่แล้ว

    Do I understand correctly, do you use the RPI with which the printer runs under klipper or do you have to install a second RPI?

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว

      I use the same as Klipper runs on.

  • @RogerGarrett
    @RogerGarrett หลายเดือนก่อน

    So, these things are controlled by macros within the g code file? Does this mean you also need to modify the slicer program to call those macros at the appropriate times?

  • @SysdefWonder
    @SysdefWonder 2 ปีที่แล้ว +1

    I can add a Z-Probe to the RPi and setup a GPIO as Z-Endstop and tell Klipper to use the Z-Endstop as Probe?

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว +1

      I think it should work yes

  • @bogdyy13
    @bogdyy13 2 ปีที่แล้ว

    Can you show how to add a Gyro for input shaper using the GPIO pins?

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว

      Already have a video about it. Look in my vid for input shaping

    • @bogdyy13
      @bogdyy13 2 ปีที่แล้ว

      @@Vez3D will do. Thanks!

  • @tigre3droyce771
    @tigre3droyce771 2 ปีที่แล้ว +1

    Thank you for the interesting video. I am planing to upgrade my 8bit board (I know it is shameful, pls don't judge me 😁) to a 32 bit board to fit Marlin 2.0. Now, my question is, can I just use the RasberryPi to extend my 8bit board? With RPi I can do a lot of cool stuff and there is no need to buy an 32bit board. Maybe I'll just make a complete switch to klipper instead. Thank you in advance! I am learning more stuff about the firmwares bit by bit.

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว +1

      yes you can use it to expand your board.

    • @joshua43214
      @joshua43214 2 ปีที่แล้ว +2

      With Klipper, your printer board ends up being nothing more than a fancy relay board. All the heavy lifting is done by the RPi, and the commands are just streamed to the printer board.
      Essentially, a "better" printer board does nothing for you at all in terms of computation.
      The only reason to upgrade the board then is if you need to improve the hardware interface I.E. ability to swap out step sticks, add more step sticks, use a more reliable board, etc.
      Upgrading to 32bits does nothing for you.

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว +1

      @@joshua43214 except I had issue running accelerometer on a old 8bit board. It failed because of not able to process the commands even with klipper on the pi

    • @g4egk
      @g4egk 2 ปีที่แล้ว

      Your machine maybe quieter with a board upgrade that has 2208/2209 stepper drivers too - any of the BTT SKR range or MKS have these

  • @Dark_Phoinix
    @Dark_Phoinix ปีที่แล้ว

    is possible use RTk.GPIO Board?

  • @ispalin4667
    @ispalin4667 2 ปีที่แล้ว

    👍

  • @sebastiangonzalez1690
    @sebastiangonzalez1690 2 ปีที่แล้ว

    How do i put the name for te unnamed lines and how i know wich pin is ?

  • @j.g545
    @j.g545 2 ปีที่แล้ว

    fyi that black panel mosfet on
    your picture (2:30) doesnt work from 3.3 volts. just tried it and it needs 12v even for control.

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว

      Ok good to know. I'll stick to the ones in the video then

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว

      Though specs say 3v minimum..but I guess specs are sometimes bad on those

  • @elitesennabubble
    @elitesennabubble ปีที่แล้ว +1

    wait im confused, can i control gpio pins from the same raspberry pi as I am running klipper on?

    • @Vez3D
      @Vez3D  ปีที่แล้ว +1

      Yes thats the point. Control it from klipper

    • @elitesennabubble
      @elitesennabubble ปีที่แล้ว

      @@Vez3D oh ok sorry i was confused i thought you would have to have 2 raspberry pis and that would be very expensive

  • @jpbnto
    @jpbnto 2 ปีที่แล้ว

    is it possible to add retraction settings slider in miscellaneous?

  • @korbak88
    @korbak88 2 ปีที่แล้ว

    Hi, great video, thanks!
    I'm looking to make timelapses with my canon eos1200D, but I'm stuck on how to, tell it to take the picture and store the picture on its SD card. if anyone has a solution I'm a taker:)

  • @FUKTxProductions
    @FUKTxProductions 2 ปีที่แล้ว

    "really super quick and easy." half hour later, "long and boring." lol nothing is usually ever quick and easy when klipper is involved, but what took you half an hour takes most ppl much longer. present company not excluded. its good that you mention ofter to read the docs. cause yes, it reeeeaaally helps, unless you are kevin o'conner. (he wrote them) one thing though, you cant control everything with the pi. like endstops or steppers independantly from one another. for example, on a previous board, the pins for my z enstop no longer worked at all so i thought i could just run it through the pi but sadly the endstop needs to be controlled by the same mcu as its assigned stepper...so i stripped that board for spare parts and got an MKS and wow what a difference 32bits makes. also, another great reason to run klipper with a pi is that it offloads so much of the processing strain from your printer mcu and anyone who ever printed with an 8bit board knows just how buggy and sometimes laggy they get. klipper is the best, but never quick and easy, but sometimes thats a good thing. my old board was quick and easy, now its spare parts.

    • @FUKTxProductions
      @FUKTxProductions 2 ปีที่แล้ว +1

      and just now as im looking through the new docs i just happen to find "multiple-mcu homing" hahaha better late than never i guess

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว

      Hehe it's super easy to do and super quick... But it's longer to explain in a video 😝

  • @orange_robot
    @orange_robot 9 หลายเดือนก่อน

    Please make 1 video for adxl345 accelerometer

    • @Vez3D
      @Vez3D  9 หลายเดือนก่อน

      there is one on my channel but its a bit old

  • @JustAlex686
    @JustAlex686 2 ปีที่แล้ว

    Have you tried 0 acceleration and 1, the fastest acceleration and slowest

  • @fishemrock
    @fishemrock 2 ปีที่แล้ว

    how to measure high temperature (400C) from raspberry pi directly ?

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว

      you could an ADC sensor with SPI .. like a PT100

  • @AdamStranberg
    @AdamStranberg ปีที่แล้ว

    RIP. Was following instructions/video when my rpi klipper would no longer load the printer. Hit reboot in the terminal, and now a rainbow screen of death....can't even ssh into the pi anymore. Think I lost all my klipper config files :'(

  • @liamels6282
    @liamels6282 26 วันที่ผ่านมา

    I cant get it to work, non of the gpio pins in gpioinfo show up, theyre all unnamed

  • @pockwaski
    @pockwaski ปีที่แล้ว

    I don't have a free pin "output" how to change pin to "output" ???

  • @davidmorgado3755
    @davidmorgado3755 2 ปีที่แล้ว

    Why not using GPIO pins of main board instead of RPI? 1 less MCU to update :)

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว +2

      30 sec from the start is the answer

    • @davidmorgado3755
      @davidmorgado3755 2 ปีที่แล้ว +2

      @@Vez3D sorry Simon, I missed that :( 👍🏼

  • @user-ny8qd3wr9s
    @user-ny8qd3wr9s ปีที่แล้ว

    777 like)

  • @TommiHonkonen
    @TommiHonkonen 2 ปีที่แล้ว

    i am going to make a flame sensor triggered camera so i can see when my printer burns

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว +1

      I'm not sure if this is sacarstic... Is it?

    • @TommiHonkonen
      @TommiHonkonen 2 ปีที่แล้ว +1

      @@Vez3D it is

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว

      @@TommiHonkonen mind explaining yourself? Have you seen anything fire hazard in my video? I'm always happy to learn if I did something wrong or stupid. Thanks

    • @TommiHonkonen
      @TommiHonkonen 2 ปีที่แล้ว +3

      @@Vez3D i meant it just as a joke. I am very peculiar person.

    • @Vez3D
      @Vez3D  2 ปีที่แล้ว

      @@TommiHonkonen ahhh haha ok sorry.