Subsystem *BCell* (Bend Cell Automation)
Prerequisite: Chapter 02 (Bend) read. BCell is layered on top of Bend — every BCell concept ultimately wraps a
BendOp. Goal: understand the bend-cell automation subsystem well enough to localize any robot-cell bug to the right code area without writing a fix. Reading time: 60—90 minutes. Companion to: chapter 02 §7.4 ("Robotic bend lives inBendOp, not separately") — that paragraph is the orientation; this chapter is the depth.
1. TL;DR — BCell in twelve lines
-
Domain: automated press-brake bending performed by a robot cell (Trumpf BendMaster 60/150, Cell5000, Cell7000, FlexCell 10, B23-attached cells).
-
Code root:
Src\Core\BCell\(34 files, ~1.2 MB) plusSrc\UI\BCell\(10 files). -
Top-level model:
BCellTechis abstract — concrete subclasses includeBM5000/BM7000/BC7000family. Lives atBendTech.Cell(everyBendTechmay have one cell). -
Three primary stages: Pickup (
BCPickup) → many Bends (regularBendOpplus possiblyBCRegripbetween them) → Deposit (BCDeposit). -
Cell items: physical objects that can sit in the cell —
BPallet,BDispenser,BCupGrip,BJawGrip,BProfileGrip,BFlipConveyor,BTiltConveyor,BLightBox,BFurniture— all under one baseBCellItem. -
Components vs. items: an item is the catalog object; a
BCComponentis the placed instance in this cell at a specific transform. -
Robot pose: kinematic state via
BRobotPose(axes / wrist / part transforms); inverse kinematics included. -
Routing:
BRoutingdecides per-bend insert/bend/extract strategy (front, side-left, side-right, with-ram, vacuum-on, swivel). -
Regrip flavors:
BCRegrip.EFlavor—Pickup,Deposit,Station,Clamp,PostBend,DuringBend,CenteringTable,DoubleSheet. Each has different rules about where it can be added. -
Output: robot code (proprietary text) + EIN files (Trumpf simulation) + standard NC for the brake.
-
UI controllers:
BCellGlob,BPickupGlob,BRegripGlob,BDepositGlob,BWaypointGlob,BGripperGlob,BJawPickupGlob,BGripperToolGlob,BFlexiGripperGlob,BRobotStrategyGlob— all underSrc\UI\BCell\. -
Tests:
Test\Bend\Cell\— yearly bundles (Cell2021.cs…Cell2026.cs) plus thematic (CellBasic.cs,CellFixes.cs,CellGripper.cs,BCRegripTest.cs,BCPickupTest.cs,BCDepositTest.cs,BCRouting.cs,BCExtract.cs,CellCustomer.cs,CellUI.cs).
2. Vocabulary — 25 terms
| Term | Meaning | Where in code |
|---|---|---|
Cell |
The bend cell — a robot, grippers, machine, peripherals |
|
BendMaster (BM60/BM150) |
Trumpf robotic bending cell families (60 kg / 150 kg payload) |
|
Cell5000 / Cell7000 |
Newer Trumpf cell platforms |
|
B23 |
A Trumpf APC-controlled brake; can be cell-attached |
|
FlexCell 10 |
Compact cell variant |
|
Pickup |
Picking the unbent blank from a pallet/dispenser |
|
Deposit |
Putting the finished part on a pallet/conveyor |
|
Regrip |
Mid-job change of how the gripper holds the part |
|
Pallet |
Passive part-storage shelf |
|
Dispenser |
Active blank-feeder with lifting suction |
|
Conveyor |
Active transport (flip / tilt variants) |
|
Light box |
Transillumination platform for image-recognition |
|
Cup gripper |
Vacuum or magnetic suction-cup gripper |
|
Jaw gripper |
Pincer-style gripper |
|
Profile gripper |
Long-thin gripper with a slide for extruded profiles |
|
Multi-circuit gripper |
Cup gripper with independent vacuum groups |
|
Suction cup |
A single cup on the cup gripper |
|
Cup state |
Per-cup on/off/leak state in a configuration |
|
Waypoint |
Discrete 3D pose along the robot trajectory |
|
Routing |
Insert / bend / extract strategy per bend |
|
Regrip station |
Fixed cell location used for hand-off regrips |
|
Centering table |
Cell component used to reference part position |
|
Separator sheet |
Paper/foam sheet placed between parts in a stack |
|
Lattice / DPlan |
The deposit lattice: rows×cols×layers + pitch + start corner + weave |
|
EIN file |
Trumpf simulation output for the bend cell |
|
Visuals:
Doc\Img\BCell\has the entire concept gallery — gripper anatomy, pickup cycle, deposit cycle, swivel side, slide, regrip station, separator sheet, image-point calculation, inverse-kinematics diagram. Every term above has a picture.
3. The data model — class hierarchy
Part
└─ BendTech
└─ Cell : BCellTech (optional, only for robotic parts) [BCellTech.cs]
├─ BMachine (inherited via BendTech)
├─ Components : List<BCComponent> [BCComponent.cs]
│ └─ Item : BCellItem (gripper / pallet / dispenser…) [BCellItem.cs]
├─ Pickup : BCPickup [BPickup.cs]
├─ Regrips : List<BCRegrip> [BRegrip.cs]
├─ Deposits : List<BCDeposit> [BDeposit.cs]
├─ Gripper : BGripper (active gripper for this run) [BCellItem.cs]
├─ DPlan : BDepositPlan (the lattice) [BDepositPlan.cs]
├─ Routing : per-BendOp BRouting [BRouting.cs]
├─ Waypoints : List<Waypoint> [internal in BCellTech]
├─ RobotCode : string (generated)
└─ Separators : (per pallet/dispenser) [BSeparator.cs]
Cell-item hierarchy (from BCellItem.cs lines 8—23)
BCellItem
├─ BStorage
│ ├─ BPallet
│ └─ BDispenser
├─ BGripper
│ ├─ BCupGrip
│ │ ├─ BProfileGrip
│ │ ├─ BGripperM
│ │ └─ BGripperS
│ └─ BJawGrip
├─ BLightBox
├─ BFurniture
└─ BEquipment
├─ BFlipConveyor
└─ BTiltConveyor
Three subtleties
-
BCellTechis abstract. Every concrete cell is one of a small set of subclasses (BM5000family,BC7000Tech). When you readBCellTech.Foo(), look at the concrete class that the part actually owns — overrides matter. -
Items are catalog, components are placements. Editing a
BCupGrip(item) potentially affects all parts that use it; editing itsBCComponent(placement) only affects the current cell. -
Stages are siblings, but ordered. A cell run is Pickup → (Bends with optional Regrips between them) → Deposit. The Bend ops themselves are owned by the parent
BendTech; BCell owns the inter-bend "glue".
4. Module map — the 34 files grouped
4.1 Root Src\Core\BCell\ (24 files)
| Size | File | Contents |
|---|---|---|
81 KB |
|
The abstract cell tech. Read first. Constructors, dump format, robot-code mangling, components/regrips/deposits lists. |
85 KB |
|
The item type hierarchy (gripper, pallet, dispenser, conveyors). Long but the comment header (lines 8—23) is the cheat-sheet. |
66 KB |
|
Cross-cutting helpers used by the cell stages. |
28 KB |
|
View-models for cell rendering: |
14 KB |
|
Small types and enums shared across the module. |
7 KB |
|
Operations facade. |
28 KB |
|
The "placed instance" wrapper around a |
57 KB |
|
Pickup operation (vacuum from pallet, jaw from dispenser, with light-box imaging). Implements |
9 KB |
|
Lattice/plan for the pickup pile. |
61 KB |
|
Regrip operation. Eight flavors in |
34 KB |
|
Deposit operation. |
46 KB |
|
The deposit lattice ( |
42 KB |
|
Cup gripper, suction cups, multi-circuit configuration. |
11 KB |
|
Flexible gripper variant. |
14 KB |
|
Active equipment (flip/tilt conveyors). |
21 KB |
|
Separator-sheet model. |
31 KB |
|
Per-bend insert/bend/extract strategy. |
34 KB |
|
Robot kinematics — FK/IK, axes ↔ wrist ↔ part transforms. |
45 KB |
|
Step-by-step simulation of a cell run. |
9 KB |
|
NC-side simulation for Cell5000. |
10 KB |
|
NC-code interface. |
21 KB |
|
Tooling-side gripper representation. |
9 KB |
|
Cell7000 specialization. |
13 KB |
|
Fanuc-controller specialization. |
4.2 Src\Core\BCell\Ops\ (10 files — algorithms)
| Size | File | Contents |
|---|---|---|
39 KB |
|
Cell-level computation orchestrator. |
22 KB |
|
Importing grippers (ARV / JSON / DXF / GEO — see Note 2017). |
45 KB |
|
The lattice/deposit expert (decides where each part lands). |
16 KB |
|
Decides whether / which regrips to insert. |
42 KB |
|
Regrip auxiliary algorithms. |
20 KB |
|
Decides pickup parameters (which gripper config, which cups, which approach). |
24 KB |
|
Special-case logic for dispenser pickups. |
29 KB |
|
Per-step computer (waypoints, simulation steps). |
40 KB |
|
Refinement passes after initial planning. |
26 KB |
|
Robot-path planner (between any two cell poses). |
4.3 UI hooks Src\UI\BCell\ (10 files)
| File | Wraps |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
strategy editor |
4.4 Notes
| Note | Content |
|---|---|
|
Required reading. How DXF/GEO files import cup-gripper data (cup positions, groups, baseplate, multi-circuit). |
|
BMC machine format (cell-aware machines too). |
|
Importing cell components. |
5. The eight regrip flavors (the most subtle topic)
BCRegrip.EFlavor (in BRegrip.cs) drives where and how a regrip can be inserted. Each flavor has different placement rules — see BendOpGlob.AddRegrip in Src\UI\Bend\BendOpUI.cs lines 21—55.
| Flavor | Where it occurs | Notes |
|---|---|---|
|
Right after the pickup, before the first bend |
Available if the pickup pose differs from what the first bend wants. |
|
Right before deposit, after the last bend |
Available if the deposit pose differs from the last-bend hold. |
|
At a fixed regrip station between two bends |
Requires |
|
While the part is held by the brake clamp |
Available if previous regrip wasn’t a station/pickup/centering-table. |
|
Right after a bend, before the next |
Cannot stack with another |
|
While the part is being bent (rare, machine-dependent) |
Requires |
|
At a centering-table component |
Requires a |
|
At a double-sheet station for paired processing |
Requires |
When debugging "regrip in the wrong place" or "regrip cannot be added", the answer is almost always in this enum’s rules combined with the per-cell capability flags.
6. Lifecycle of a robotic part — sequence in words
1. Part loads (.fx or 3D import).
2. BendTech.Make creates the bend projection (chapter 02 §5).
3. If the target machine is cell-attached:
a. BCellTech is constructed (concrete subclass: BM5000 / BC7000 / Fanuc).
b. Cell components (gripper, pallet, dispenser, regrip stns) are placed.
c. BendTech.Cell = cellTech.
4. BendTooler.Process runs (still chapter 02).
─ But: now mRobotic = true → tool-scoring / sequencing rules differ.
5. Cell-level expert passes:
a. PickupExpert / DispenserExpert decide pickup parameters.
b. BRegripExpert decides regrips between bends.
c. BDepositExpert decides the deposit lattice.
d. CellRefine refines the plan.
e. RPathPlanner plans robot motion between every pose.
f. BStepComputer materializes per-step waypoints.
6. BSimStepNeo simulates the run end-to-end.
7. Validation: per-stage EBCStatus / EBStatus flags collected.
8. Output:
─ NC code for the brake — produced by a C# writer in Src\API\Bend\Post\
(e.g. BNCWriter for Cell5K / TrumpfB23, TrumpfDLD, ...) via Hub.GenerateNC.
─ Robot code (cell-specific text) — generated by BCellTech.RobotCode + MangleRobotCode.
─ Optionally an EIN file (Trumpf simulation) via BCellTech.EINWriter.
7. Three canonical reading tours (15 min each)
Tour A — "What does a cell run actually consist of?"
-
Src\Core\BCell\BCellTech.cslines 27—80 — the abstract base, components/regrips/deposits lists. -
Src\Core\BCell\BCellTech.csDumpmethod lines 45—78 — exactly what gets compared in tests. -
Test\Bend\Cell\CellBasic.cslines 13—137 — a fixture withTesthelper. Note the helper callstech.Cell.CheckDump (...)andtech.CheckBNC (...): two golden files per test (cell text + NC).
Self-check: name the three lists on BCellTech that determine cell behavior. What does MangleRobotCode do?
Tour B — "What is a regrip, mechanically?"
-
Src\Core\BCell\BRegrip.cslines 14—60 — class declaration and constructor. -
BCRegrip.EFlavorenum (searchenum EFlavorinsideBRegrip.cs) — the eight kinds. -
Src\UI\Bend\BendOpUI.cslines 21—55 —BendOpGlob.AddRegrip. The rules of "what flavor can be added next" live here.
Self-check: if the user clicks "Add Regrip" on the first bend, which flavors are eligible?
Tour C — "How are grippers imported?"
-
Notes\Tech\2017.CupGripperInfoInDwg.ftx— the entire note (~90 lines). -
Src\Core\BCell\Ops\BCellImport.cslines 1—30 — theBCupGripImport.Loadentry, ARV vs. JSON. -
Src\Core\BCell\BCupGrip.cslines 13—40 — theICupGripinterface, what the imported gripper must expose.
Self-check: what is a "multi-circuit" gripper, and where in the DXF does the circuit grouping appear?
8. Common stumbling blocks
8.1 BCell logic is split across BendOp and BCRegrip
Robotic-bend awareness lives partly in BendOp (Robotic, RegripDuringBend, IsFirstOp/IsLastOp cell-stage logic) and partly in BCRegrip (the regrip itself). When a "regrip in wrong place" bug arrives, both places need inspection, not just BCell.
8.2 BCellTech is abstract — every override matters
BCellTech defines the contract; BM5000, BC7000Tech, BCFanucTech override behavior. A bug "only on Cell7000" usually points at 7K\BC7000Tech.cs. A "only on Fanuc" bug → Fanuc\BCFanucTech.cs.
8.3 Versioning is everywhere
BPickup.PostLoad (BPickup.cs lines 31—50) does an in-line migration based on mCell.FXBuildRev and mCell.FXBuildNo — not just AuType.ObjVersion. The pattern is: turn off status flags that older builds couldn’t set correctly. When you find a flag mysteriously missing, check the build-number gates.
8.4 Robot-code post-processing is in the dump
BCellTech.MangleRobotCode (lines 80—119) post-processes the raw robot code to produce the canonical text used in tests. If you see odd DZ/DY/DX deltas in golden files, that’s this method emitting compact relative motion.
8.5 Cell items have EFlags for capability gating
BCellItem.EFlags (25 flags!) gates compatibility (BM60 vs. BM150 vs. B23 vs. FC10 vs. Cell7000 vs. TBC7030, plus structural attributes like Conveyor, Centering, DoubleSheet, Inclined, RotateBy180). When a component doesn’t appear in a placement dialog, the answer is here.
8.6 The IGripSource interface
BCPickup and BCRegrip both implement IGripSource (search the interface in BCupGrip.cs or sibling) — they are the two places the part transitions to a new gripper hold. Bugs about "gripper hold transform after regrip/pickup" are at this interface.
8.7 Two output streams
A cell test uses two golden files: a .txt (the cell dump) and a .nc (the brake NC code). Changing one without the other = one of the two will fail.
9. Tests — how they are organized
Inventory (X:\Test\Bend\Cell\, 15 files; plus Cell7K\Cell7KBase.cs)
| Category | Files |
|---|---|
Cell5000 basics |
|
Yearly regression bundles |
|
Per-stage tests |
|
Routing & extraction |
|
Customer-specific |
|
Grippers |
|
Misc / fixes |
|
UI |
|
Cell7000 |
|
Cell-aware IO |
|
The standard test pattern
From Test\Bend\Cell\CellBasic.cs lines 131—137:
public static Part Test (string infile, int idMC = 93, bool checkBNC = true) {
var part = FX.LoadTestPart (infile);
part.DoSwitchToBending (EDoFlags.NoGAPAdjust, BendMachine.Get (idMC));
part.BendTech.Cell.CheckDump (Path.ChangeExtension (infile, ".txt"));
if (checkBNC) part.BendTech.CheckBNC (Path.ChangeExtension (infile, ".nc"));
return part;
}
Note the differences from chapter-02 Bend tests:
-
idMC = 93is the standard cell-attached machine (X:\Data\Machine\93\), not 13. -
DoSwitchToBendingnotBendTech.Makedirectly (cell-aware switching). -
Two golden checks:
Cell.CheckDump(cell text) +BendTech.CheckBNC(brake NC). -
BendCellMiscadds EIN-file tests (EINTest, lines 169—174) and recognition-image tests (Test, lines 175—187).
Test inputs live under X:\TData\Cell\<area>\ with the same subdirectory taxonomy as the test categories above. Customer cases use the prefix C<number> (e.g. C45292, C42921); internal tickets use T<number> (e.g. T4715, T8574).
10. The four standard machines / cells
| ID | What | Where |
|---|---|---|
93 |
Default cell-attached test machine |
|
13 |
Default standalone bend test machine |
|
99 |
|
|
custom |
Customer machines (delivered with installation) |
|
Cell-aware machines have additional cell metadata in their Machine.curl. The cell-tech subclass is selected based on the machine’s cell type.
11. When a BCell bug arrives — 60-second triage
| Symptom | Likely code area | First file |
|---|---|---|
"Wrong gripper choice" |
Pickup expert |
|
"Cup state wrong / waypoints don’t update" |
Pickup setter logic |
|
"Regrip inserted in wrong place" |
Add-regrip rules |
|
"Regrip-station collision" |
Regrip-station Y position / shift |
|
"Deposit lattice wrong" |
Deposit expert |
|
"Robot motion through obstacle" |
Path planner |
|
"Wrong insert/extract direction" |
Routing |
|
"Robot code looks wrong" |
Mangling |
|
"EIN file mismatch" |
EIN writer |
|
"Component missing from placement dialog" |
Capability flags |
|
"Gripper import fails" |
Import path |
|
"Cell-only on Cell7000" |
Cell7000 override |
|
"Cell-only on Fanuc" |
Fanuc override |
|
"Image recognition off" |
Pickup imaging |
|
"Separator-sheet stack wrong" |
Separator |
|
"Force/payload check wrong" |
Cup load |
|
"Stroke / reach error" |
Robot pose |
|
"Sim step wrong" |
Step computer |
|
12. Exercise 1 — "Find & Explain" (30 min, read-only)
Task. Explain in half a page what happens when a user adds a "Station" regrip to the second bend of a cell-attached part.
Approach:
-
Src\UI\Bend\BendOpUI.cslines 21—55 —AddRegrip. Which conditions enableEGTag.AddAtStation? -
Src\Core\BCell\BRegrip.cslines 14—60 — what does the constructor do, and what ismGripXfmAfter? -
Src\Core\BCell\Ops\BRegripExpert.cs— does the expert recompute anything, or is the user’s edit final? -
BCellTech.Dump— where in the cell text does this regrip appear? -
Bonus: what test in
Test\Bend\Cell\BCRegripTest.csis closest to this scenario?
Rubric:
| Level | Criterion |
|---|---|
1 |
Locates |
2 |
Explains the eligibility conditions |
3 |
Plus: traces to a re-validation pass and to the dump |
4 |
Plus: identifies the corner case where station regrips collide with regrip-station home positions |
13. Exercise 2 — "Trace a real cell bug" (45 min, read-only)
Task. The recent commit 4a5119dcb ("Case 45728: Changing the suction cup state no longer deletes adjusted waypoints") is a textbook BCell bug. Read the diff and answer:
-
Which class’s setter triggered the bug? (Hint: cup state lives in a cup-grip-config type.)
-
Which setter forgot to invalidate which dirty flag? (See
EBDirty/EBInvalid.) -
Which test fixture covers the case?
-
Bonus: the second recent commit
3a1791bf8("Case 46197: Don’t change GripperHoldXfm when changing base plane for centering regrip") is a related class. Compare the two: same module? Same flavor of fix?
Rubric:
| Level | Criterion |
|---|---|
1 |
Names the file and the property |
2 |
Identifies the dirty / invalidate flag pattern |
3 |
Plus: locates the test |
4 |
Plus: explains why the centering-regrip variant needed the opposite of the first fix |
14. What this chapter does not cover
-
NC code generation for the brake — see chapter 02 §10. NC writing is handled by C# writers in
Src\API\Bend\Post\(e.g.BNCWriterfor Cell5K / TrumpfB23,TrumpfDLD, …) dispatched viaHub.GenerateNC. -
The Bend Tooler proper — chapter 02. BCell influences it via
mRobotic; it does not reimplement it. -
Cell7000 / Fanuc deep specifics — separate chapters when those subsystems mature further.
-
The wider
Simsubsystem —Src\Core\Sim\is invoked by BCell but is its own area. -
Individual gripper-import format details — see
Notes\Tech\2017for cup grippers; jaw / profile have their own notes.
15. If you take just one thing from this chapter
BCell lives at
BendTech.Celland orchestrates three stages — Pickup, Regrips, Deposit — around the existing Bend sequence. Almost every cell-specific bug is a flavor / capability / version gate in one of those three stages, or the regrip-add rules inBendOpGlob.AddRegrip. Models are catalog (BCellItem); placements are instances (BCComponent). Always check both.
Last updated: 2026-05-04. Code paths verified against Src\Core\BCell\, Src\UI\BCell\, Test\Bend\Cell\, and Note 2017.