Skip to content

Commit d4dca58

Browse files
committed
Update documentation
1 parent a995acd commit d4dca58

6 files changed

Lines changed: 107 additions & 62 deletions

File tree

_modules/gem_controllers/mpc_current_controller.html

Lines changed: 86 additions & 28 deletions
Large diffs are not rendered by default.

_sources/parts_gc/api_documentation/mpc_current_controller.rst.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ within the ``gym-electric-motor`` simulation environment.
9393
ActionType.Finite
9494
)
9595
96+
#physical_system_wrapper = [DeadTimeProcessor(steps=1)] # Dead time processor with 1 step delay
97+
#uncomment the above line to activate the DeadTimeProcessor
9698
env = gem.make(
9799
motor.env_id(),
98100
visualization=visu,
@@ -108,6 +110,8 @@ within the ``gym-electric-motor`` simulation environment.
108110
limit_values=limit_values,
109111
nominal_values=nominal_values
110112
),
113+
#physical_system_wrappers=physical_system_wrapper,
114+
#uncomment the above line to activate the DeadTimeProcessor
111115
)
112116
113117
visu.initialize()

genindex.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7555,10 +7555,6 @@ <h2 id="T">T</h2>
75557555
<h2 id="U">U</h2>
75567556
<table style="width: 100%" class="indextable genindextable"><tr>
75577557
<td style="width: 33%; vertical-align: top;"><ul>
7558-
<li><a href="parts_gc/api_documentation/mpc_current_controller.html#gem_controllers.mpc_current_controller.MPCCurrentController.u_abc_k1">u_abc_k1 (gem_controllers.mpc_current_controller.MPCCurrentController attribute)</a>
7559-
</li>
7560-
<li><a href="parts_gc/api_documentation/mpc_current_controller.html#gem_controllers.mpc_current_controller.MPCCurrentController.u_lim">u_lim (gem_controllers.mpc_current_controller.MPCCurrentController attribute)</a>
7561-
</li>
75627558
<li><a href="parts_gem/physical_systems/voltage_supplies/ac_1_phase_supply.html#gym_electric_motor.physical_systems.voltage_supplies.AC1PhaseSupply.u_nominal">u_nominal (gym_electric_motor.physical_systems.voltage_supplies.AC1PhaseSupply property)</a>
75637559

75647560
<ul>
@@ -7975,8 +7971,6 @@ <h2 id="V">V</h2>
79757971
<h2 id="W">W</h2>
79767972
<table style="width: 100%" class="indextable genindextable"><tr>
79777973
<td style="width: 33%; vertical-align: top;"><ul>
7978-
<li><a href="parts_gc/api_documentation/mpc_current_controller.html#gem_controllers.mpc_current_controller.MPCCurrentController.w_q">w_q (gem_controllers.mpc_current_controller.MPCCurrentController attribute)</a>
7979-
</li>
79807974
<li><a href="parts_gem/reward_functions/weighted_sum_of_errors.html#gym_electric_motor.reward_functions.weighted_sum_of_errors.WeightedSumOfErrors">WeightedSumOfErrors (class in gym_electric_motor.reward_functions.weighted_sum_of_errors)</a>
79817975
</li>
79827976
<li><a href="parts_gem/reference_generators/wiener_process_reference_generator.html#gym_electric_motor.reference_generators.WienerProcessReferenceGenerator">WienerProcessReferenceGenerator (class in gym_electric_motor.reference_generators)</a>

objects.inv

-24 Bytes
Binary file not shown.

