aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/FiberShapesViewVM.cs
blob: cc2754cf2c8fe916239808cc309f389e44eb78d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.MachineStudio.Common.Notifications;

namespace Tango.MachineStudio.DB.ViewModels
{
    public class FiberShapesViewVM : DbTableViewModel<FiberShape>
    {
        public FiberShapesViewVM(INotificationProvider notification) : base(notification)
        {
        }
    }
}
using System;
using System.Text;
using System.Linq;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using Tango.PMR.Hardware;
using Tango.PMR.Printing;
using Tango.PMR.Stubs;
using Tango.Stubs.UI;

HardwarePidControl FeederPidControl = new HardwarePidControl();
FeederPidControl.HardwarePidControlType = Tango.PMR.Hardware.HardwarePidControlType.MotorFeeder;
FeederPidControl.OutputProportionalPowerLimit = 80;
FeederPidControl.OutputProportionalBand = 5;
FeederPidControl.IntegralTime = 5;
FeederPidControl.DerivativeTime = 0;
FeederPidControl.SensorCorrectionAdjustment = 0;
FeederPidControl.SensorMinValue = 0;
FeederPidControl.SensorMaxValue = 0;
FeederPidControl.SetPointRampRateorSoftStartRamp = 0;
FeederPidControl.SetPointControlOutputRate = 4;
FeederPidControl.ControlOutputType = 0;
FeederPidControl.SsrControlOutputType = 0;
FeederPidControl.OutputOnOffHysteresisValue = 0;
FeederPidControl.ProcessVariableSamplingRate = 1000;
FeederPidControl.PvInputFilterFactorMode = 4;
FeederPidControl.OutputProportionalCycleTime = 0;
FeederPidControl.AcHeatersHalfCycleTime = 0;
FeederPidControl.ProportionalGain = 11.0;


HardwarePidControl PoolerPidControl = new HardwarePidControl();
PoolerPidControl.HardwarePidControlType = Tango.PMR.Hardware.HardwarePidControlType.MotorPooler;
PoolerPidControl.OutputProportionalPowerLimit = 80;
PoolerPidControl.OutputProportionalBand = 5;
PoolerPidControl.IntegralTime = 5;
PoolerPidControl.DerivativeTime = 0;
PoolerPidControl.SensorCorrectionAdjustment = 0;
PoolerPidControl.SensorMinValue = 0;
PoolerPidControl.SensorMaxValue = 0;
PoolerPidControl.SetPointRampRateorSoftStartRamp = 0;
PoolerPidControl.SetPointControlOutputRate = 4;
PoolerPidControl.ControlOutputType = 0;
PoolerPidControl.SsrControlOutputType = 0;
PoolerPidControl.OutputOnOffHysteresisValue = 0;
PoolerPidControl.ProcessVariableSamplingRate = 1000;
PoolerPidControl.PvInputFilterFactorMode = 4;
PoolerPidControl.OutputProportionalCycleTime = 0;
PoolerPidControl.AcHeatersHalfCycleTime = 0;
PoolerPidControl.ProportionalGain = 11.0;


HardwarePidControl WinderPidControl = new HardwarePidControl();
WinderPidControl.HardwarePidControlType = Tango.PMR.Hardware.HardwarePidControlType.MotorWinder;
WinderPidControl.OutputProportionalPowerLimit = 80;
WinderPidControl.OutputProportionalBand = 5;
WinderPidControl.IntegralTime = 5;
WinderPidControl.DerivativeTime = 0;
WinderPidControl.SensorCorrectionAdjustment = 0;
WinderPidControl.SensorMinValue = 0;
WinderPidControl.SensorMaxValue = 0;
WinderPidControl.SetPointRampRateorSoftStartRamp = 0;
WinderPidControl.SetPointControlOutputRate = 4;
WinderPidControl.ControlOutputType = 0;
WinderPidControl.SsrControlOutputType = 0;
WinderPidControl.OutputOnOffHysteresisValue = 0;
WinderPidControl.ProcessVariableSamplingRate = 1000;
WinderPidControl.PvInputFilterFactorMode = 4;
WinderPidControl.OutputProportionalCycleTime = 0;
WinderPidControl.AcHeatersHalfCycleTime = 0;
WinderPidControl.ProportionalGain = 11.0;


