Defect Mitigation for Robot Arm-based Additive Manufacturing Utilizing Intelligent Control and IOT