parts_gc/api_documentation/mpc_current_controller.html

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -366,33 +366,36 @@ <h2>MPC Current Controller<a class="headerlink" href="#mpc-current-controller" t
366366
<dt class="sig sig-object py" id="gem_controllers.mpc_current_controller.MPCCurrentController">
367367
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">gem_controllers.mpc_current_controller.</span></span><span class="sig-name descname"><span class="pre">MPCCurrentController</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">env</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">env_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prediction_horizon</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_d</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_q</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/gem_controllers/mpc_current_controller.html#MPCCurrentController"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#gem_controllers.mpc_current_controller.MPCCurrentController" title="Link to this definition"></a></dt>
368368
<dd><p>Bases: <a class="reference internal" href="gem_controllers.html#gem_controllers.gem_controller.GemController" title="gem_controllers.gem_controller.GemController"><code class="xref py py-class docutils literal notranslate"><span class="pre">GemController</span></code></a></p>
369+
<p>Finite-Control Set Model Predictive Current Controller for PMSM and SynRM motors.</p>
370+
<p>This controller implements FCS-MPC to directly evaluate switching states
371+
and optimize current tracking in field-oriented coordinates.</p>
369372
<dl class="field-list simple">
370373
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
371374
<dd class="field-odd"><ul class="simple">
372375
<li><p><strong>env</strong> – Gym environment instance</p></li>
373376
<li><p><strong>env_id</strong> – Environment ID string</p></li>
374-
<li><p><strong>prediction_horizon</strong> – Prediction horizon (N)</p></li>
375-
<li><p><strong>w_d</strong> – Weight for d-axis current error</p></li>
376-
<li><p><strong>w_q</strong> – Weight for q-axis current error</p></li>
377+
<li><p><strong>prediction_horizon</strong> – Prediction horizon length (default: 1)</p></li>
378+
<li><p><strong>w_d</strong> – Weight for d-axis current error (default: 1.0)</p></li>
379+
<li><p><strong>w_q</strong> – Weight for q-axis current error (default: 1.0)</p></li>
377380
</ul>
378381
</dd>
379382
</dl>
380383
<dl class="py method">
381384
<dt class="sig sig-object py" id="gem_controllers.mpc_current_controller.MPCCurrentController.control">
382385
<span class="sig-name descname"><span class="pre">control</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">state</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reference</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/gem_controllers/mpc_current_controller.html#MPCCurrentController.control"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#gem_controllers.mpc_current_controller.MPCCurrentController.control" title="Link to this definition"></a></dt>
383-
<dd><p>Calculate the voltage reference.</p>
386+
<dd><p>Compute the optimal voltage vector based on current state and reference.</p>
384387
<dl class="field-list simple">
385388
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
386389
<dd class="field-odd"><ul class="simple">
387-
<li><p><strong>state</strong> (<em>np.array</em>) – state of the environment</p></li>
388-
<li><p><strong>reference</strong> (<em>np.array</em>) – speed references</p></li>
390+
<li><p><strong>state</strong> – Current motor state vector</p></li>
391+
<li><p><strong>reference</strong> – Current reference vector [i_sd_ref, i_sq_ref]</p></li>
389392
</ul>
390393
</dd>
391394
<dt class="field-even">Returns<span class="colon">:</span></dt>
392-
<dd class="field-even"><p>reference voltage</p>
395+
<dd class="field-even"><p>Index of optimal voltage vector</p>
393396
</dd>
394397
<dt class="field-odd">Return type<span class="colon">:</span></dt>
395-
<dd class="field-odd"><p>np.array</p>
398+
<dd class="field-odd"><p>best_idx</p>
396399
</dd>
397400
</dl>
398401
</dd></dl>
@@ -463,7 +466,7 @@ <h2>MPC Current Controller<a class="headerlink" href="#mpc-current-controller" t
463466
<dl class="py method">
464467
<dt class="sig sig-object py" id="gem_controllers.mpc_current_controller.MPCCurrentController.reset">
465468
<span class="sig-name descname"><span class="pre">reset</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/gem_controllers/mpc_current_controller.html#MPCCurrentController.reset"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#gem_controllers.mpc_current_controller.MPCCurrentController.reset" title="Link to this definition"></a></dt>
466-
<dd><p>Reset all stages of the controller</p>
469+
<dd><p>Reset the controller state including delay compensation variables.</p>
467470
</dd></dl>
468471

469472
<dl class="py method">
@@ -489,24 +492,6 @@ <h2>MPC Current Controller<a class="headerlink" href="#mpc-current-controller" t
489492
<dd><p>Stages of the GEM Controller</p>
490493
</dd></dl>
491494

492-
<dl class="py attribute">
493-
<dt class="sig sig-object py" id="gem_controllers.mpc_current_controller.MPCCurrentController.u_abc_k1">
494-
<span class="sig-name descname"><span class="pre">u_abc_k1</span></span><a class="headerlink" href="#gem_controllers.mpc_current_controller.MPCCurrentController.u_abc_k1" title="Link to this definition"></a></dt>
495-
<dd><p>Load motor model constants and motor-specific state names</p>
496-
</dd></dl>
497-
498-
<dl class="py attribute">
499-
<dt class="sig sig-object py" id="gem_controllers.mpc_current_controller.MPCCurrentController.u_lim">
500-
<span class="sig-name descname"><span class="pre">u_lim</span></span><a class="headerlink" href="#gem_controllers.mpc_current_controller.MPCCurrentController.u_lim" title="Link to this definition"></a></dt>
501-
<dd><p>Setup coordinate transforms and precompute voltage combinations</p>
502-
</dd></dl>
503-
504-
<dl class="py attribute">
505-
<dt class="sig sig-object py" id="gem_controllers.mpc_current_controller.MPCCurrentController.w_q">
506-
<span class="sig-name descname"><span class="pre">w_q</span></span><a class="headerlink" href="#gem_controllers.mpc_current_controller.MPCCurrentController.w_q" title="Link to this definition"></a></dt>
507-
<dd><p>Assign self.step from the environment wrapper, default to 0 if no DeadTimeProcessor</p>
508-
</dd></dl>
509-
510495
</dd></dl>
511496

512497
</section>
@@ -561,6 +546,8 @@ <h2>Example Usage<a class="headerlink" href="#example-usage" title="Link to this
561546
<span class="n">ActionType</span><span class="o">.</span><span class="n">Finite</span>
562547
<span class="p">)</span>
563548

549+
<span class="c1">#physical_system_wrapper = [DeadTimeProcessor(steps=1)] # Dead time processor with 1 step delay</span>
550+
<span class="c1">#uncomment the above line to activate the DeadTimeProcessor</span>
564551
<span class="n">env</span> <span class="o">=</span> <span class="n">gem</span><span class="o">.</span><span class="n">make</span><span class="p">(</span>
565552
<span class="n">motor</span><span class="o">.</span><span class="n">env_id</span><span class="p">(),</span>
566553
<span class="n">visualization</span><span class="o">=</span><span class="n">visu</span><span class="p">,</span>
@@ -576,6 +563,8 @@ <h2>Example Usage<a class="headerlink" href="#example-usage" title="Link to this
576563
<span class="n">limit_values</span><span class="o">=</span><span class="n">limit_values</span><span class="p">,</span>
577564
<span class="n">nominal_values</span><span class="o">=</span><span class="n">nominal_values</span>
578565
<span class="p">),</span>
566+
<span class="c1">#physical_system_wrappers=physical_system_wrapper,</span>
567+
<span class="c1">#uncomment the above line to activate the DeadTimeProcessor</span>
579568
<span class="p">)</span>
580569

581570
<span class="n">visu</span><span class="o">.</span><span class="n">initialize</span><span class="p">()</span>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)