Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Adaptive pi

    Scheduled Pinned Locked Moved
    General Discussion
    3
    17
    471
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ozzzzzzyundefined
      Ozzzzzzy @droftarts
      last edited by

      @droftarts I also have this but I havnt tested it

      Might
      Drops surge current by ~35 % in <1 ms. No firmware changes beyond this snippet.

      // arp_heater.cpp – add to src/Heaters, include in build
      #include "Heaters/Heater.h"
      class ArpHeater : public Heater {
      public:
      ArpHeater(Heater* h, float a=0.02f, float m=0.001f)
      : inner(h), alpha(a), mu(m), G(1.0f) {}
      void Tick(float dt) override {
      float I = inner->GetCurrent(); // amps
      G += (alpha * fabsf(I) - mu * G) * dt; // dG/dt = α|I|–μG
      G = std::clamp(G, 0.1f, 2.0f); // safety limits
      inner->SetPwmScale(G);
      inner->Tick(dt); // normal PID
      }
      private:
      Heater* inner; float alpha, mu, G;
      }

      // HeaterManager.cpp – after creating each heater:
      if (reprap.GetPlatform().GetUserVariable("arp") == 1) {
      heaters[h] = new ArpHeater(heaters[h]);
      }

      Build: ./BuildFirmware.sh Duet3 (adds ~2 kB flash).
      Test:

      SETVAR arp=1 ; enable wrapper
      M303 H0 S200 ; PID‑tune as usual
      M568 P0 S200 A2 ; heat and watch VIN current

      That’s it—one multiply‑add per PWM tick, no new M‑codes.

      droftartsundefined MJLewundefined 2 Replies Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @Ozzzzzzy
        last edited by

        @Ozzzzzzy I'm not sure either of these suggestions are useful in their current form. For the Python arc generation script, you appear to have posted only a snippet of the Python code required, ie it only produces G2 commands, not G3. Is this something you developed, or found elsewhere? Please cite the source.

        For the second suggestion, are you having problems with the surge current on PWM controlled heaters or is it needed for some other reason? The ArpHeater class in your code doesn't make sense in the context of RepRapFirmware (checked with @dc42). Is it copied from Marlin or Klipper? Also SETVAR is not a valid command in RRF Gcode. Did you mean set var.arp = 1?

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        Ozzzzzzyundefined 1 Reply Last reply Reply Quote 0
        • Ozzzzzzyundefined
          Ozzzzzzy @droftarts
          last edited by

          @droftarts I discovered a new branch of math and it's electrical. It started with trying to solve the Traveling Salesman Problem and discovered it Been thinking dc42 would love It. I have a github for it. /RDM3DC/Adaptive-Resistance-Principle-ARP- also the tsp solver my help with shorter toolpaths.

          droftartsundefined 1 Reply Last reply Reply Quote 0
          • droftartsundefined
            droftarts administrators @Ozzzzzzy
            last edited by

            @Ozzzzzzy Okay, this is the Github repository: https://github.com/RDM3DC/Adaptive-Resistance-Principle-ARP-
            I can't see the Python adaptive toolpath script in there. Using the TSP solver for toolpaths would be more for a slicer to integrate.

            Ian

            Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

            Ozzzzzzyundefined 1 Reply Last reply Reply Quote 0
            • Ozzzzzzyundefined
              Ozzzzzzy @droftarts
              last edited by Ozzzzzzy

              @droftarts there's allot of info in the discussions, I havnt fully solved tsp yet but it might , you can make a slicer plugin that should work if you use the equation that should improve toolpaths, I messed with it weeks ago but would have to dig for it. I think the adaptive pi and the tsp slicer plugin would be 2 separate things derived from the same eqution and the heater tuner is seperate

              Ozzzzzzyundefined 1 Reply Last reply Reply Quote 0
              • Ozzzzzzyundefined
                Ozzzzzzy @Ozzzzzzy
                last edited by Ozzzzzzy

                @Ozzzzzzy I got an email if this is my account and it is. Just havnt posted in a long time and if you've read my post you no I can't spell so I need all the help I can get from ai, it did most the math I just discovered an analog computer with er fluid that might be able to solve tsp and then simulated it with python and the equation came from that

                droftartsundefined 1 Reply Last reply Reply Quote 1
                • droftartsundefined
                  droftarts administrators @Ozzzzzzy
                  last edited by

                  @Ozzzzzzy said in Adaptive pi:

                  @Ozzzzzzy I got an email if this is my account and it is. Just havnt posted in a long time

                  Okay, thanks, just checking, as it's been a while (5 years) since you last posted!

                  Ian

                  Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                  1 Reply Last reply Reply Quote 0
                  • MJLewundefined
                    MJLew @Ozzzzzzy
                    last edited by

                    @Ozzzzzzy "This is a post-processing script"? I don't see a script beyond the snippets, and I don't see a linked file. Download the script from where?

                    Ozzzzzzyundefined 2 Replies Last reply Reply Quote 0
                    • Ozzzzzzyundefined
                      Ozzzzzzy @MJLew
                      last edited by

                      @MJLew what slicer do you want I will try and make 1

                      MJLewundefined 1 Reply Last reply Reply Quote 0
                      • Ozzzzzzyundefined
                        Ozzzzzzy @MJLew
                        last edited by Ozzzzzzy

                        @MJLew I made a github but just made it and have not tested any of it /RDM3DC/TSP-slicer)

                        1 Reply Last reply Reply Quote 0
                        • MJLewundefined
                          MJLew @Ozzzzzzy
                          last edited by

                          @Ozzzzzzy Most of my printing is of gcode that I construct with my own custom code generating software. Hand-coded, if you like.

                          I used to use arcs extensively when my Duet-equipped Voron was my primary production printer, but I bought a Prusa MK4 and found to my horror that the firmware at that time did not properly support arcs! I changed all of my code to eliminate arcs. Finally, a long time after my prompting* Prusa added arc support to the firmware but my experiments suggested that arcs caused gave stuttering movements with blobs and zits and so I did not go back to arcs.

                          *I suspect that my questions and complaints did nothing to accelerate the incorporation of arcs into the firmware, as it was when PrusaSlicer integrated an ArcWelder-like feature that it was done.

                          Ozzzzzzyundefined 1 Reply Last reply Reply Quote 0
                          • Ozzzzzzyundefined
                            Ozzzzzzy @MJLew
                            last edited by

                            This post is deleted!
                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Unless otherwise noted, all forum content is licensed under CC-BY-SA