HardwareDancer FeederDancer = new HardwareDancer();
FeederDancer.HardwareDancerType = Tango.PMR.Hardware.HardwareDancerType.RightDancer;
FeederDancer.Gradual = false;
FeederDancer.K = 0;
FeederDancer.X = 0;
FeederDancer.PulsePerMmSpring = 0;
FeederDancer.MaximalMovementMm = 15;
FeederDancer.ZeroPoint = 9805;
FeederDancer.ResolutionBits = 14;
FeederDancer.ArmLength = 126;

HardwareDancer PoolerDancer = new HardwareDancer();
PoolerDancer.HardwareDancerType = Tango.PMR.Hardware.HardwareDancerType.MiddleDancer;
PoolerDancer.Gradual = false;
PoolerDancer.K = 0;
PoolerDancer.X = 0;
PoolerDancer.PulsePerMmSpring = 0;
PoolerDancer.MaximalMovementMm = 15;
PoolerDancer.ZeroPoint = 6820;
PoolerDancer.ResolutionBits = 14;
PoolerDancer.ArmLength = 126;

HardwareDancer WinderDancer = new HardwareDancer();
WinderDancer.HardwareDancerType = Tango.PMR.Hardware.HardwareDancerType.LeftDancer;
WinderDancer.Gradual = false;
WinderDancer.K = 0;
WinderDancer.X = 0;
WinderDancer.PulsePerMmSpring = 0;
WinderDancer.MaximalMovementMm = 15;
WinderDancer.ZeroPoint = 9242;
WinderDancer.ResolutionBits = 14;
WinderDancer.ArmLength = 126;

HardwareMotor FeederMotor = new HardwareMotor();
FeederMotor.HardwareMotorType = Tango.PMR.Hardware.HardwareMotorType.MotoRdriving;
FeederMotor.MinFrequency = 0;
FeederMotor.MaxFrequency = 1000000;
FeederMotor.SetMicroStep = 1;
FeederMotor.MicroStep = 1;
FeederMotor.MaxChangeSlope = 10000;
FeederMotor.HighLengthMicroSecond = 0;
FeederMotor.SpeedMaster = false;
FeederMotor.PulsePerRound = 200;
FeederMotor.PulleyRadius = 1.25;
FeederMotor.ConfigWord = 0x1C80;
FeederMotor.DirectionThreadWize = true;
FeederMotor.KvalHold = 0x35;
FeederMotor.KvalRun = 0x7f;
FeederMotor.KvalAcc = 0x7f;
FeederMotor.KvalDec = 0x7f;
FeederMotor.OverCurrentThreshold = 7;
FeederMotor.StallThreshold = 0x1F;
FeederMotor.ThermalCompensationFactor = 0;
FeederMotor.LowSpeedOptimization = false;
FeederMotor.StSlp = 0x20;
FeederMotor.IntSpd = 0x1A13;
FeederMotor.FnSlpAcc = 0x50;
FeederMotor.FnSlpDec = 0x50;

HardwareMotor DryerMotor = new HardwareMotor();
DryerMotor.HardwareMotorType = Tango.PMR.Hardware.HardwareMotorType.MotoDryerDriving;
DryerMotor.MinFrequency = 0;
DryerMotor.MaxFrequency = 1000000;
DryerMotor.SetMicroStep = 1;
DryerMotor.MicroStep = 1;
DryerMotor.MaxChangeSlope = 1000;
DryerMotor.HighLengthMicroSecond = 0;
DryerMotor.SpeedMaster = true;
DryerMotor.PulsePerRound = 200;
DryerMotor.PulleyRadius = 1.05;
DryerMotor.ConfigWord = 0x1c80;
DryerMotor.DirectionThreadWize = true;
DryerMotor.KvalHold = 0x35;
DryerMotor.KvalRun = 0x7f;
DryerMotor.KvalAcc = 0x7f;
DryerMotor.KvalDec = 0x7f;
DryerMotor.OverCurrentThreshold = 7;
DryerMotor.StallThreshold = 0x1F;
DryerMotor.ThermalCompensationFactor = 0;
DryerMotor.LowSpeedOptimization = false;
DryerMotor.StSlp = 0x20;
DryerMotor.IntSpd = 0x1A13;
DryerMotor.FnSlpAcc = 0x50;
DryerMotor.FnSlpDec = 0x50;

