Design and research — The machine
How the sorter is put together
ExplanationThe sorter is a feeder that spreads a pile of bricks into single pieces, and a distribution system that drops each piece into the right bin. This page covers what each part does and what was tried before it.
Sorter V2 is two machines stacked on top of each other. The feeder is a column of four rotating channels that turns a heap of loose LEGO into a single file of pieces and photographs them. The distribution system sits underneath: a rotating chute that aims at one of many bins, one layer at a time. A piece goes in at the top of the feeder and leaves through the chute into a bin. The electronics that connect the two have their own page, How the electronics talk to each other.
The feeder, from the top down
Every channel is a C-channel: a rotor (the spinning part) turning inside a stator (the fixed housing around it). A NEMA 17 stepper motor, which turns in small exact steps, drives the rotor through gears (the motors have their own page, The motors). One shared channel core is built four times, and the four stages are numbered C1 to C4 from the top.
| Stage | Job |
|---|---|
| C1, bulk channel | Where unsorted parts go in. It has a , and no lamp or output guide. |
| C2 and C3, feeder channels | The two metering stages between C1 and C4. Each has a camera lamp for detection and an output guide. |
| C4, classification channel | Takes the pieces one or two at a time under the classification camera and hands each one to the distribution system. It uses a finned rotor and a cap, and the software calls it the carousel. |
The drops between the channels do the separating, not vibration. Each stand sets an 80 mm step down to the next channel. Each channel only moves when the channel after it has room, so a piece is never pushed onto a busy channel.
Cameras sit on C2, C3 and C4, each in a camera lamp: an LED strip ring in a white reflector under a grey cover, with the camera in the middle. The lamp was designed to do away with soldering, to lock the camera position so nothing needs adjusting, and, as a side effect, to remove the big white dome and make the camera arm, lights and bracket identical on all three channels (the 30 August 2026 meeting). Why the light is arranged the way it is has its own page, How the cameras are lit. C2 and C3 use a 720p camera for detection, C4 uses a 4K camera. Detection runs on all three. Identification only uses the C4 crops, which are close-up images cut out around each piece.
What was tried before
- A spiral labyrinth turntable. Clumps of pieces stayed clumped, small prototypes gave misleading results, a larger diameter made the machine too wide, and stacking turntables let the pieces clump again.
- A flat rotating V-channel. Nothing agitates the pieces, so it cannot separate them on its own.
- A vibratory V-channel on die springs. It worked, but it was loud.
- One big stair-step bulk feeder. The first generation used it, and C1 replaced it. A step feeder was also dropped as an idea because a piece lying badly may never ride up a step.
- More than four channels. Five channels in series showed the separation gain flattening out after about three.
- Light posts, an overhead camera mount and a classification dome. The camera lamp replaced all three, so each camera now brings its own light.
- Printed foot, leg and leg-extension stands. C1 now stands on 2020 extrusion legs and C2 and C3 on single printed legs. C4 sits flat on the top plate.
The software can move a channel's motor in three ways: Simple Pulse (the default), go-to-angle and constant movement. Which one is used is a software setting. The page on software architecture decisions covers how the software is split.
Why it is built this way
- Several channels in a row. The drop from one channel to the next has some chance of untangling a clump, so the more channels are stacked in series, the closer the separation gets to complete (March 2026).
- The 80 mm step. Each step down to the next channel is 80 mm. No designer has said why this value was chosen, so this is the closest thing on record rather than a confirmed reason. The channels were designed so that a piece fitting inside an 80 mm ball can clear every opening, and Marc said that putting one channel over another would mean raising it by at least another 6 cm "to clear that 80mm clearance ball" (April 2026). A step smaller than the largest supported piece would leave it touching two channels at once, which is the same guess a builder made in the design question thread. A taller step has a cost too: the height of the feeder takes away from the number of layers that fit under a given machine height (April 2026). We are still asking the designers whether the 80 mm step was derived from the part envelope.
- The cameras on C2 and C3 do not see the whole rotor. This is intended. The top and bottom of the ring do not need to be seen. What the software has to follow is the drop, where a piece lands from the channel above, and the exit, where it leaves for the next channel, and a camera that sits closer puts more pixels on those two places. It also keeps the camera arm short and the feeder more compact (September 2026). Raising the camera 7 cm shows the whole rotor, and measured from two screenshots of the same camera it costs about 24% of the pixels per millimetre (146 pixels per inch at the rim of the rotor against 112). The stated reason for caring about that resolution is to be able to use the pictures from the channels for classification (September 2026). The cost of the crop is that a piece can ride out of view and come back further round. Early on, a channel could forget a piece it could no longer see and stop turning, which was agreed to be still a problem (report, reply), and the view was not changed to fix it. Instead, a feeder setting called Out of view (since 30 September 2026, off by default) tells the machine which arc of C2 or C3 is unseen, so the channel keeps turning while a piece is in it. How to set it is in step 7 of first setup.
- The shape of the rotors. The faceted rotor, and why a round rotor fails on long pieces, is explained on Design intentions for the printed parts, with the original explanation. The finned rotor on C4 has small walls on the facets that force pieces to move, so that they end up separated and can be classified and ejected cleanly into the distribution (the 26 April 2026 meeting).
Where to find it
- Assembling the feeder, with the C-channels, the camera lamps and arranging the channels
- Research: C-channel singulation and feeder experiments
- Feeder logic: subsystems/feeder/pulse_perception/flow.py
- Camera and detection: perception/channel.py
Classification at C4
C4 is controlled by a small program called Two Piece. It is always in one of a few states, and it moves from one to the next as pieces arrive and leave. It turns one way, holds up to two pieces, and cycles through waiting, ejecting and staging. A piece is only released when the distribution system reports that its chute is ready. The chute and the layer door move at the same time, so the piece is never waiting for a door that has not started opening.
Pieces are identified from the C4 crops. Colour is read by comparing the piece with a calibration card, not by an AI model.
What was tried before
- A carousel with an identification chamber. C4 replaced it. The reasons on record are that identification from several images of one piece was wanted, the chamber jammed, the bottom camera gave poor pictures and misread often, and C4 has fewer parts.
- Imaging a piece from several channels. It was built and then switched off, and the C4 crops are used on their own.
- Two machine-learning methods for recognising pieces: embeddings, and then a classifier. These are covered on the classification research page.
Why it is built this way
- Two pieces at a time. C4 holds up to two pieces at a time. We are currently trying to find out why this was decided this way, and will add the reason or an explanation later.
- Identification by an online service. The plan for now is to stay with Brickognize, because telling apart the 20 or more blue shades reliably would need a model that knows the exact camera settings and lighting (March 2026). It is free, and the models that find where pieces are run locally for free (June 2026). Others argued for the project's own models, since a picture good enough for a person to recognise should be good enough for the software too (March 2026). A local model for offline use is planned, with no date.
Where to find it
- Classification channel assembly
- Research: Classification research
- Code: subsystems/classification_channel/two_piece
The distribution system
Distribution is a tower of layers. Each layer holds bins and has its own chute: a chute core with heat-set inserts, a door module with a servo, a layer adapter board, and funnel brackets that carry a funnel. The chutes of every layer are linked, and the whole stack rotates as one unit under a single NEMA 23 stepper. The bins never move. Once the stack points at a column of bins, the door of the right layer opens and the piece drops into the bin below it.
- Top interface. The interface between the feeder and the bin tower, where the rotating chute starts. It carries the stepper that turns the stack. Gears with a ratio of 120 to 25 turn it. It can turn up to 350 degrees, where a hard stop ends the movement. The software divides the turn into six sections by default.
- Bin tower. A hex frame with the layers stacked in it, 160 mm per layer. A layer holds 18 bins with a third funnel or 12 with a half funnel, chosen per layer. Three and five layers are the common builds. One ribbon chain reaches up to ten layers, see The servos and the layer adapter boards.
- Bottom interface. A Lazy Susan bearing the stack rests on, so it turns freely at the base. The top interface uses the same stock 8 inch bearing.
- Bins. One per sorting target, held in place by retainers.
What was tried before
- A linear layout. The first design carried pieces on a conveyor to tipping bins. It is more expandable and suits a wall, and it was compared with the circular design. The circular stack was chosen as the machine for this version.
- Idler wheels on bearing races at the foot of the stack. The wheels wore and tore at the races and came unscrewed. The bottom Lazy Susan replaced them, and a double Lazy Susan ran a week without problems.
- Early chute drops. About 78 per cent of test drops landed in the right place. A later test with taller bin walls and a soft flap landed 20 of 20. No figure exists yet for the current geometry.
- Wiring the rotating stack. Slip rings (parts that pass power to something that turns) and a static servo were discussed. Nothing was adopted, and the layer boards are chained together by ribbon cable. Serial servos, which would cut the wires to the layers, are planned for a later board revision. Reasons and open points are on The servos and the layer adapter boards.
Why it is built this way
- A circular stack. Reasons given when it was proposed (the 11 November 2025 meeting): one stepper can serve every slot, there are no belts to assemble, tune and maintain, a position is just an angle and a layer number, and a change of bin size changes the footprint of the machine less than it would in a linear layout. Later in the Discord (January 2026): a machine is made bigger or smaller by stacking more layers, there are no belts or gantries to calibrate, and modularity was a key requirement that a gantry cannot give (same thread). The linear layout was kept in mind as a more expandable option that suits a wall, and the meeting agreed to go ahead with the circle.
- One stepper and a gear. A printed gear was chosen over a belt because there is no belt of the right size to source (the 5 December 2025 meeting).
- The gear ratio. The chute is turned by a 25-tooth motor gear, a 25-tooth idler gear and a 120-tooth gear on the chute, a reduction of 4.8 to 1. A large reduction was wanted from the start: a large gear on the chute alone gives roughly eight to one (the 5 December 2025 meeting). In January 2026 the ratio was 5 to 1, aiming for 25 to 30 rpm at the chute, a full turn in about 3 seconds, which is about 150 rpm at the motor (the 10 January 2026 meeting). The idler is there because the chute moves up and down by about a millimetre as it turns, which is the height of a gear tooth. With a bevel gear that was enough to lose the mesh and make the motor skip. The first spur-gear version did not have the problem but got in the way of the cable cage, and an idler between the motor and the chute was proposed instead (February 2026, 15 February 2026 meeting). An idler also makes the ratio easy to tune: changing the size of the motor gear and the idler changes the speed and torque of the chute without moving the stepper or the chute gear. A small idler with a big motor gear gives more speed, a big idler with a small motor gear gives more torque (same thread). Why the tooth counts are exactly 25, 25 and 120 has not been written down, and we are still trying to find out.
- Almost a full turn, with a hard stop. The chute cannot turn all the way round, because a continuous spin would destroy the cable that runs to the layers (same meeting). The 351 degrees come from the printed stop (March 2026).
- Six sections. A layer has six structural dividers (November 2025), and one slot is a sixth of a layer (December 2025). A slot holds three third-size bins or two half-size bins (June 2026), which is where 18 and 12 per layer come from.
- The bin sizes. Only the third-size and half-size bins are used, and the large size is not. No designer has stated a reason, so this is the closest thing on record rather than a confirmed one. The only reason offered is capacity: a layer holds 18 third-size bins or 12 half-size bins, and the larger the bin, the fewer a layer holds. A designer of the original chute and layer family guessed the same, "best guess is for most capacity", while saying they did not know why it was dropped (October 2026). It also matches how the sizes were set. In November 2025 a small, medium and large family was described, with the smallest bin dictating the size of the funnel (November 2025). By February 2026 "big medium small" was called arbitrary, and the sizes were restated as a number of bins per layer, which allowed six (full width), 12, 18, 24 or 30 (February 2026). The third size was designed to fit a piece at least 48 mm (6 studs) wide and the half size one at least 64 mm (8 studs) wide, with some room to spare. A full-width "mega bin" for an 80 mm piece, with one bin across the whole section and a much shorter funnel, has not been designed (June 2026). So the large size was not removed from a finished design, it was never drawn. Whether capacity was the deciding reason is still unconfirmed.
- A closed funnel. Pieces bounce and lose energy, and can still get stuck in a shallow funnel, so the funnel should be covered to stop them jumping out (January 2026, same thread). The 11 November 2025 meeting made the same point about the chute.
- The height of a layer. Each layer is 160 mm tall because the bins are tilted. A bin is 80 mm high and is tilted by 30 degrees, and a bin of that size at that angle takes up exactly 160 mm of height (a designer's answer and sketch, October 2026). The 30 degrees is the angle of the chute, and the bin is tilted to match it, so that the gap between the chute and the bin wall is small and pieces do not jump out (the 10 January 2026 meeting). The first chute was about 13 degrees, and pieces got stuck on it (January 2026). In the same meeting, 25 degrees was reported as still too shallow for a piece to keep sliding once it has lost its speed, and 30 degrees was chosen so that it keeps sliding (recording; the transcript is hard to read at that point). The chute was changed to 30 degrees on 4 January 2026. A steeper chute leaves less room for the bin under the funnel, which has to be 65 mm high inside, so the layers were made taller in exchange (same day).
- The hexagon. The frame is a hexagon because it was the easiest shape to build for the form factor the machine was designed around. A circle is hard to make, and every extra side means more pieces, so six sides was a good middle ground (the designer's answer, October 2026). No one wrote down a reason for the number six at the time, so this is the designer's recollection rather than a recorded decision. The path to it is recorded. The stack started as a circle, because a round design is simpler and holds more bins for a given footprint (November 2025). Straightening the curves into "more of a multi hexagon" was suggested so that the cardboard bins could be cut flat and folded, at the cost of a little space (same month). The frame then moved from plywood to 2020 aluminum extrusion with straight segments (29 November 2025).
- The Lazy Susan bearings. The bottom bearing replaced wheels that tore into their bearing races and could come unscrewed, and it was judged more stable (the 7 June 2026 meeting). The top one is only for aligning the driving gear (the 1 March 2026 meeting).
- The bearing size. The Lazy Susan bearings are 8 inch (200 mm). No reason for that size has been found in the record. What is on record is how a Lazy Susan was chosen at all and what the size constrains. The load on the bottom is only thrust, so a Lazy Susan style slew ring bearing could be an option (November 2025), and the centre section was to rotate on an upper and a lower one (same month). A specific bearing was picked tentatively for the top and bottom on 10 December 2025. The bearing's inner diameter is the biggest opening the chute can have, so the chute narrows to it (the 5 December 2025 meeting). The models follow the part that was bought: a designer found theirs measured 202 mm, not 200, and corrected the model (December 2025). 8 inch is 203.2 mm and similar listings differ slightly, which raised a worry about sourcing, since there is no standard between them (same day). So 200 mm looks like the nominal size of the part the design was built around, but that is an inference, not a stated reason. We are still asking the designers why 8 inch rather than another size, and will add the answer when we have it.
Where to find it
- Assembling the distribution, with the top interface, the chute, the bin frame and the bottom interface
- Installing the bins
- Part page: Lazy Susan
- Code: subsystems/distribution/chute.py
How the software drives it
A computer, the Orange Pi, runs the camera vision, decides what happens next and serves the web interface. A small Pico board only moves motors and servos when told to. The reasons for that split, and the alternatives that were rejected, are on Software architecture decisions. The rest is on How the electronics talk to each other, which links on to the pin list, the motors and the servos.