Message Boards Message Boards

0
|
6469 Views
|
1 Reply
|
3 Total Likes
View groups...
Share
Share this post:

Modeling a DC motor with pulse width modulation with SystemModeler?

NO idea what I did wrong

model JOse_stepeer
  Modelica.Electrical.Analog.Semiconductors.NPN nPN annotation(Placement(visible = true, transformation(origin = {-65, -5}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  replaceable Modelica.Electrical.Analog.Interfaces.VoltageSource voltageSource(offset = 50, startTime = 10) annotation(Placement(visible = true, transformation(origin = {-82.915, 43.313}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Basic.Ground ground annotation(Placement(visible = true, transformation(origin = {-21.841, -45}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage annotation(Placement(visible = true, transformation(origin = {-100, -5}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
  Modelica.Blocks.Sources.Pulse pulse(amplitude = 51, period = 1) annotation(Placement(visible = true, transformation(origin = {-110, 22.209}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Machines.BasicMachines.DCMachines.DC_ElectricalExcited dcee(Jr = 2, wMechanical.start = 1, ia.start = 10, ie.start = 50) annotation(Placement(visible = true, transformation(origin = {60, -17.487}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Basic.Capacitor capacitor annotation(Placement(visible = true, transformation(origin = {21.933, -20}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
equation
  connect(voltageSource.p, nPN.C) annotation(Line(visible = true, origin = {-57.866, 21.657}, points = {{-15.049, 21.657}, {6.091, 21.657}, {6.091, -21.657}, {2.866, -21.657}}, color = {10, 90, 224}));
  connect(nPN.E, ground.p) annotation(Line(visible = true, origin = {-32.894, -18.333}, points = {{-22.106, 8.333}, {11.053, 8.333}, {11.053, -16.667}}, color = {10, 90, 224}));
  connect(voltageSource.n, nPN.E) annotation(Line(visible = true, origin = {-90.583, 3.325}, points = {{-2.332, 39.988}, {-34.417, 39.988}, {-34.417, -33.325}, {35.583, -33.325}, {35.583, -13.325}}, color = {10, 90, 224}));
  connect(signalVoltage.p, nPN.B) annotation(Line(visible = true, origin = {-82.5, -5}, points = {{-7.5, -0}, {7.5, 0}}, color = {10, 90, 224}));
  connect(signalVoltage.n, ground.p) annotation(Line(visible = true, origin = {-73.629, -19.667}, points = {{-36.371, 14.667}, {-45.483, 7.667}, {-45.483, -5.333}, {42.742, -5.333}, {42.742, -2.333}, {51.789, -15.333}}, color = {10, 90, 224}));
  connect(pulse.y, signalVoltage.v) annotation(Line(visible = true, origin = {-98.2, 12.483}, points = {{-0.8, 9.725}, {2.2, 9.725}, {2.2, -4.483}, {-1.8, -4.483}, {-1.8, -10.483}}, color = {1, 37, 163}));
  connect(ground.p, dcee.pin_an) annotation(Line(visible = true, origin = {0.543, -3.122}, points = {{-22.384, -31.878}, {-20.543, 8.122}, {20.543, 8.122}, {53.457, -4.365}}, color = {10, 90, 224}));
  connect(nPN.C, dcee.pin_ap) annotation(Line(visible = true, origin = {-10.428, 7.19}, points = {{-44.572, -7.19}, {-21.23, -7.19}, {-21.23, 14.529}, {43.515, 14.529}, {76.428, -14.677}}, color = {10, 90, 224}));
  connect(capacitor.n, ground.p) annotation(Line(visible = true, origin = {3.009, -32.5}, points = {{18.925, 2.5}, {18.925, -0.725}, {5.925, -0.725}, {5.925, 0.725}, {-24.849, 0.725}, {-24.849, -2.5}}, color = {10, 90, 224}));
  connect(capacitor.p, dcee.pin_ep) annotation(Line(visible = true, origin = {36.283, -9.305}, points = {{-14.35, -0.695}, {-14.35, 2.53}, {7.492, 2.53}, {7.492, -2.182}, {13.717, -2.182}}, color = {10, 90, 224}));
  connect(dcee.pin_en, capacitor.n) annotation(Line(visible = true, origin = {36.283, -28.685}, points = {{13.717, 5.198}, {7.492, 5.198}, {7.492, -4.54}, {-14.35, -4.54}, {-14.35, -1.315}}, color = {10, 90, 224}));
  annotation(Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5})));
end JOse_stepeer;

enter image description here

POSTED BY: Jose Calderon

Jose,

As to why your model does not run, your problem is the "VoltageSource" block. It's a partial model used to build other voltage blocks. Choose something like "StepVoltage" instead.

if you fix that, your model will simulate but is has a modeling problem:

You need to put a voltage on the field or there will be no magnetization. You have a capacitor but no voltage applied to it. See the example DCEE_Start to see how to use the DCEE block. It is magnetized with an "Excitation voltage" on the right hand pins (the rotor) and then operated with the armature voltage on top (the stator).

If you put a constant voltage instead of your capacitor, the motor will run with your model. I have not thought about whether the revised model is correct but it will run and generate torque --but you can now do some tests and determine how to adjust the model to get exactly what you want.

I hope this helps.

Regards,

Neil

POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract