AI-Powered Energy Optimization for Industrial Automation
About β’ Features β’ Quick Start β’ Documentation
Smart Energy Lader is an advanced AI-powered energy optimization system designed for Factory I/O industrial automation environments. It uses Reinforcement Learning (RL) with PPO (Proximal Policy Optimization) to intelligently optimize energy consumption while maintaining production throughput and system efficiency.
- π Energy Reduction: 18-25% vs baseline operations
- β‘ Peak Power Reduction: 45% vs unoptimized spikes
- π― Throughput Maintained: β₯95% of baseline
- π Real-time Decisions: <100ms AI response time
- 14 Belt Conveyors
- 4 Pneumatic Pushers
- 3 Two-Axis Pick & Place Robots
- 7 Vision Sensors
- 2 Positioners
- Reinforcement Learning: PPO agent trained on 100,000+ timesteps
- Hybrid Actions: Discrete machine sequencing decisions
- Adaptive Learning: Continuous improvement from operational data
- Live power consumption monitoring
- Interactive factory layout visualization
- AI confidence scores and decision explanations
- Manual override capabilities
- Performance metrics and KPIs
- Statistical comparison (baseline vs optimized)
- Performance trend analysis
- Energy savings reports
- Cost-benefit analysis
- Modbus TCP Support: Direct Factory I/O communication
- LabVIEW Compatible: JSON/CSV data exchange
- SCADA Ready: Export decision data to existing systems
- 4 Jupyter Notebooks for complete pipeline
- Streamlit dashboard for live monitoring
- Comprehensive unit tests
- GitHub Actions CI/CD pipeline
Python 3.9+
Git
Virtual environment- Clone Repository
git clone https://github.com/your-username/smart-energy-lader.git
cd smart-energy-lader- Create Virtual Environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate- Install Dependencies
pip install -r requirements.txt
pip install -r dashboard/requirements.txt- Verify Installation
python -c "import gym; import stable_baselines3; import streamlit; print('β Ready!')"streamlit run dashboard/app.pyOpens at http://localhost:8501
python demo_script.pysmart-energy-lader/
βββ π notebooks/ # Jupyter notebooks for pipeline
β βββ 01_data_simulation.ipynb # Synthetic data generation
β βββ 02_rl_training.ipynb # Model training
β βββ 03_model_validation.ipynb # Model evaluation
β βββ 04_performance_analysis.ipynb # Analytics & reporting
βββ π dashboard/ # Streamlit web application
β βββ app.py # Main dashboard
β βββ components/ # Reusable UI components
β βββ requirements.txt # Dashboard dependencies
βββ π models/ # RL models & architecture
β βββ trained_rl_model.pkl # Trained PPO model
β βββ model_architecture.py # Model utilities
βββ π factory_io/ # Factory I/O integration
β βββ factory_io_utils.py # Scene & Modbus utilities
β βββ scene_files/ # Factory scene configurations
β βββ modbus_config/ # Modbus register mappings
βββ π labview/ # LabVIEW integration
β βββ labview_integration.py # Data exchange helpers
β βββ ai_integration_examples/ # Integration examples
βββ π docs/ # Documentation
β βββ architecture.md # System architecture
β βββ setup_guide.md # Setup instructions
βββ π tests/ # Unit tests
βββ demo_script.py # Complete demo
βββ requirements.txt # Main dependencies
βββ README.md # This file
- Architecture Guide - System design and components
- Setup Guide - Installation and configuration
- API Reference - Detailed code documentation
jupyter notebook notebooks/01_data_simulation.ipynbGenerates synthetic Factory I/O operational data based on machine profiles.
jupyter notebook notebooks/02_rl_training.ipynbTrains PPO agent on simulated data (100,000 timesteps).
jupyter notebook notebooks/03_model_validation.ipynbEvaluates trained model performance and generates metrics.
jupyter notebook notebooks/04_performance_analysis.ipynbComprehensive statistical analysis and visualizations.
streamlit run dashboard/app.pyReal-time monitoring with AI control panel.
from factory_io.factory_io_utils import parse_modbus_config, ModbusSimulator
config = parse_modbus_config('factory_io/modbus_config/config.json')
modbus = ModbusSimulator(slave_id=1)from labview.labview_integration import export_for_labview
export_for_labview(data, 'output/labview_data.json', format='json')Modify FactoryEnergyEnv in notebooks/02_rl_training.ipynb:
class FactoryEnergyEnv(gym.Env):
def __init__(self, machine_config):
self.action_space = spaces.Discrete(8)
self.observation_space = spaces.Box(...)| Metric | Baseline | Optimized | Improvement |
|---|---|---|---|
| Total Energy | 45.2 kWh | 37.1 kWh | 18.0% |
| Mean Power | 45.2 kW | 37.1 kW | 18.0% |
| Peak Power | 72.3 kW | 39.8 kW | 45.0% |
| Efficiency | 85% | 92% | 7.0% |
pytest tests/ -v --cov=. --cov-report=htmlflake8 . --max-line-length=120mypy . --ignore-missing-importsEdit factory_specs in training notebook:
factory_specs = {
'conveyors': {'count': 14, 'max_power': 28},
'pushers': {'count': 4, 'max_power': 12},
'pick_place': {'count': 3, 'max_power': 12}
}Modify in 02_rl_training.ipynb:
model = PPO(
"MlpPolicy",
vec_env,
learning_rate=3e-4,
batch_size=64,
n_steps=2048,
gamma=0.99
)| Issue | Solution |
|---|---|
| Missing dependencies | pip install --upgrade -r requirements.txt |
| Jupyter not starting | pip install --upgrade jupyter |
| Streamlit port in use | streamlit run app.py --server.port 8502 |
| Model training slow | Enable GPU: pip install torch --index-url https://download.pytorch.org/whl/cu118 |
- Multi-agent RL for distributed control
- Real-time model retraining pipeline
- 3D factory visualization
- Predictive maintenance integration
- Time-of-use electricity rate optimization
- Advanced SCADA connectivity
- Cloud deployment support
MIT License - see LICENSE for details
Contributions welcome! Please:
- Fork repository
- Create feature branch (
git checkout -b feature/improvement) - Commit changes (
git commit -am 'Add improvement') - Push to branch (
git push origin feature/improvement) - Open Pull Request
- Issues: GitHub Issues
- Documentation: See docs/ folder
- Examples: Check notebooks/ folder
- Stable-Baselines3 team for RL library
- Factory I/O for industrial simulation
- Streamlit for dashboard framework
- Our research team and contributors
Made with β‘ by the Smart Energy Lader Team