HardwareMotor PoolerMotor = new HardwareMotor();
PoolerMotor.HardwareMotorType = Tango.PMR.Hardware.HardwareMotorType.MotoLdriving;
PoolerMotor.MinFrequency = 0;
PoolerMotor.MaxFrequency = 1000000;
PoolerMotor.SetMicroStep = 1;
PoolerMotor.MicroStep = 8;
PoolerMotor.MaxChangeSlope = 10000;
PoolerMotor.HighLengthMicroSecond = 0;
PoolerMotor.SpeedMaster = false;
PoolerMotor.PulsePerRound = 200;
PoolerMotor.PulleyRadius = 1.25;
PoolerMotor.ConfigWord = 0x1C80;
PoolerMotor.DirectionThreadWize = true;
PoolerMotor.KvalHold = 0x35;
PoolerMotor.KvalRun = 0x7f;
PoolerMotor.KvalAcc = 0x7f;
PoolerMotor.KvalDec = 0x7f;
PoolerMotor.OverCurrentThreshold = 7;
PoolerMotor.StallThreshold = 0x1F;
PoolerMotor.ThermalCompensationFactor = 0;
PoolerMotor.LowSpeedOptimization = false;
PoolerMotor.StSlp = 20;
PoolerMotor.IntSpd = 0x1A13;
PoolerMotor.FnSlpAcc = 0x50;
PoolerMotor.FnSlpDec = 0x50;

HardwareMotor WinderMotor = new HardwareMotor();
WinderMotor.HardwareMotorType = Tango.PMR.Hardware.HardwareMotorType.MotoWinder;
WinderMotor.MinFrequency = 0;
WinderMotor.MaxFrequency = 1000000;
WinderMotor.SetMicroStep = 1;
WinderMotor.MicroStep = 16;
WinderMotor.MaxChangeSlope = 10000;
WinderMotor.HighLengthMicroSecond = 0;
WinderMotor.SpeedMaster = false;
WinderMotor.PulsePerRound = 200;
WinderMotor.PulleyRadius = 1.68;
WinderMotor.ConfigWord = 0x1c80;
WinderMotor.DirectionThreadWize = false;
WinderMotor.KvalHold = 0x0F;
WinderMotor.KvalRun = 0x15;
WinderMotor.KvalAcc = 0x15;
WinderMotor.KvalDec = 0x15;
WinderMotor.OverCurrentThreshold = 7;
WinderMotor.StallThreshold = 0x1F;
WinderMotor.ThermalCompensationFactor = 0;
WinderMotor.LowSpeedOptimization = false;
WinderMotor.StSlp = 0x18;
WinderMotor.IntSpd = 0x22C5;
WinderMotor.FnSlpAcc = 0x22;
WinderMotor.FnSlpDec = 0x22;

HardwareMotor ScrewMotor = new HardwareMotor();
ScrewMotor.HardwareMotorType = Tango.PMR.Hardware.HardwareMotorType.MotoScrew;
ScrewMotor.MinFrequency = 0;
ScrewMotor.MaxFrequency = 1000000;
ScrewMotor.SetMicroStep = 1;
ScrewMotor.MicroStep = 8;
ScrewMotor.MaxChangeSlope = 10000;
ScrewMotor.HighLengthMicroSecond = 0;
ScrewMotor.SpeedMaster = false;
ScrewMotor.PulsePerRound = 200;
ScrewMotor.PulleyRadius = 1.25;
ScrewMotor.ConfigWord = 0x1C80;
ScrewMotor.DirectionThreadWize = true;
ScrewMotor.KvalHold = 0x0F;
ScrewMotor.KvalRun = 0x15;
ScrewMotor.KvalAcc = 0x15;
ScrewMotor.KvalDec = 0x15;
ScrewMotor.OverCurrentThreshold = 7;
ScrewMotor.StallThreshold = 0x1F;
ScrewMotor.ThermalCompensationFactor = 0;
ScrewMotor.LowSpeedOptimization = false;
ScrewMotor.StSlp = 0x18;
ScrewMotor.IntSpd = 0x22C5;
ScrewMotor.FnSlpAcc = 0x22;
ScrewMotor.FnSlpDec = 0x22;

