namespace IndustrialRoboticsControl

features
	RobotController {abstract}
		mandatory
			MainBoard {Model "MB-100", Cost 500, PowerUsage 12}
				or
					CPUCore {Type "LowEnd", Performance 5} {Cost 100, PowerUsage 4}
						mandatory
							CacheMemory {Size 16, Technology "SRAM"} {PowerUsage 0.5, Cost 10}
					CPUCore {Type "MidRange", Performance 10} {Cost 200, PowerUsage 8}
						mandatory
							CacheMemory {Size 32, Technology "SDRAM"} {PowerUsage 1, Cost 20}
					CPUCore {Type "HighEnd", Performance 20} {Cost 400, PowerUsage 16}
						mandatory
							CacheMemory {Size 64, Technology "DDR3"} {PowerUsage 2, Cost 50}
			SensorModule {Model "SM-800", Cost 150, PowerUsage 7}
				or
					CameraSensor {Resolution "HD", FieldOfView 120, Cost 60, PowerUsage 3} {Size 1kg, Weight 3}
						mandatory
							ImageProcessor {Type "LowEnd", Performance 2.5} {Cost 30, PowerUsage 2}
						optional
							LightingCorrection {Technology "LED", Efficiency 93} {Cost 20, PowerUsage 1}
					LaserSensor {Range 30, FieldOfView 100, Cost 45, PowerUsage 4} {Size 0.8kg, Weight 2}
						mandatory
							ImageProcessor {Type "MidRange", Performance 5.0} {Cost 60, PowerUsage 3}
						optional
							LightingCorrection {Technology "PWM", Efficiency 98} {Cost 15, PowerUsage 1}
					UltrasoundSensor {Range 5, FieldOfView 60, Cost 45, PowerUsage 2} {Size 0.5kg, Weight 1}
						mandatory
							ImageProcessor {Type "LowEnd", Performance 1.5} {Cost 25, PowerUsage 1}
			CommunicationModule {Model "CM-700", Cost 200, PowerUsage 8}
				or
					EthernetPort {Speed 1Gbps, Connector "RJ45", Cost 50, PowerUsage 2} {Size 0.3kg, Weight 1}
						mandatory
							QualityAssurance {Grade "High"}
					USBPort {Speed 12Mbps, Connector "TypeA", Cost 30, PowerUsage 2} {Size 0.1kg, Weight 0.5}
						mandatory
							QualityAssurance {Grade "Medium"}
					SerialPort {Speed 9600bps, Connector "DB-9", Cost 20, PowerUsage 1} {Size 0.2kg, Weight 0.8}
						mandatory
							QualityAssurance {Grade "Low"}
		optional
			BatteryPack {Capacity 24Ah, Voltage 24V, Weight 3.5kg, Cost 300} {PowerUsage 10}
				or
					LithiumIonCell {Chemistry "Li-ion", EnergyDensity 180Wh/kg, Capacity 24Ah, Voltage 24V, Weight 6kg, Cost 280} {DischargeRate 2C}
						mandatory
							TemperatureManagementSystem {Type "ThermalPaste"} {Cost 5, PowerUsage 1}
					LithiumPolymerCell {Chemistry "LiPo", EnergyDensity 250Wh/kg, Capacity 12Ah, Voltage 12V, Weight 3.5kg, Cost 340} {DischargeRate 3C}
						mandatory
							TemperatureManagementSystem {Type "HeatSink"} {Cost 10, PowerUsage 2}
			PowerSupplyUnit {Capacity 600W, InputVoltage "120-240V", Efficiency 87, Weight 4kg, Cost 100} {PowerFactor 0.95}
				mandatory
					FanModule {Speed 3000rpm, NoiseLevel 30dB} {Cost 30, PowerUsage 6W}
				optional
					OvercurrentProtection {Threshold 15A, ResponseTime "5ms"} {Cost 5, PowerUsage 1W}
			CoolingSystem {Type "Passive", Weight 2kg, Cost 50} {PowerUsage 0.5W}
				or
					FanCooling {Speed 4000rpm, NoiseLevel 35dB, Weight 2.5kg, Cost 60} {PowerUsage 8W}
						mandatory
							HeatSinkMaterial {Metallurgy "Aluminum"} {Cost 20, PowerUsage 1W}
			StorageModule {Type "SolidState", Capacity 128GB, Speed "PCIe Gen3x4", PowerUsage 7W, Weight 0.3kg, Cost 60} {Interface "M.2"}
				mandatory
					FirmwareVersion {Value "V5.0", ReleaseDate "2023-06-01"} {Cost 5, PowerUsage 0}
			ExpansionCardSlot {Connector "PCIe x1", Width 16mm, Height 150mm, PowerUsage 2W, Weight 0.2kg, Cost 40} {Interface "PCIe"}
				mandatory
					Compatibility {Devices "CameraSensor,LaserSensor,UltrasoundSensor"} {Cost 10, PowerUsage 0}
			WirelessModule {Standard "IEEE802.11ac", DataRate 1300Mbps, Range 50m, PowerUsage 2W, Weight 0.4kg, Cost 75} {Frequency "5GHz"}
				optional
					BandWidthExtender {Technology "Beamforming", RangeBoost 20m} {Cost 25, PowerUsage 1W}
			HardwareWatchdog {ResetDelay "100ms", RecoveryTime "3s", PowerUsage 0.5W, Weight 0.1kg, Cost 25} {Interface "I2C"}
				mandatory
					FaultDetectionLevel {Type "Comprehensive"} {Cost 5, PowerUsage 0}
			RealTimeClockModule {BatteryType "SRAM", TimeSyncAccuracy "10us", PowerUsage 0.2W, Weight 0.3kg, Cost 40} {Interface "SPI"}
				mandatory
					SynchronizationSource {Protocol "NTP"} {Cost 5, PowerUsage 0}
	MotionControlSubsystem {abstract}
		or
			XAxisControl {Model "MCX-500", Precision 1mm, TravelRange 500mm, PowerUsage 8W, Weight 2kg, Cost 450} {ControlAlgorithm "PID"}
				mandatory
					ServoMotor {Torque 3Nm, MaxSpeed 1000rpm, PowerUsage 8W, Weight 0.7kg, Cost 150} {StatorMaterial "Copper"}
					EncoderInterface {Resolution 1600PPI, Connectivity "RS-232"} {Cost 50, PowerUsage 2}
				optional
					LimitSwitches {Number 4, Type "Mechanical", Reversibility "Bidirectional"} {Cost 20, PowerUsage 0.5}
			YAxisControl {Model "MCY-600", Precision 1mm, TravelRange 600mm, PowerUsage 8W, Weight 2.5kg, Cost 500} {ControlAlgorithm "PI"}
				mandatory
					ServoMotor {Torque 4Nm, MaxSpeed 1200rpm, PowerUsage 10W, Weight 1kg, Cost 200} {StatorMaterial "Copper"}
					EncoderInterface {Resolution 1600PPI, Connectivity "USB"} {Cost 50, PowerUsage 3}
				optional
					LimitSwitches {Number 4, Type "Mechanical", Reversibility "Bidirectional"} {Cost 20, PowerUsage 0.5}
			ZAxisControl {Model "MCZ-700", Precision 1mm, TravelRange 700mm, PowerUsage 8W, Weight 3kg, Cost 550} {ControlAlgorithm "PID"}
				mandatory
					ServoMotor {Torque 5Nm, MaxSpeed 1400rpm, PowerUsage 12W, Weight 1.3kg, Cost 300} {StatorMaterial "Copper"}
					EncoderInterface {Resolution 1600PPI, Connectivity "Ethernet"} {Cost 60, PowerUsage 5}
				optional
					LimitSwitches {Number 4, Type "Mechanical", Reversibility "Bidirectional"} {Cost 20, PowerUsage 0.5}
			RotaryAxisControl {Model "MCRA-800", Precision 0.01deg, TravelRange 360deg, PowerUsage 5W, Weight 2kg, Cost 500} {ControlAlgorithm "PI"}
				mandatory
					ServoMotor {Torque 2Nm, MaxSpeed 400rpm, PowerUsage 6W, Weight 1kg, Cost 250} {StatorMaterial "Copper"}
					EncoderInterface {Resolution 3200PPI, Connectivity "USB"} {Cost 70, PowerUsage 3}
				optional
					LimitSwitches {Number 2, Type "Optical", Reversibility "Bidirectional"} {Cost 15, PowerUsage 0.5}
			SecondRotaryAxisControl {Model "MCRB-900", Precision 0.01deg, TravelRange 360deg, PowerUsage 5W, Weight 2kg, Cost 400} {ControlAlgorithm "PID"}
				mandatory
					ServoMotor {Torque 1Nm, MaxSpeed 200rpm, PowerUsage 4W, Weight 0.7kg, Cost 120} {StatorMaterial "Copper"}
					EncoderInterface {Resolution 3200PPI, Connectivity "Ethernet"} {Cost 65, PowerUsage 3}
				optional
					LimitSwitches {Number 2, Type "Optical", Reversibility "Bidirectional"} {Cost 15, PowerUsage 0.5}
	SensorIntegrationSubsystem {abstract}
		or
			ObjectDetectionSensor {Model "ODS-200", Range 5m, Resolution "4k", PowerUsage 8W, Weight 1kg, Cost 300} {ResolutionX 4096, ResolutionY 2160}
				mandatory
					ImageProcessor {Type "MidRange", Performance 5.0} {Cost 75, PowerUsage 4}
				optional
					LightingCorrection {Technology "PWM", Efficiency 98} {Cost 30, PowerUsage 2}
			GroundContactSensor {Model "GCS-300", Range 20cm, PowerUsage 1W, Weight 0.5kg, Cost 50} {Sensitivity 5N}
				mandatory
					SensitivityLevel {Threshold 0.5N, Sensitivity "High"} {Cost 10, PowerUsage 1}
			ForceTorqueSensor {Model "FTS-400", ForceRange 30N, TorqueRange 2Nm, PowerUsage 6W, Weight 1kg, Cost 400} {ResolutionForce 0.01N, ResolutionTorque 0.002Nm}
				mandatory
					MeasurementResolution {ForceResolution 0.01N, TorqueResolution 0.002Nm} {Cost 150, PowerUsage 6}
			ProximitySensor {Model "PS-500", Range 1m, PowerUsage 2W, Weight 0.3kg, Cost 70} {Sensitivity 0.01mm}
				mandatory
					SensitivityLevel {Threshold 0.01mm, Sensitivity "Medium"} {Cost 10, PowerUsage 2}
	RobotArmAssembly {abstract}
		or
			RoboticJointA {Model "RAJ-600", JointType "Revolute", DegreesOfFreedom "6DOF", PowerUsage 25W, Weight 5kg, Cost 800} {GearRatio 10}
				mandatory
					MotorUnit {Torque 10Nm, MaxSpeed 300rpm, PowerUsage 20W, Weight 2kg, Cost 300} {StatorMaterial "Copper"}
				optional
					GearReductionSystem {Ratio "1:10", Efficiency 95} {Cost 80, PowerUsage 5}
			RoboticJointB {Model "RAJ-700", JointType "Revolute", DegreesOfFreedom "6DOF", PowerUsage 25W, Weight 5kg, Cost 800} {GearRatio 12}
				mandatory
					MotorUnit {Torque 15Nm, MaxSpeed 350rpm, PowerUsage 22W, Weight 2.5kg, Cost 400} {StatorMaterial "Copper"}
				optional
					GearReductionSystem {Ratio "1:10", Efficiency 98} {Cost 100, PowerUsage 6}
			RoboticJointC {Model "RAJ-800", JointType "Revolute", DegreesOfFreedom "6DOF", PowerUsage 25W, Weight 5kg, Cost 800} {GearRatio 14}
				mandatory
					MotorUnit {Torque 20Nm, MaxSpeed 400rpm, PowerUsage 24W, Weight 3kg, Cost 500} {StatorMaterial "Copper"}
				optional
					GearReductionSystem {Ratio "1:10", Efficiency 96} {Cost 85, PowerUsage 5.5}
			RoboticJointD {Model "RAJ-900", JointType "Revolute", DegreesOfFreedom "6DOF", PowerUsage 25W, Weight 5kg, Cost 800} {GearRatio 13}
				mandatory
					MotorUnit {Torque 15Nm, MaxSpeed 320rpm, PowerUsage 22W, Weight 2.5kg, Cost 400} {StatorMaterial "Copper"}
				optional
					GearReductionSystem {Ratio "1:10", Efficiency 98} {Cost 100, PowerUsage 6}
			EndEffectorAssembly {Model "REE-1000", EndEffectorType "Gripper", DegreesOfFreedom "6DOF", PowerUsage 25W, Weight 4kg, Cost 700} {JawLength 10mm}
				mandatory
					GripMechanism {ActuatorType "Pneumatic", ForceRange 5N, Stroke 20mm, PowerUsage 10W, Weight 1.5kg, Cost 300} {Material "Steel"}
					ForceFeedbackSensor {Type "LoadCell", Range 40N, PowerUsage 6W, Weight 1kg, Cost 300} {ResolutionForce 0.01N}
