示例#1
0
        public override AbstractMMAnalyser GetMMAnalyser()
        {
            if (mmAnalyser == null)
            {
                mmAnalyser = PM_MMAnalyser.GetSampleMe(this);
            }

            return(mmAnalyser);
        }
示例#2
0
        public static PM_MMAnalyser GetSampleMe(AbstractMotor motor)
        {
            PM_MMAnalyser mma = new PM_MMAnalyser();

            mma.AnalysisName = "MMAnalysis";
            mma.Motor        = motor;
            mma.Beta         = 135;
            mma.MaxCurrent   = 160;
            mma.RotorAngle   = 40;
            mma.StepCount    = 10;

            return(mma);
        }
示例#3
0
        /// <summary>
        /// Process data after load
        /// </summary>
        public override void ProcessDataAfterLoad()
        {
            PM_MMAnalyser analyser = this.Analyser as PM_MMAnalyser;

            if (analyser == null)
            {
                return;
            }

            // assure fluxlinkage M, and theta_e
            double VectorMMFAngle = (Analyser.Motor.Stator as Stator3Phase).VectorMMFAngle;

            foreach (PMMMAnalysisOneStepResult oneresult in ListResults)
            {
                // angle between rotor and vector mms A
                oneresult.theta_e       = (analyser.RotorAngle - VectorMMFAngle) * analyser.Motor.Rotor.p * Math.PI / 180;//in radian
                oneresult.FluxLinkage_M = FluxLinkageM;
            }
        }
