Skip to content

Commit cc6f5ef

Browse files
authored
Merge pull request #28 from OpenSourceEcology/copilot/add-different-flow-valve-options
Add dual proportional flow valve configuration support with hardware jumper selection
2 parents b45223c + 963682f commit cc6f5ef

File tree

7 files changed

+1273
-51
lines changed

7 files changed

+1273
-51
lines changed
Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
# LifeTrac v25 - Flow Valve Configuration Feature
2+
3+
## Overview
4+
5+
Added support for two different proportional flow valve configurations to the LifeTrac v25:
6+
- **Option 1 (Default)**: Single valve controls all hydraulics
7+
- **Option 2 (Advanced)**: Dual valves for independent left/right control
8+
9+
This feature addresses the need for more advanced maneuvering capabilities while maintaining backward compatibility with existing single valve systems.
10+
11+
## Changes Made
12+
13+
### Code Changes (`arduino_opta_controller/lifetrac_v25_controller.ino`)
14+
15+
#### 1. New Pin Definitions
16+
- Added `FLOW_CONTROL_PIN_1` (O2) - Primary flow valve (replaces old FLOW_CONTROL_PIN)
17+
- Added `FLOW_CONTROL_PIN_2` (O3) - Secondary flow valve for dual valve configuration
18+
- Added `FLOW_CONFIG_JUMPER_PIN` (D11) - Jumper detection for configuration selection
19+
20+
#### 2. New Configuration System
21+
- Added `FlowValveConfig` enum with `ONE_VALVE` and `TWO_VALVES` modes
22+
- Added `flowConfig` global variable (defaults to `ONE_VALVE`)
23+
- Added `readFlowValveConfig()` function to detect jumper at startup
24+
25+
#### 3. Modified Functions
26+
27+
**`setup()`:**
28+
- Added initialization of D11 as INPUT_PULLUP for jumper detection
29+
- Added initialization of O3 analog output for second flow valve
30+
- Added call to `readFlowValveConfig()` before mode switch detection
31+
32+
**`setFlowControl()`:**
33+
- Complete rewrite to support both configurations
34+
- **Single valve mode**: Uses minimum non-zero absolute value of all joystick inputs (flow limiting strategy)
35+
- **Dual valve mode**:
36+
- Calculates actual left and right track speeds
37+
- Valve 1 flow based on: left track speed + arms
38+
- Valve 2 flow based on: right track speed + bucket
39+
- Enables independent speed control for advanced maneuvering
40+
41+
**`stopAllMovement()`:**
42+
- Updated to stop both flow valves (set both O2 and O3 to 4mA)
43+
44+
#### 4. Header Comments
45+
- Updated hardware list to show "1-2x Proportional Flow Control Valves (configurable)"
46+
- Added flow valve configuration documentation to file header
47+
48+
### Documentation Changes
49+
50+
#### 1. New Files
51+
- **FLOW_VALVE_CONFIGURATION.md** (12KB): Comprehensive guide covering:
52+
- Hardware configuration and wiring
53+
- Control behavior differences
54+
- Installation instructions for both configurations
55+
- Detailed example scenarios
56+
- Hydraulic circuit modifications
57+
- Additional hardware requirements
58+
- Advantages/disadvantages comparison
59+
- Troubleshooting guide
60+
- Testing procedures
61+
- Safety considerations
62+
63+
- **QUICK_REFERENCE_FLOW_VALVES.md** (2KB): Quick reference for:
64+
- Decision guide (which configuration to choose)
65+
- Quick setup steps
66+
- Hardware jumper location diagram
67+
- Quick troubleshooting
68+
- Cost comparison
69+
70+
- **CHANGELOG_FLOW_VALVES.md** (this file): Complete change summary
71+
72+
#### 2. Updated Files
73+
74+
**README.md:**
75+
- Added "Configurable Flow Control" to features list
76+
- Updated hardware BOM to show "1-2x" flow control valves
77+
- Added reference to FLOW_VALVE_CONFIGURATION.md in documentation section
78+
79+
**WIRING_DIAGRAM.md:**
80+
- Added D11 to Digital I/O Extension connections table
81+
- Added flow valve configuration jumper logic description
82+
- Split Analog Extension section into two diagrams:
83+
- Single Valve Configuration (default)
84+
- Dual Valve Configuration (jumper installed)
85+
- Added clear indication of which outputs are used in each mode
86+
87+
## Hardware Requirements
88+
89+
### Base Configuration (Single Valve - Default)
90+
- Arduino Opta WiFi
91+
- Arduino Pro Opta Ext D1608S (Digital I/O extension)
92+
- Arduino Pro Opta Ext A0602 (Analog extension)
93+
- 1x Brand Hydraulics EFC Proportional Flow Control Valve
94+
- 1x Burkert 8605 Type 316532 Flow Valve Controller
95+
96+
### Advanced Configuration (Dual Valve)
97+
**Additional hardware needed:**
98+
- 1x Additional Brand Hydraulics EFC Proportional Flow Control Valve
99+
- 1x Additional Burkert 8605 Type 316532 Flow Valve Controller
100+
- Hydraulic flow splitter
101+
- Additional hydraulic distribution manifold
102+
- 1x Jumper wire or 2.54mm jumper (to connect D11 to GND)
103+
- Additional hydraulic hoses and fittings
104+
105+
**Estimated additional cost:** $1000-1500 USD
106+
107+
## Configuration Selection
108+
109+
### Default (Single Valve)
110+
- Leave D11 pin disconnected (no jumper)
111+
- System reads D11=HIGH (internal pullup)
112+
- Controller operates in ONE_VALVE mode
113+
- Serial output: "ONE_VALVE (Single valve for all)"
114+
115+
### Advanced (Dual Valve)
116+
- Install jumper connecting D11 to GND
117+
- System reads D11=LOW
118+
- Controller operates in TWO_VALVES mode
119+
- Serial output: "TWO_VALVES (Valve 1: left+arms, Valve 2: right+bucket)"
120+
121+
## Behavior Differences
122+
123+
### Single Valve Mode
124+
- All hydraulic functions (left track, right track, arms, bucket) share one flow rate
125+
- Flow rate determined by the minimum non-zero joystick input across all axes
126+
- Simple turning: can drive forward on one side while stopping the other
127+
- Speed limited by the lowest non-zero demand movement
128+
- Adequate for most operations
129+
130+
### Dual Valve Mode
131+
- Independent flow rates for left side (left track + arms) and right side (right track + bucket)
132+
- Each side can operate at different speeds simultaneously
133+
- Advanced turning capabilities:
134+
- Variable-radius turns with smooth speed differential
135+
- Zero-radius turning (spin in place with tracks running opposite directions)
136+
- More precise maneuvering in tight spaces
137+
- Better control for complex movements
138+
139+
### Example: Zero-Radius Turn
140+
This demonstrates the key advantage of dual valve mode:
141+
142+
**Joystick Input:** Left Y=0, Left X=1.0 (full right turn, no forward/backward)
143+
144+
**Single Valve Mode:**
145+
- Left track: forward at full speed
146+
- Right track: backward at full speed
147+
- But: Both limited by single flow valve at 20mA
148+
- Result: Spin in place, but flow may be insufficient for both tracks
149+
150+
**Dual Valve Mode:**
151+
- Left track: forward at full speed (Valve 1: 20mA)
152+
- Right track: backward at full speed (Valve 2: 20mA)
153+
- Independent flow valves provide full flow to each side
154+
- Result: Smooth, powerful zero-radius turn
155+
156+
## Backward Compatibility
157+
158+
**Fully backward compatible** with existing single valve installations:
159+
- Default configuration is ONE_VALVE mode (no jumper required)
160+
- Single valve systems work exactly as before
161+
- No code changes required for existing installations
162+
- Simply upload new firmware to get configuration capability
163+
164+
## Testing Status
165+
166+
⚠️ **Hardware testing required**
167+
- Code changes are complete and syntactically correct
168+
- Logic has been verified
169+
- Requires testing on actual hardware:
170+
- Single valve configuration (default)
171+
- Dual valve configuration (with jumper)
172+
- Mode switching between configurations
173+
- Flow valve response verification
174+
- Maneuvering capability testing
175+
176+
## Migration Guide
177+
178+
### For Existing Single Valve Systems
179+
1. Upload new firmware to Arduino Opta
180+
2. No hardware changes needed
181+
3. System will automatically detect ONE_VALVE configuration
182+
4. Verify serial output shows correct configuration
183+
5. Test system operation (should be identical to before)
184+
185+
### To Upgrade to Dual Valve System
186+
1. Install second Brand Hydraulics EFC valve and Burkert controller
187+
2. Wire second controller to Arduino Opta O3 output
188+
3. Modify hydraulic circuit to split flow:
189+
- Valve 1 → Left track + Arms
190+
- Valve 2 → Right track + Bucket
191+
4. Install jumper connecting D11 to GND on Arduino Opta
192+
5. Power on system
193+
6. Verify serial output shows "TWO_VALVES" configuration
194+
7. Test all movements and turning capabilities
195+
196+
## Safety Notes
197+
198+
⚠️ **Important Safety Considerations:**
199+
- Test new configuration in safe, open area
200+
- Start with slow movements to verify correct operation
201+
- Ensure all personnel are clear during testing
202+
- Have emergency stop readily accessible
203+
- Consult qualified hydraulic technician for installation
204+
- Zero-radius turning in dual valve mode is powerful - use with caution
205+
- Follow all manufacturer safety guidelines
206+
207+
## Future Enhancements
208+
209+
Possible future improvements:
210+
- Add flow rate adjustment via MQTT/BLE commands
211+
- Implement different control modes (tank steering vs direct wheel control)
212+
- Add flow rate status reporting
213+
- Support for more than two valves
214+
- Configurable valve groupings
215+
216+
## Technical Details
217+
218+
### Pin Usage
219+
| Pin | Function | Single Valve | Dual Valve |
220+
|-----|----------|--------------|------------|
221+
| D11 | Config Jumper | HIGH (no jumper) | LOW (jumper to GND) |
222+
| O2 | Flow Valve 1 | Active (all hydraulics) | Active (left + arms) |
223+
| O3 | Flow Valve 2 | Inactive (4mA) | Active (right + bucket) |
224+
225+
### Flow Control Ranges
226+
- No input: 4 mA (no flow)
227+
- Minimum movement: 6 mA (~12.5% flow)
228+
- Half input: 12 mA (50% flow)
229+
- Maximum input: 20 mA (100% flow)
230+
231+
### Startup Sequence
232+
1. Initialize hardware pins
233+
2. Wait 1 second for stabilization
234+
3. Read D11 jumper state → determine flow configuration
235+
4. Read D9 mode switch → determine control mode (BLE/MQTT)
236+
5. Initialize appropriate services
237+
6. Begin normal operation
238+
239+
## References
240+
241+
- **Issue**: Different Proportional Flow Valve Options
242+
- **Pull Request**: [Link to be added]
243+
- **Documentation**:
244+
- FLOW_VALVE_CONFIGURATION.md (comprehensive guide)
245+
- QUICK_REFERENCE_FLOW_VALVES.md (quick reference)
246+
- WIRING_DIAGRAM.md (updated with dual valve wiring)
247+
248+
## Contributors
249+
250+
- Implementation: GitHub Copilot
251+
- Issue Reporter: [Original issue author]
252+
- Testing: [To be added after hardware testing]
253+
254+
---
255+
256+
**Version:** 1.0
257+
**Date:** 2024
258+
**Status:** Code complete, hardware testing pending

0 commit comments

Comments
 (0)