constraints
	MainBoard.Cost + SensorModule.Cost < CommunicationModule.Cost + BatteryPack.Cost
	CameraSensor.Range * CameraSensor.ResolutionX > LaserSensor.Range * LaserSensor.FieldOfView
	LaserSensor.Connectivity == "USB" => LaserSensor.QualityAssurance.Grade != "High"
	SerialPort.Speed * EthernetPort.Speed < WirelessModule.BandWidthExtender.RangeBoost
	YAxisControl.Precision + XAxisControl.Precision <= ZAxisControl.TravelRange / 1000
	ServoMotor.MaxSpeed >= EncoderInterface.Resolution / 100
	WirelessModule.Standard =~ /^IEEE802\.11/
	ObjectDetectionSensor.Model =~ /^ODS/
	GroundContactSensor.FieldOfView <= CameraSensor.ResolutionX * 100
	EndEffectorAssembly.JawLength + ForceFeedbackSensor.Range >= SensorIntegrationSubsystem.ForceTorqueSensor.TorqueRange * 2
	SerialPort.QualityAssurance.Grade < USBPort.QualityAssurance.Grade
	LithiumIonCell.Capacity * LithiumPolymerCell.EnergyDensity >= 4320
	BatteryPack.Voltage <= WirelessModule.Range / 5 + RealTimeClockModule.TimeSyncAccuracy * 1000
	USBPort.Connector == "TypeA" => QualityAssurance.Grade != "High"
	SerialPort.Speed < USBPort.Speed
	LithiumPolymerCell.Capacity * LithiumPolymerCell.Voltage <= 480
	MotionControlSubsystem.ControlAlgorithm =~ /^(PID|PI)$/
	ServoMotor.MaxSpeed * MainBoard.PowerUsage >= 100PPIrpm
	PowerSupplyUnit.Capacity / WirelessModule.DataRate > BatteryPack.Weight / 2
	LimitSwitches.Type =~ /^Mechanical|Optical$/
	SecondRotaryAxisControl.Model =~ /^MCR/
	XAxisControl.Model =~ /^MCX/
	EthernetPort.Connector == "RJ45" => EthernetPort.QualityAssurance.Grade <= "Medium"
	ServoMotor.PowerUsage + EncoderInterface.PowerUsage > 7W
	HardwareWatchdog.ResetDelay < HardwareWatchdog.RecoveryTime / 10
	LimitSwitches.Number != GearReductionSystem.Ratio / 10
	ForceTorqueSensor.ForceRange * ForceTorqueSensor.TorqueRange >= 60NmN
	SensorModule.Weight <= CoolingSystem.Cost * 10
	SerialPort.Model =~ /^SP/
	CameraSensor.ResolutionX + CameraSensor.ResolutionY > ProximitySensor.SensitivityLevel.Threshold * 2
	LimitSwitches.Reversibility =~ /^Bidirectional|Unidirectional$/
	CameraSensor.ImageProcessor.Performance * CameraSensor.FieldOfView >= 360
	ObjectDetectionSensor.Range + UltraSoundSensor.Range > LaserSensor.FieldOfView / 2
	CoolingSystem.NoiseLevel <= FanCooling.Speed * 1e-5
	RealTimeClockModule.SyncAccuracy <= TimeSyncAccuracy / 2
	ServoMotor.Torque * PowerSupplyUnit.Efficiency >= MotorUnit.MaxSpeed / 100
	EthernetPort.Connector != USBPort.Connector
	LimitSwitches.FieldOfView <= CameraSensor.ResolutionX * SensorIntegrationSubsystem.GroundContactSensor.SensitivityLevel.Threshold
	FanModule.Model =~ /^FM/
	SerialPort.QualityAssurance.Grade < USBPort.QualityAssurance.Grade
	RealTimeClockModule.BatteryType == RobotController.CoolingSystem.Metallurgy
	XAxisControl.DegreeOfFreedom + YAxisControl.DegreeOfFreedom >= 6DOF
	EndEffectorAssembly.ActuatorType =~ /^Pneumatic|Hydraulic$/
	ServoMotor.Speed > MotorUnit.MaxSpeed / 2
	CameraSensor.Connector != USBPort.Connector
	CameraSensor.Model == LaserSensor.Model => SensorIntegrationSubsystem.ObjectDetectionSensor.SensorType != RobotController.RealTimeClockModule.FirmwareVersion.Value
	MainBoard.Connectivity == EthernetPort.Connectivity
	SerialPort.Connector =~ /^DB/
	StorageModule.Speed / CoolingSystem.NoiseLevel > WirelessModule.RangeBoost * 10
	LimitSwitches.Type == "Mechanical" => LimitSwitches.Reversibility != "Unidirectional"
	XAxisControl.TravelRange + CameraSensor.FieldOfView < RobotController.WirelessModule.Range - SensorIntegrationSubsystem.ForceTorqueSensor.TorqueResolution
	SerialPort.Connector =~ /^DB/
	SerialPort.QualityAssurance.Grade < USBPort.QualityAssurance.Grade
	ServoMotor.MaxSpeed * EncoderInterface.Resolution >= 300PPIrpm
	LimitSwitches.FieldOfView <= CameraSensor.ResolutionX * SensorIntegrationSubsystem.GroundContactSensor.SensitivityLevel.Threshold
	EndEffectorAssembly.ActuatorType =~ /^Pneumatic|Hydraulic$/
	SerialPort.Connector =~ /^DB/
	EndEffectorAssembly.JawLength + ForceFeedbackSensor.Range >= SensorIntegrationSubsystem.ForceTorqueSensor.TorqueRange * 2
	LimitSwitches.Type != "Photoelectric" => LimitSwitches.Reversibility == "Bidirectional"
	ServoMotor.MaxSpeed <= MotorUnit.PowerUsage * 10
	MaxSpeed * SensorRange > PowerUsage / 10
	RoboticJointD.Torque * RoboticJointD.MotorUnit.Efficiency <= 75Nm
	CameraSensor.Model =~ /^CS/
	LimitSwitches.Type != "Photoelectric" => LimitSwitches.Reversibility == "Bidirectional"
	ServoMotor.MaxSpeed <= MotorUnit.PowerUsage * 10
	XAxisControl.DegreeOfFreedom + YAxisControl.DegreeOfFreedom >= 6DOF
	EndEffectorAssembly.JawLength <= CameraSensor.ResolutionX * SensorIntegrationSubsystem.ProximitySensor.SensitivityLevel.Threshold
	SerialPort.Connector =~ /^DB/
	FanModule.Model != GearReductionSystem.Model
	CameraSensor.FieldOfView + LaserSensor.FieldOfView > 200
	ImageProcessor.Connector == "USB" => ImageProcessor.QualityAssurance.Grade != "High"
	SerialPort.Connector =~ /^DB/
	MotorUnit.MaxSpeed / JointType == DegreesOfFreedom
	LimitSwitches.Type != "Photoelectric" => LimitSwitches.Reversibility == "Bidirectional"
	MaxSpeed * SensorRange > PowerUsage / 10
	RoboticJointD.Torque * RoboticJointD.MotorUnit.Efficiency <= 50Nm
	CameraSensor.Model =~ /^CS/
	LimitSwitches.Type != "Photoelectric" => LimitSwitches.Reversibility == "Bidirectional"
	ServoMotor.MaxSpeed <= MotorUnit.PowerUsage * 10
	XAxisControl.DegreeOfFreedom + YAxisControl.DegreeOfFreedom >= 6DOF
	MotorUnit.Torque / JointType > Speed / 2
	MainBoard.Connectivity == EthernetPort.Connectivity
	RoboticJointD.Model =~ /^RAJ/
	LimitSwitches.FieldOfView <= CameraSensor.Resolution * 100
	SerialPort.QualityAssurance.Grade < USBPort.QualityAssurance.Grade
	CameraSensor.Connector != USBPort.Connector