示例#4
0
        public override IDictionary <string, object> BuildResultsForDisplay()
        {
            IDictionary <string, object> dict = base.BuildResultsForDisplay();

            PM_MMAnalyser analyser = this.Analyser as PM_MMAnalyser;
            int           pp       = analyser.Motor.Rotor.p;

            // to open fem file
            dict.Add("OpenResults", analyser.Path_ToAnalysisVariant);


            dict.Add("psiD(Id)", new ListPointD(ListResults.Select(p => p.Idq.d).ToArray(), ListResults.Select(p => p.FluxLinkage_dq.d).ToArray()));
            dict.Add("psiQ(Iq)", new ListPointD(ListResults.Select(p => p.Idq.q).ToArray(), ListResults.Select(p => p.FluxLinkage_dq.q).ToArray()));
            dict.Add("Ld(I)", new ListPointD(ListResults.Where(p => p.Idq.d < 0).Select(p => p.Idq.Magnitude).ToArray(),
                                             ListResults.Where(p => p.Idq.d < 0).Select(p => p.Ldq.d).ToArray()));
            dict.Add("Lq(I)", new ListPointD(ListResults.Where(p => p.Idq.d < 0).Select(p => p.Idq.Magnitude).ToArray(),
                                             ListResults.Where(p => p.Idq.d < 0).Select(p => p.Ldq.q).ToArray()));
            dict.Add("psiM/Ld/Imax", new ListPointD(ListResults.Select(p => p.Idq.Magnitude).ToArray(), ListResults.Select(p => p.FluxLinkage_M / p.Ldq.d / p.Idq.Magnitude).ToArray()));
            dict.Add("FluxLinkage(M)-mm", FluxLinkageM);
            dict.Add("PhaseResistance", PhaseResistance);

            double[] psid_ = new double[Count];
            double[] psiq_ = new double[Count];
            for (int i = 1; i < Count; i++)
            {
                psid_[i] = (ListResults[i].FluxLinkage_dq.d - ListResults[i - 1].FluxLinkage_dq.d) /
                           (ListResults[i].Idq.d - ListResults[i - 1].Idq.d);

                psiq_[i] = (ListResults[i].FluxLinkage_dq.q - ListResults[i - 1].FluxLinkage_dq.q) /
                           (ListResults[i].Idq.q - ListResults[i - 1].Idq.q);
            }
            dict.Add("PsiD'(id)", new ListPointD(ListResults.Select(p => p.Idq.d).ToArray(), psid_));
            dict.Add("PsiQ'(iq)", new ListPointD(ListResults.Select(p => p.Idq.q).ToArray(), psiq_));


            //LinearSpline ls_psi_d = LinearSpline.Interpolate(ListResults.Select(p => p.Idq.d), ListResults.Select(p => p.FluxLinkage_dq.d));
            //LinearSpline ls_psi_q = LinearSpline.Interpolate(ListResults.Select(p => p.Idq.q), ListResults.Select(p => p.FluxLinkage_dq.q));
            // Build torque by angle for each
            for (int i = 0; i < ListResults.Length; i++)
            {
                var one_step_result = ListResults[i];

                // only quarter where id<0,iq>0
                if (one_step_result.Idq.d >= 0 || one_step_result.Idq.q <= 0)
                {
                    continue;
                }

                double Ld    = one_step_result.Ldq.d;
                double Lq    = one_step_result.Ldq.q;
                double II    = one_step_result.Idq.Magnitude;
                double Beta0 = one_step_result.Idq.Phase;
                double psiM  = one_step_result.FluxLinkage_M;

                double d_wire = (Analyser.Motor.Stator as Stator3Phase).WireDiameter;
                double S_wire = d_wire * d_wire / 4 * Math.PI;

                String name = String.Format("Torque (Imax={0:F2}, J={1:F2})", II, II / S_wire / Math.Sqrt(2));
                if (dict.ContainsKey(name))
                {
                    continue;
                }

                int      n  = 360;
                double[] x  = Enumerable.Range(0, n).Select(kk => 1.0 * kk).ToArray();
                double[] tt = new double[n];
                for (int k = 0; k < n; k++)
                {
                    double beta = 2.0 * Math.PI * k / n;
                    double id   = II * Math.Cos(beta);
                    double iq   = II * Math.Sin(beta);

                    tt[k] = 1.5 * pp * (psiM * iq + (Ld - Lq) * id * iq);

                    //double psid = ls_psi_d.Interpolate(id);
                    //double psiq = ls_psi_q.Interpolate(iq);
                    //tt[k] = 1.5 * pp * (psid * iq - psiq * id);
                }

                object value = new ListPointD(x, tt);
                dict.Add(name, value);
            }

            IEnumerable <int> seq = Enumerable.Range(0, Count);
            var arrI  = ListResults.Where(p => p.Idq.d < 0).Select(p => p.Idq.Magnitude).ToArray();
            var arrL1 = seq.Where(i => ListResults[i].Idq.d < 0).Select(i => (ListResults[i].Ldq.d + ListResults[i].Ldq.q) / 3).ToArray();
            var arrL2 = seq.Where(i => ListResults[i].Idq.d < 0).Select(i => - (ListResults[i].Ldq.d - ListResults[i].Ldq.q) / 3).ToArray();

            dict.Add("L1(I)", new ListPointD(arrI, arrL1));
            dict.Add("L2(I)", new ListPointD(arrI, arrL2));


            int    Q      = Analyser.Motor.Stator.Q;
            int    q      = Q / 3 / pp / 2;
            double kp     = Math.Sin(Math.PI / (2 * 3)) / (q * Math.Sin(Math.PI / (2 * 3 * q)));
            var    stator = Analyser.Motor.Stator as Stator3Phase;
            double ns     = 4 / Math.PI * kp * stator.NStrands * q * pp;
            var    Motor  = Analyser.Motor;
            var    rotor  = Motor.Rotor as VPMRotor;

            double gm = rotor.gammaMerad;

            double[] arr_dmin = new double[Count];
            double[] arr_dmax = new double[Count];
            for (int i = 0; i < arrL1.Length; i++)
            {
                double mL1 = arrL1[i];
                double mL2 = arrL2[i];
                double a1  = mL1 / ((ns / 2 / pp) * (ns / 2 / pp) * Math.PI * Motor.Rotor.RGap * Motor.GeneralParams.MotorLength * 1e-6 * 4 * Math.PI * 1e-7);
                double a2  = mL2 / (0.5 * (ns / 2 / pp) * (ns / 2 / pp) * Math.PI * Motor.Rotor.RGap * Motor.GeneralParams.MotorLength * 1e-6 * 4 * Math.PI * 1e-7);

                arr_dmin[i] = 1 / (a1 + a2 * gm / (2 * Math.Sin(gm)));
                arr_dmax[i] = 1 / (a1 - a2 * (Math.PI - gm) / (2 * Math.Sin(gm)));
            }

            dict.Add("dmin(I)", new ListPointD(arrI, arr_dmin));
            dict.Add("dmax(I)", new ListPointD(arrI, arr_dmax));

            return(dict);
        }