How to use GPIO pins with Klipper

Поделиться
HTML-код
  • Опубликовано: 14 окт 2024

Комментарии • 110

  • @ApexNick
    @ApexNick 2 года назад +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 3 года назад +23

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

  • @2iinfinite
    @2iinfinite 3 года назад +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!

  • @jim5148
    @jim5148 2 месяца назад +1

    Excellent presentation of the topic.

  • @jackparlee6748
    @jackparlee6748 3 года назад +2

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

  • @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.

  • @Drew_pew_pew_pew
    @Drew_pew_pew_pew 3 года назад +1

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

  • @95LegendGS
    @95LegendGS 2 года назад +17

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

    • @leonnundel2443
      @leonnundel2443 6 месяцев назад

      Or a basic movement system

    • @denis2381
      @denis2381 4 месяца назад

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

  • @martintischer6217
    @martintischer6217 3 года назад +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.

  • @JoelRehra
    @JoelRehra 3 года назад +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  3 года назад +1

      valid good point

    • @GnuReligion
      @GnuReligion 2 года назад

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

    • @charmio
      @charmio Год назад

      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.

  • @DavidCook42
    @DavidCook42 3 года назад

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

  • @jay1st1st
    @jay1st1st Год назад

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

  • @Mainsail-Crew
    @Mainsail-Crew 3 года назад +3

    #mainsaillove

  • @Sixpack0000473
    @Sixpack0000473 Год назад

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

  • @grzegorzboduszek8687
    @grzegorzboduszek8687 3 года назад +3

    Really helpfull. More tutorials please.

  • @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 4 месяца назад

      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 4 месяца назад

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

    • @denis2381
      @denis2381 4 месяца назад

      @@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

  • @krafterHD
    @krafterHD 8 месяцев назад

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

  • @vmx200
    @vmx200 3 года назад +1

    Thank you for this walk through is is Fantastic!

  • @VladOnEarth
    @VladOnEarth 3 года назад +2

    Super useful info. Thanks for your work!

  • @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!

  • @MrW3iss
    @MrW3iss 8 месяцев назад

    Thanks a lot for all of the great videos man 👍

  • @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 👍

  • @viktorcoopman5479
    @viktorcoopman5479 7 месяцев назад

    Amazing work! Really helpfull

  • @bogdyy13
    @bogdyy13 3 года назад +1

    damn, i was just looking for this yesterday

  • @kingofnfsfan
    @kingofnfsfan 3 года назад +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 3 года назад

      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  3 года назад

      I don't sorry. Never experimented with it

  • @MitchCrane
    @MitchCrane 5 месяцев назад

    Very well done.

  • @infocusaerialmedia8041
    @infocusaerialmedia8041 11 месяцев назад

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

  • @michaelswinney9154
    @michaelswinney9154 Год назад

    Thank you sooooooo much for this video.

  • @the_guy_next_door_31
    @the_guy_next_door_31 Год назад

    Amazing content ! can't thank you enough

  • @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 ? 😜

  • @winandd8649
    @winandd8649 Год назад +2

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

  • @shangtsung2450
    @shangtsung2450 3 года назад

    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?

  • @solders2004
    @solders2004 3 года назад

    very useful video! thanks

  • @rokkweiler9166
    @rokkweiler9166 11 месяцев назад

    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

  • @RogerGarrett
    @RogerGarrett 5 месяцев назад

    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?

  • @DyminoCzyliLolek
    @DyminoCzyliLolek 3 года назад +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

  • @MrKiar1611
    @MrKiar1611 7 месяцев назад

    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.

  • @tigre3droyce771
    @tigre3droyce771 3 года назад +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  3 года назад +1

      yes you can use it to expand your board.

    • @joshua43214
      @joshua43214 3 года назад +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  3 года назад +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

  • @elitesennabubble
    @elitesennabubble Год назад +2

    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

  • @jooilpark9304
    @jooilpark9304 Год назад

    Thank you

  • @stevehanwright481
    @stevehanwright481 Год назад

    Thanks 😊

  • @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

  • @valerioranalli
    @valerioranalli Год назад +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 3 года назад

    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  3 года назад +1

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

    • @EduardoSousa-fk6oy
      @EduardoSousa-fk6oy 3 года назад

      @@Vez3D thank you

  • @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!!

  • @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

  • @jbrande
    @jbrande 3 года назад

    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  3 года назад

      I think its doable yes. never done it though

  • @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.

  • @ispalin4667
    @ispalin4667 3 года назад

    👍

  • @orange_robot
    @orange_robot Год назад

    Please make 1 video for adxl345 accelerometer

    • @Vez3D
      @Vez3D  Год назад

      there is one on my channel but its a bit old

  • @micromagic31
    @micromagic31 3 года назад

    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  3 года назад +1

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

    • @micromagic31
      @micromagic31 3 года назад

      @@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  3 года назад +2

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

  • @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

  • @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:)

  • @bogdyy13
    @bogdyy13 3 года назад

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

    • @Vez3D
      @Vez3D  3 года назад

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

    • @bogdyy13
      @bogdyy13 3 года назад

      @@Vez3D will do. Thanks!

  • @Dark_Phoinix
    @Dark_Phoinix Год назад

    is possible use RTk.GPIO Board?

  • @AdamStranberg
    @AdamStranberg 2 года назад

    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 :'(

  • @JustAlex686
    @JustAlex686 3 года назад

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

  • @sebastiangonzalez1690
    @sebastiangonzalez1690 2 года назад

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

  • @liamels6282
    @liamels6282 5 месяцев назад

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

  • @jpbnto
    @jpbnto 3 года назад

    is it possible to add retraction settings slider in miscellaneous?

  • @pockwaski
    @pockwaski Год назад

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

  • @fishemrock
    @fishemrock 3 года назад

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

    • @Vez3D
      @Vez3D  3 года назад

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

  • @davidmorgado3755
    @davidmorgado3755 3 года назад

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

    • @Vez3D
      @Vez3D  3 года назад +2

      30 sec from the start is the answer

    • @davidmorgado3755
      @davidmorgado3755 3 года назад +2

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

  • @youtubehandlesux
    @youtubehandlesux Месяц назад

    So this is what I've lost by using tiny 2-in-1 boards.

  • @JonathanAraujo-SenhorVip
    @JonathanAraujo-SenhorVip 4 месяца назад

    It didn't work for me :(

  • @TommiHonkonen
    @TommiHonkonen 3 года назад

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

    • @Vez3D
      @Vez3D  3 года назад +1

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

    • @TommiHonkonen
      @TommiHonkonen 3 года назад +1

      @@Vez3D it is

    • @Vez3D
      @Vez3D  3 года назад

      @@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 3 года назад +3

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

    • @Vez3D
      @Vez3D  3 года назад

      @@TommiHonkonen ahhh haha ok sorry.

  • @FUKTxProductions
    @FUKTxProductions 3 года назад

    "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 3 года назад +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  3 года назад

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