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

How to control 100 solenoids?!

Scheduled Pinned Locked Moved
General Discussion
8
28
2.6k
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.
  • undefined
    Hardware_SortingRobotics @dc42
    last edited by Hardware_SortingRobotics 22 Mar 2019, 08:12

    @dc42 I think I just need on/off control. I am planning on buying maybe 100 of these guys: SOLENOID

    I think that chip would work...So I guess I would build my own breakout board with ~13 of those chips and hook it up to the duet somehow?

    @JoergS5 My goal is to make a machine that separates good and bad tea leaves for my friends tea farm. Very similar to THIS machine but not nearly as big and not nearly as fast; just automated and kinda slow. I would say the actuation frequency should be less than 100ms I doubt I will need it faster than that.

    My friend doesn't have $250,000 dollars to buy one those, but I figured we could hack one together for under $5,000. 😛

    undefined undefined 2 Replies Last reply 22 Mar 2019, 08:49 Reply Quote 0
    • undefined
      snoozer
      last edited by 22 Mar 2019, 08:21

      Would that not be a classical application for a PLC rather than a motion controller ?

      Regards
      Jan

      Regards Jan

      --
      My Printers:
      #1 Prusa i3 MK3 kit all stock (Retired)
      #2 Rat Rig V-Core Core-XY (Almost finished but fully usable)

      My Experiments:
      https://www.thingiverse.com/snoozer17/designs

      1 Reply Last reply Reply Quote 0
      • undefined
        dc42 administrators @Hardware_SortingRobotics
        last edited by 22 Mar 2019, 08:49

        @injoi9000 said in How to control 100 solenoids?!:

        @dc42 I think I just need on/off control. I am planning on buying maybe 100 of these guys: SOLENOID

        I think that chip would work...So I guess I would build my own breakout board with ~13 of those chips and hook it up to the duet somehow?

        You could daisy chain all 13 and drive them from the temperature daughter board connector on the Duet, or from the same SPI pins on the expansion bus.

        Here's another octal solenoid driver: https://www.st.com/resource/en/datasheet/l9822e.pdf. And here's a 16-channel one: https://www.nxp.com/docs/en/data-sheet/MC33996.pdf. Note, with these two the inductive back EMF when the solenoid is released will be dissipated in the device. So you need to make sure that the amount of this energy is not excessive, or else use external flyback diodes. The TI part has internal flyback diodes. Flyback diodes slow down the solenoid turn-off, but you can mitigate that by connecting the flyback diodes to a separate rail or by connecting Zener diodes in series with them.

        @JoergS5 My goal is to make a machine that separates good and bad tea leaves for my friends tea farm. Very similar to THIS machine but not nearly as big and not nearly as fast; just automated and kinda slow. I would say the actuation frequency should be less than 100ms I doubt I will need it faster than that.

        How will you tell the difference between good and bad leaves?

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        undefined 1 Reply Last reply 22 Mar 2019, 09:06 Reply Quote 1
        • undefined
          Hardware_SortingRobotics @dc42
          last edited by Hardware_SortingRobotics 22 Mar 2019, 09:06

          @dc42 I am using a color spectrum analysis from the openCV library.

          Okay I think I understand. I remember those DRV8860 drivers from the old RAMPS boards a few years back. I could daisy chain all the DRV8860's together on my own little breakout board, attach the signal pins to the outputs of the DRV8860's, then I connect the inputs to these SPIO pins:

          0_1553246176210_Capture.PNG

          How do I send my serial signal from my computer/web interface/gcode file to those pins to control the DRV8860's?

          @snoozer It is 2019, PLC is expensive, inflexible, heavy, clunky, and it is just outdated tech. I also want to control the whole system through the duet and off the shelf IC's. The duet and arduino in general is awesome to work with.

          1 Reply Last reply Reply Quote 1
          • undefined
            dc42 administrators
            last edited by 22 Mar 2019, 09:21

            I presume you will be running OpenCV on a Raspberry Pi. In which case, if it is just the solenoids that you need to control (no stepper motors etc.) then it would be simpler to use the SPI output on the RPi to drive those chips and not use a Duet.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            undefined 2 Replies Last reply 22 Mar 2019, 09:24 Reply Quote 1
            • undefined
              Hardware_SortingRobotics @dc42
              last edited by 22 Mar 2019, 09:24

              @dc42 hmmm that's a good idea. Yea I am using a raspi for the openCV. I guess I will just use the duet to control the conveyor belts and then the SPI pins to control the solenoids.

              Is there anything else I need to put in series with those solenoids to the DRV8860's to prevent them from burning out my chips?
              '

              undefined 1 Reply Last reply 22 Mar 2019, 20:07 Reply Quote 0
              • undefined
                Hardware_SortingRobotics @dc42
                last edited by 22 Mar 2019, 09:27

                @dc42 but let's say I did decide to use the duet........for educational reasons.....how would I send signal to those SPIO pins?

                1 Reply Last reply Reply Quote 0
                • undefined
                  dc42 administrators
                  last edited by 22 Mar 2019, 11:10

                  You would use the SharedSPI library, the same way that SPI temperature sensors do. See function DoSpiTransaction in https://github.com/dc42/RepRapFirmware/blob/dev/src/Heating/Sensors/SpiTemperatureSensor.cpp.

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    JoergS5 @Hardware_SortingRobotics
                    last edited by 22 Mar 2019, 14:44

                    @injoi9000 Nice project, good luck with it!
                    For deciding good from bad tea, I found some ideas here for tobacco: https://www.tomra.com/en/sorting/food/food-technology maybe helpful ideas. Spectroscopy may be the easiest to start.

                    undefined 1 Reply Last reply 26 Mar 2019, 01:20 Reply Quote 0
                    • undefined
                      devleon @Hardware_SortingRobotics
                      last edited by devleon 22 Mar 2019, 20:07

                      @injoi9000 If you're only controlling a conveyer belt, why not just hook up a simple driver (stepper driver, mosfet or ssr) to the raspberry pi? There's plenty of GPIO. I think the Duet might just add a lot of unneeded complexity, and the raspberry pi should be capable enough to do everything.

                      Even if it's for educational purposes, you're going to need to jump through a lot of hoops and make it do something it's not really made to do

                      undefined 1 Reply Last reply 26 Mar 2019, 00:19 Reply Quote 0
                      • undefined
                        Hardware_SortingRobotics @devleon
                        last edited by 26 Mar 2019, 00:19

                        @devleon Yea I am going to use the gpio for the solenoids. Hmm I just got in these parts:
                        https://www.mouser.com/ProductDetail/595-DRV8860APW

                        Uhh am I supposed to send these off to a custom pcb house to get soldered to a board? The chip is tiny and the pins are even smaller...
                        0_1553559511418_Capture.PNG

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          Hardware_SortingRobotics @JoergS5
                          last edited by Hardware_SortingRobotics 26 Mar 2019, 01:20

                          @joergs5 oh yea definitely. My friend got a quote from there and they said it would be more than $250k!! I am sure I can make a micro version for wayyy cheaper.

                          undefined 1 Reply Last reply 26 Mar 2019, 05:53 Reply Quote 0
                          • ?
                            A Former User
                            last edited by 26 Mar 2019, 04:48

                            You can buy little SMD adapters that you can solder chip and headers to. Given you can use SPI then maybe you could use mcp23s17 + uln2803a which are available in DIP packages if thats important to you.

                            undefined 1 Reply Last reply 26 Mar 2019, 08:17 Reply Quote 0
                            • undefined
                              JoergS5 @Hardware_SortingRobotics
                              last edited by 26 Mar 2019, 05:53

                              @injoi9000 to find out good and bad tea, you can send some thousands of images to amazon mechanical turk for classification, then train a neural network (e. g. tensorflow) and use it to separate them. As spectral light sensors, AS7262 and AS7263 chips may be useful.

                              undefined 1 Reply Last reply 26 Mar 2019, 07:34 Reply Quote 0
                              • undefined
                                Hardware_SortingRobotics @JoergS5
                                last edited by 26 Mar 2019, 07:34

                                @joergs5 I don't really know much about neural networks so using tensorflow might be a bit of a stretch at this point 😓 I was planning on just taking a picture, doing spectral analysis on that whole picture, I can pass that matrix through an effective bandpass filter, then calculate the gradients at the points that didn't pass, then figure out the bad leaves' location. Use the speed of the conveyor with some trajectory analysis and then shoot them out of the sky.

                                undefined 1 Reply Last reply 27 Mar 2019, 03:47 Reply Quote 0
                                • undefined
                                  Hardware_SortingRobotics @A Former User
                                  last edited by 26 Mar 2019, 08:17

                                  @bearer thanks! I am going to pick up a few of these to prototype and then maybe i'll see if I can get some cheap boards from china for the 100 solenoids:

                                  https://www.mouser.com/ProductDetail/872-204-0004-01

                                  I think I'm going to stick to daisy chaining the DRV8860's because I think I can get my head around that one. Still gotta figure out how to execute the SPI commands. Would you know any good guides using python?

                                  undefined 1 Reply Last reply 26 Mar 2019, 08:24 Reply Quote 0
                                  • undefined
                                    dc42 administrators @Hardware_SortingRobotics
                                    last edited by 26 Mar 2019, 08:24

                                    @injoi9000 said in How to control 100 solenoids?!:

                                    @bearer thanks! I am going to pick up a few of these to prototype and then maybe i'll see if I can get some cheap boards from china for the 100 solenoids:

                                    https://www.mouser.com/ProductDetail/872-204-0004-01

                                    Have you seen the price of those? It would be cheaper to design your own PCB and have the PCB made in China. There are several companies that offer low cost prototype PCB manufacture, e.g. Itead and Seed Studio.

                                    Duet WiFi hardware designer and firmware engineer
                                    Please do not ask me for Duet support via PM or email, use the forum
                                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                                    undefined 1 Reply Last reply 5 Apr 2019, 06:46 Reply Quote 0
                                    • undefined
                                      JoergS5 @Hardware_SortingRobotics
                                      last edited by 27 Mar 2019, 03:47

                                      @injoi9000 your workflow to analyze tea is good, and you can put the step neural network between between the step "calculate gradients" and the "figure out location". The neural network is a learning algorithm to differ good from bad: you take same thousand samples where you know the result, then let the neural network find the decision rules. Then you can let your computer decide good from bad. You can differ: tea from not_tea, good_tea from not_good_tea, small_tea(young) from big_tea_leaves.

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        Hardware_SortingRobotics @dc42
                                        last edited by 5 Apr 2019, 06:46

                                        @dc42 So I got one of those overpriced DRV8860 EVM boards so I could learn how to control it over SPI and I think I have come to a bit of an impasse. I can easily control the solenoids over the GUI but then when I take the driver itself and try to control it with a SPI interface from my laptop I can't seem get it to follow my commands...this is the gui interface for the DRV8860 and the interface for the SPI Driver Controller:

                                        0_1554446656220_gui.PNG

                                        I then hooked everything up with my SPIDriver and tried to send the correct hexcodes to trigger the appropriate outputs but for some reason my MISO and MOSI outputs are being interpreted completely wrong... Any idea on how to command this thing?

                                        my setup:
                                        0_1554446777987_Capture.PNG

                                        1 Reply Last reply Reply Quote 0
                                        • Danalundefined
                                          Danal
                                          last edited by 6 Apr 2019, 03:37

                                          @injoi9000 said in How to control 100 solenoids?!:

                                          DRV8860 EVM

                                          This board does NOT appear to be set up to allow any external SPI control. The USB connector leads to a USB to Serial chip that, in turn, feeds a Texas Instruments MCU that, in turn drives an interface to the DRV8860 chips themselves. NONE of that is SPI.

                                          You'd have to drive this USB, or, tap into the RX and TX lines between the FTxxxx chip and the MCU and drive it at 3.3V TTL serial.

                                          Delta / Kossel printer fanatic

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