Consider both exploration and input cost in a continuous-input control problem, and compare with a simple controller.
Before practice
01 What physical quantity does a continuous action number represent?
Description
SAC learns a stochastic policy for continuous actions, considering both reward and entropy. Distinguish numerical action ranges from physical units such as torque or voltage.
02 Can you connect the same SAC directly to another control problem?
Description
Map Pendulum's angle representation, reward, and time limit to the motor angular velocity tracking problem. Even with the same algorithm, different inputs and objectives require different evaluation metrics.
Execution conditions
Required packages: gymnasium, stable-baselines3, and PyTorch.
SB3 policy: MlpPolicy.
Gymnasium step: 5 return values.
Public environment visualization: Add gymnasium[classic-control].
If the required package is missing, run %pip install control==0.10.2 gymnasium==1.3.0 stable-baselines3==2.9.2 in a Colab or Jupyter code cell.
Applications
Drive-system tracking performance and input cost
A synthetic 1st-order motor model that tracks a constant reference angular velocity in each experiment. Separate training at target 1 from evaluation at 0.5, 1, and 1.5.
Observation·State
Angular velocity , target .
Action
Continuous , actual input .
Reward·Constraint
. Termination at ; time limit at 100 steps.
Comparison baseline
P control with the same input limits.
Metrics to check
Tracking RMSE, mean u², and number of safety terminations. Evaluate separately for each target.
HVAC and thermal process control
A design case for control that reduces both temperature deviation and energy use.
Observation·State
Temperature, target, outside-air conditions, and recent inputs. Include history when delays are substantial.
Action
Bounded continuous heating and cooling output.
Reward·Constraint
Temperature error and energy cost. Record safety limits as metrics separate from reward as well.
Comparison baseline
Thermostat and PI control.
Metrics to check
Error, energy, and time spent violating limits. Evaluate separately by outside-air condition.
First check whether the discrete or continuous action choice matches the algorithm. In your domain, compare rule-based control using the same information and input limits.
Synthetic motor, dt=0.1 s, input , and training reference angular velocity 1. Evaluate targets 0.5, 1, and 1.5.
Procedure
Record baseline policy performance first. Check the provided wrapper's observation and action ranges and reset/step return values.
Run short training for 2048 transitions and evaluate deterministically under the same conditions.
Separate metrics that improved over the baseline from those that worsened, and interpret the limitations of short training.
Results to retain
Evaluation table for baseline and learned policies. Tracking plots by reference angular velocity.
Record location: In the existing evaluation loop in motor_evaluate, immediately after each step.
Values to preserve: env.t*0.1, env.omega, env.reference.
Plot: Tracking responses and target lines for each reference in the existing seed=100 evaluation.
Axes: Time [s]–Angular velocity [rad/s]. Use only existing evaluation records.
In the synthetic model, action corresponds to model input . Physical units for are unspecified.
Items to record and points to check
Policy
Target velocity
Evaluation return
Tracking RMSE
Mean u²
Safety termination
Points to check
Did you distinguish training return from evaluation metrics in their original units?
Did you first validate with a synthetic model instead of real equipment?
2. Transfer SAC to a public continuous control environment
Starting conditions
Pendulum-v1 with SAC for 2048 transitions. Unlike the motor's angular velocity observation, observations are cosθ, sinθ, and angular velocity.
Procedure
Find observations, torque range, rewards, and time limits in the official environment description, and map them to Motor.
Compare zero torque, random actions, and briefly trained SAC on the same seed=100…102.
Interpret the return and behavior, and state which observations, rewards, and input limits must change when transferring to a real research environment.
Results to retain
Environment mapping table and policy evaluation table. Optionally visualize one episode.
Items to record and points to check
Policy
Environment
Training budget
Return mean and standard deviation
Termination type
Points to check
Did you avoid directly comparing Pendulum scores with motor scores?
Did you check actual results instead of assuming short training achieves swing-up?
3. Apply this to your research problem
Starting conditions
Based on the preceding experiments, choose Queue, Motor, or one of your research problems and design an experiment for real application.
Procedure
Define state, observation, action, reward, termination, and time limit in one table. Record each variable's units and the information you can actually obtain.
Write 3 expected transitions numerically and check whether rewards for good and bad actions match your intent.
Choose one rule-based comparison baseline, one evaluation condition, and one failure case of greatest concern. Also list the required measurements or simulator.
Results to retain
MDP design table, 3 transition examples, and comparative experiment plan.
If real research data are unavailable, design using synthetic conditions from an application case.
You may continue with the research problem and design table selected earlier. Revisit existing entries and transition examples using the concepts learned in this activity, and update changed entries or reasons for retaining them.
Items to record and points to check
Item
Concrete definition and units
Observability and verification method
Points to check
Did you exclude future information and evaluation labels from observations?
Did you define domain-specific metrics rather than judging the research contribution solely by training return?