Obsidean_VM/03-VM/44 - 98050 - Fiera/Especifica/AccumulationTable - En.md

481 lines
15 KiB
Markdown

# Accumulation Table System Documentation
## System Overview
The Accumulation Table System is a PLC-based control solution for a test ring facility designed to handle two different bottle formats. The system manages bottle accumulation, divider/combiner operations, and format switching capabilities for individual bottle handling.
### System Architecture
The system is built around several key components:
- **Main Controller**: `FC_Ttop_Run.scl` - Main execution control function
- **Device Configuration**: `FC_Ttop_Devices.scl` - Device setup and configuration
- **Accumulation Logic**: `FB_AccumTable.scl` - Core accumulation table function block
- **Motor Management**: `FB_Motors_Manage.scl` - Universal motor control block
- **Format Management**: `FC_FormatCheck.scl` - Format change coordination
## Core Components Analysis
### 1. FC_Ttop_Devices.scl
This function is responsible for device configuration and initialization of the table top system.
#### Key Features:
- **Recipe Configuration**: Sets speed, position, and timing parameters for all devices
- **Area Management**: Configures infeed, outfeed, and channel areas with their respective recipes
- **Motor Coordination**: Links all motors with their specific function blocks
- **Format Handling**: Updates guide positions based on format requirements
#### Critical Configuration Parameters:
```scl
// Channel Area Configuration
"FB_AccumTable_DB".Area_Channel[n].Recipe.Length := 11600;
"FB_AccumTable_DB".Area_Channel[n].Recipe.End_Area := 300;
"FB_AccumTable_DB".Area_Channel[n].Recipe.Initial_Area := 500;
"FB_AccumTable_DB".Area_Channel[n].Recipe.Outfeed_Safety_Area := 2000;
```
#### Motor Integration:
- Infeed Table Motors: M31610 (Left), M31710 (Right)
- Outfeed Table Motors: M34110 (Left), M34210 (Right)
- Channel Motors: U32810-U33610 (Channels 1-9)
- Guide Motors: M31810 (Infeed), M34310 (Outfeed)
### 2. FB_AccumTable.scl
The main function block managing the accumulation table operations.
#### Input Parameters:
- `i_Reset_AllCounters`: System reset signal
- `i_Pth_Min_Accumulation`: Minimum accumulation photocell
- `i_Pth_Count_Input`: Input counting photocell
- `i_Pth_Safety_Selector_Input`: Input selector safety photocell
- `i_Pth_Safety_Selector_Output`: Output selector safety photocell
- `i_Pth_Count_Output`: Output counting photocell
- `i_Pth_Max_Accumulation`: Maximum accumulation photocell
- `i_GuidesInPosition`: Guide positioning confirmation
- `i_Nominal_Speed`: Base speed reference (1000.0 mm/sec)
- `i_Bottle_Size`: Bottle dimensions (100.0 mm)
- `i_Bottle_Gap`: Gap between bottles (5.0 mm)
#### Output Parameters:
- `o_Load_Finish`: Load operation completion signal
- `o_Unload_Finish`: Unload operation completion signal
#### Core Logic Structure:
The system operates through a state machine with multiple cycle steps managing:
1. **Channel Selection**: Automatic selection of available channels for bottle routing
2. **Speed Calculation**: Dynamic speed adjustment based on bottle parameters
3. **Area Tracking**: Virtual encoder simulation for bottle tracking
4. **Safety Management**: Photocell-based safety zone monitoring
#### Key Algorithms:
**Speed Factor Calculation:**
```scl
IF "i_Bottle_Gap" > 0 AND "i_Bottle_Size" > 0 THEN
"k_Factor" := 1.0 + ("i_Bottle_Gap" / "i_Bottle_Size");
ELSE
"k_Factor" := 1.0;
END_IF;
```
## State Machine Operation (CASE Logic)
The FB_AccumTable operates through a comprehensive state machine implemented via a CASE statement based on `#Status.Cycle_Step`. This state machine manages all operational modes and transitions.
### State Machine Architecture
```mermaid
stateDiagram-v2
[*] --> Idle
Idle --> Bypass_Setup: No Load/Unload Request
Idle --> Loading_Mode: Load Request
Idle --> UnLoading_Mode: Unload Request
Bypass_Setup --> Bypass_Mode: Selectors Positioned
Bypass_Mode --> Loading_Mode: Load Request
Bypass_Mode --> UnLoading_Mode: Unload Request
Loading_Mode --> Load_Ch1: Format Sx
Loading_Mode --> Load_Ch9: Format Dx
Loading_Mode --> Idle: No Space Available
Load_Ch1 --> Load_Ch2: Channel 1 Full
Load_Ch2 --> Load_Ch3: Channel 2 Full
Load_Ch3 --> Load_Ch4: Channel 3 Full
Load_Ch4 --> Idle: Channel 4 Full/Timeout
Load_Ch9 --> Load_Ch8: Channel 9 Full
Load_Ch8 --> Load_Ch7: Channel 8 Full
Load_Ch7 --> Load_Ch6: Channel 7 Full
Load_Ch6 --> Idle: Channel 6 Full/Timeout
UnLoading_Mode --> Unload_Ch4: Format Sx
UnLoading_Mode --> Unload_Ch6: Format Dx
UnLoading_Mode --> Idle: All Empty
Unload_Ch4 --> Unload_Ch3: Channel 4 Empty
Unload_Ch3 --> Unload_Ch2: Channel 3 Empty
Unload_Ch2 --> Unload_Ch1: Channel 2 Empty
Unload_Ch1 --> Idle: Channel 1 Empty
Unload_Ch6 --> Unload_Ch7: Channel 6 Empty
Unload_Ch7 --> Unload_Ch8: Channel 7 Empty
Unload_Ch8 --> Unload_Ch9: Channel 8 Empty
Unload_Ch9 --> Idle: Channel 9 Empty
```
### State Definitions and Operations
#### 1. **IDLE State** (`#Idle: 0`)
**Purpose**: System waiting state with priority-based operation selection
**Logic**:
```scl
// Priority hierarchy: Load > Unload > Bypass
IF #i_Load_Request THEN
#Status.Cycle_Step := #Loading_Mode;
ELSIF #i_Unload_Request THEN
#Status.Cycle_Step := #UnLoading_Mode;
ELSIF NOT #i_Load_Request AND NOT #i_Unload_Request THEN
#Status.Cycle_Step := #Bypass_Setup;
END_IF;
```
**Transitions**: Based on external requests with defined priority
#### 2. **BYPASS_SETUP State** (`#Bypass_Setup: 1000`)
**Purpose**: Prepare system for direct bottle flow through central channel
**Key Operations**:
- Configure both selectors to central position (Channel 5)
- Enable selector movement
- Verify positioning and safety conditions
- Wait for all systems ready
**Safety Conditions**:
```scl
#Conditions_To_Run := #i_GuidesInPosition AND
(#Infeed_ChSelector.o_InPosition = #Central) AND
(#Outfeed_ChSelector.o_InPosition = #Central) AND
#Status.Motors_Enable AND #Status.AutoCycle;
```
#### 3. **BYPASS_MODE State** (`#Bypass_Mode: 1010`)
**Purpose**: Active bypass operation for direct bottle flow
**Logic**:
- Continuous monitoring of selector positions
- Demand-based motor control
- Return to setup if selectors move incorrectly
**Flow Control**:
```scl
// Run central channel based on output demand
IF #Area_Outfeed_Ch_Selector.Status.Empty_End_Area OR #Dosser_Output.i_Motor_Run THEN
#Area_Channel[#Central].i_Motor_Run := TRUE;
#Dosser_Input.i_Motor_Run := TRUE;
ELSE
// Stop if no demand from output
#Area_Channel[#Central].i_Motor_Run := FALSE;
#Dosser_Input.i_Motor_Run := FALSE;
END_IF;
```
#### 4. **LOADING_MODE State** (`#Loading_Mode: 2000`)
**Purpose**: Initial preparation and channel availability assessment
**Channel Availability Logic**:
- **Format Sx (Left)**: Check channels 1-4 for available space
- **Format Dx (Right)**: Check channels 6-9 for available space
**Preparation Sequence**:
1. Configure selectors to central position
2. Stop infeed during preparation
3. Clear central areas
4. Determine starting channel based on format
#### 5. **Load Channel States** (`#Load_Ch1-9: 2010-2090`)
**Loading Strategy**:
- **Left Format (Sx)**: Load sequence 1→2→3→4 (outermost to innermost)
- **Right Format (Dx)**: Load sequence 9→8→7→6 (outermost to innermost)
**Example - Load Channel 1 Logic**:
```scl
// Prerequisites for Channel 1 loading:
// - Target channel (1) must have end area space
// - All intermediate channels (2,3,4) must be completely empty
IF #Conditions_To_Run AND
#Area_Channel[1].Status.Empty_End_Area AND
#Area_Channel[2].Status.Empty AND
#Area_Channel[3].Status.Empty AND
#Area_Channel[4].Status.Empty THEN
// Configure selector and run motors
#Status.InfeedSelector_Ch := 1;
// Run all channels in path: 1→2→3→4→5(central)
#Area_Channel[1].i_Motor_Run := #Filtered.Min_Accumulation OR NOT #i_Load_Request;
// ... (similar for channels 2,3,4,5)
END_IF;
```
**Progressive Loading Logic**:
- Each channel requires downstream channels to be empty
- Motors run based on accumulation status or load request
- Input dosser runs only when target channel has large space available
#### 6. **UNLOADING_MODE State** (`#UnLoading_Mode: 3000`)
**Purpose**: Preparation for bottle evacuation from storage channels
**Preparation Steps**:
1. Stop input feeding
2. Position input selector at center
3. Clear all central areas
4. Determine starting channel (innermost to outermost)
#### 7. **Unload Channel States** (`#Unload_Ch1-9: 3010-3090`)
**Unloading Strategy**:
- **Left Format (Sx)**: Unload sequence 4→3→2→1 (innermost to outermost)
- **Right Format (Dx)**: Unload sequence 6→7→8→9 (innermost to outermost)
**Example - Unload Channel 4 Logic**:
```scl
// Basic conditions for unloading
#Conditions_To_Run := #Dosser_Output.i_Motor_Run AND
#Area_Channel[#Central].Status.Empty AND
#Area_Infeed_Ch_Selector.Status.Empty;
// Run motors only when output selector is positioned
IF #Outfeed_ChSelector.o_InPosition = #Status.OutfeedSelector_Ch THEN
#Area_Channel[#Central].i_Motor_Run := #Conditions_To_Run;
#Area_Channel[4].i_Motor_Run := #Conditions_To_Run;
END_IF;
```
**Progressive Unloading Logic**:
- Start from innermost channels (closest to central)
- Each channel waits for previous channel to empty
- Output selector moves progressively outward
- Safety areas must be clear before transitions
### State Transition Controls
#### **Transition Validation**:
- All transitions verify safety conditions
- Selector positions confirmed before motor operations
- Area status checked before state changes
- Timeout protection prevents infinite loops
#### **Emergency Transitions**:
- Any state can return to IDLE on timeout
- Load/Unload requests can interrupt bypass operations
- Safety violations force immediate stops
#### **Completion Detection**:
```scl
// Loading completion
IF NOT #Area_Channel[#Channel].Status.Empty_End_Area THEN
#Status.Cycle_Step := #Next_Channel; // Move to next channel
END_IF;
// Unloading completion
IF #Area_Channel[#Channel].Status.Empty_Outfeed_Safety_Area THEN
#o_Unload_Finish := TRUE;
#Status.Cycle_Step := #Idle;
END_IF;
```
### Performance Optimization Features
#### **Parallel Operations**:
- Multiple channels can run simultaneously during loading
- Central channel operates independently when needed
- Input/output operations can overlap when safe
#### **Demand-Based Control**:
- Motors run only when bottles are present or space is available
- Output demand controls input feeding
- Accumulation sensors provide real-time feedback
#### **Format-Specific Logic**:
- Left/Right format handling with mirrored logic
- Channel selection based on bottle format
- Independent operation of format sides
This state machine architecture provides robust, efficient, and safe operation of the accumulation table system while maintaining flexibility for different operational scenarios.
### 3. Supporting Function Blocks
#### FB_DoserPair.scl
Manages paired dosing operations with:
- Motor synchronization between left and right feeders
- Speed coordination based on nominal values
- Enable/ready state management
#### FB_AreaTracker.scl
Provides bottle tracking capabilities:
- Virtual photocell simulation
- Bottle position tracking through conveyor areas
- Speed-based position calculation
#### FB_PositionAxis.scl
Handles positioning operations:
- Home sensor integration
- Position feedback management
- In-position status reporting
### 4. Data Management
#### DB_TransportStatus.scl
Central data structure containing:
- Format definitions (2 formats supported)
- HMI interface data
- Table status information
- Transport system status
- Divider and combiner status
#### Format Structure:
```scl
VAR
Formats : Array[0..1] of "Struct";
_00_HMI_Machine : "Struct";
_01_Table : "Struct";
_02_Transport : "Struct";
_03_Divider : "Struct";
_04_Combiner : "Struct";
END_VAR
```
## System Operation Modes
### 1. Bypass Mode
When no accumulation is required:
- Direct bottle routing through selected channels
- Minimal buffer usage
- Real-time format switching capability
### 2. Accumulation Mode
For format storage:
- Full channel utilization
- Sequential loading/unloading operations
- Format segregation management
### 3. Format Change Mode
During format transitions:
- Controlled emptying of accumulation areas
- Guide repositioning operations
- Safety zone clearance verification
## Communication Architecture
```plantuml
@startuml
package "TTOP Control System" {
[FC_Ttop_Run] as run
[FC_Ttop_Devices] as devices
[FB_AccumTable] as accum
[FB_Motors_Manage] as motors
[FC_Motor_Protocols] as protocols
[DB_TransportStatus] as db
run --> devices : Configure
run --> accum : Control
devices --> accum : Setup
accum --> motors : Commands
motors --> protocols : Communication
db <--> accum : Status Data
db <--> devices : Configuration
}
package "Motor Network" {
[M31610] as m1
[M31710] as m2
[U32810-U33610] as channels
[M31810] as guide1
[M34310] as guide2
}
protocols --> m1
protocols --> m2
protocols --> channels
protocols --> guide1
protocols --> guide2
@enduml
```
## Performance Characteristics
### Speed Parameters
- **Nominal Speed**: 1000 mm/sec at 50Hz
- **Speed Adjustment Range**: Configurable per motor
- **Synchronization Accuracy**: Real-time speed matching
### Capacity Management
- **Channel Count**: 9 independent channels
- **Channel Length**: 11,600 mm per channel
- **Safety Areas**: Configurable per zone
- **Format Switching Time**: Dependent on emptying cycle
## Safety Features
### Photocell Integration
- Input/output counting for bottle tracking
- Safety zone monitoring for personnel protection
- Accumulation limit enforcement
### Emergency Procedures
- Complete system stop capability
- Individual motor emergency stops
- Format change abort functionality
### Fault Detection
- Motor communication monitoring
- Position feedback verification
- Speed deviation detection
## Integration Points
### HMI Interface
- Format selection and status display
- Manual operation controls
- Diagnostic information access
- Alarm acknowledgment capabilities
### External Systems
- Divider interface integration
- Combiner coordination
- Upstream/downstream conveyor synchronization
## Maintenance Considerations
### Calibration Requirements
- Photocell positioning verification
- Speed reference validation
- Position accuracy confirmation
### Diagnostic Capabilities
- Motor status monitoring
- Communication health checks
- Performance trending data
### Service Access
- Individual component isolation
- Manual operation modes
- Bypass functionality for maintenance
## Technical Specifications
### Control Platform
- **PLC**: Siemens S7-1500 series
- **Programming Language**: SCL (Structured Control Language)
- **Optimization**: S7_Optimized_Access enabled
### Communication Protocols
- **PN (PROFINET)**: Primary communication
- **DP (PROFIBUS-DP)**: Legacy support
- **Analog**: Speed reference signals
### Performance Metrics
- **Cycle Time**: Optimized for real-time operation
- **Response Time**: Sub-second for format changes
- **Throughput**: Dependent on bottle size and gap parameters