HardwareMotor LeftRockerMotor = new HardwareMotor();
LeftRockerMotor.HardwareMotorType = Tango.PMR.Hardware.HardwareMotorType.MotoLloading;
LeftRockerMotor.MinFrequency = 0;
LeftRockerMotor.MaxFrequency = 1000000;
LeftRockerMotor.SetMicroStep = 1;
LeftRockerMotor.MicroStep = 4;
LeftRockerMotor.MaxChangeSlope = 10000;
LeftRockerMotor.HighLengthMicroSecond = 0;
LeftRockerMotor.SpeedMaster = false;
LeftRockerMotor.PulsePerRound = 200;
LeftRockerMotor.PulleyRadius = 1.3;
LeftRockerMotor.ConfigWord = 0xC80;
LeftRockerMotor.DirectionThreadWize = false;
LeftRockerMotor.KvalHold = 0x28;
LeftRockerMotor.KvalRun = 0x5f;
LeftRockerMotor.KvalAcc = 0x5f;
LeftRockerMotor.KvalDec = 0x5f;
LeftRockerMotor.OverCurrentThreshold = 7;
LeftRockerMotor.StallThreshold = 0x1F;
LeftRockerMotor.ThermalCompensationFactor = 0;
LeftRockerMotor.LowSpeedOptimization = false;
LeftRockerMotor.StSlp = 6;
LeftRockerMotor.IntSpd = 0x44B8;
LeftRockerMotor.FnSlpAcc = 0x14;
LeftRockerMotor.FnSlpDec = 0x14;


HardwareMotor RightRockerMotor = new HardwareMotor();
RightRockerMotor.HardwareMotorType = Tango.PMR.Hardware.HardwareMotorType.MotoRloading;
RightRockerMotor.MinFrequency = 0;
RightRockerMotor.MaxFrequency = 1000000;
RightRockerMotor.SetMicroStep = 1;
RightRockerMotor.MicroStep = 4;
RightRockerMotor.MaxChangeSlope = 10000;
RightRockerMotor.HighLengthMicroSecond = 0;
RightRockerMotor.SpeedMaster = false;
RightRockerMotor.PulsePerRound = 200;
RightRockerMotor.PulleyRadius = 1.3;
RightRockerMotor.ConfigWord = 0xC80;
RightRockerMotor.DirectionThreadWize = true;
RightRockerMotor.KvalHold = 0x28;
RightRockerMotor.KvalRun = 0x5f;
RightRockerMotor.KvalAcc = 0x5f;
RightRockerMotor.KvalDec = 0x5f;
RightRockerMotor.OverCurrentThreshold = 7;
RightRockerMotor.StallThreshold = 0x1F;
RightRockerMotor.ThermalCompensationFactor = 0;
RightRockerMotor.LowSpeedOptimization = false;
RightRockerMotor.StSlp = 6;
RightRockerMotor.IntSpd = 0x44B8;
RightRockerMotor.FnSlpAcc = 0x14;
RightRockerMotor.FnSlpDec = 0x14;

//hardwareConfiguration.Motors.Add(FeederMotor);
//hardwareConfiguration.Motors.Add(WinderMotor);
//hardwareConfiguration.Motors.Add(DryerMotor);
//hardwareConfiguration.Motors.Add(PoolerMotor);
//hardwareConfiguration.Motors.Add(ScrewMotor);
//hardwareConfiguration.Motors.Add(LeftRockerMotor);
//hardwareConfiguration.Motors.Add(RightRockerMotor);

//hardwareConfiguration.PidControls.Add(FeederPidControl);
//hardwareConfiguration.PidControls.Add(PoolerPidControl);
//hardwareConfiguration.PidControls.Add(WinderPidControl);

//hardwareConfiguration.Dancers.Add(FeederDancer);
//hardwareConfiguration.Dancers.Add(PoolerDancer);
//hardwareConfiguration.Dancers.Add(WinderDancer);