Simulation development

From the eMotor toolbox, place the following blocks in your diagram:

      PID Controller (Digital)

      Hall Sensor

      PWM Brushless Servo Amplifier

      Rotary Encoder

Flip the Rotary Encoder and Hall Sensor blocks using the Edit > Flip Horizontal command. Then arrange the blocks and wire them together, as shown below.

tuto_13

Connect the Hall Sensor outputs to the corresponding inputs of the Brushless PWM Servo Amplifier. Then, wire the output of the PID Controller (Digital) to the reference velocity input of the Brushless PWM Servo Amplifier. Finally, connect the displacement output of the Rotary Encoder to the measurement input of the PID Controller (Digital).

Two const blocks are fed into the Brushless PWM Servo Amplifier; another const block is fed into the PID Controller (Digital):

Set the value of the const block, wired into inhibit, to 1. This prevents inhibit.

In this application, there is no reason to reset the integration of the PID Controller (Digital), so a 0 const is wired to Integrator Reset (High) to disable. In other applications, repetitive control may be used, and Integrator Reset (High) may be required to re-initialize the control between repetitions.

A value of 100 amps is chosen for this example to make certain saturation does not occur. Later on, you might possibly measure currents encountered in this simulation under highest load conditions and set a more appropriate current limit for the final design.

Next, place the following eMotor blocks in the diagram:

      Brushless DC (BLDC/PMSM) Motor

      Rotary Encoder

      Rotational Load

Flip the Rotary Encoder and Rotational Load blocks using the Edit > Flip Horizontal command. Then arrange the blocks to the right of the previous construction, as shown in the following diagram:

tuto_14

The rotor output displacement of the Brushless DC (BLDC/PMSM) Motor connects to three other block connections: the displacement input of the Hall Sensor block, the input of the Rotary Encoder, and the rotary displacement input of the Rotational Load.

Connect the outputs of the PWM Brushless Servo Amplifier to the corresponding inputs of the Brushless DC (BLDC/PMSM) Motor. Connect the load reaction torque vector output connector on the Rotational Load to the load reaction vector input of the Brushless DC (BLDC/PMSM) Motor.

Lastly connect a const block with 0 set value to the load disturbance input connector on the Rotational Load. If there were other torques related to influences that could not be directly represented by the set parameters of the rotary load model, the load disturbance input provides a method for introducing such torques. For the target tracker, it might be conceivable to introduce torque noise induced by structural vibrations of the tracker mount. If the mount were part of a satellite payload, such vibrations could arise from solar array positioning systems. Noise profiles with specific power spectral densities can be generated in Embed using the Random Generator blocks and transferFunction block. Coefficients of the transfer function are determined by applying spectral factorization techniques to the known PSD.

Next, insert a Park Transform and a Clark Transform into the diagram and connect them as shown below:

tuto_15

Encapsulate the blocks in Current Sense. Then label the input and output connector tabs as shown below:

tuto_16

Flip the block 180o and connect the ias and ibs output connectors of the Brushless DC (BLDC/PMSM) Motor to the corresponding a and b inputs of the Current Sense. Connect the displacement output of the Rotary Encoder to the angle input of the Current Sense. Connect the load displacement output of the Rotational Load to the displacement input of the other Rotary Encoder.

Complete the wiring by connecting the output of the Current Sense to the current sense input of the PWM Brushless Servo Amplifier and the rate output of the Rotary Encoder to the tach input of the PWM Brushless Servo Amplifier, as shown below:

tuto_17

This block construction represents a cascade control loop. The inner loop senses and controls current; the middle loop senses and controls velocity; and the outermost loop senses and controls position.

Now the entire block construction must be captured within a single compound block named X Axis Servo. Reduce the number of inputs and outputs on X Axis Servo to one, and label the input commanded LOS and output actual LOS.

Next, drill into X Axis Servo and make certain that the commanded LOS is connected to the command input of the PID compensator block and the displacement output of the Rotational Load is connected to the actual LOS output of the compound block.

While still in the X Axis Servo, open the dialog boxes of each eMotor block and enter the following parameter values as specified by the design input.

PID Controller (Digital) block

PWM Brushless Servo Amplifier block

Rotary Encoder block that feeds back to PID Controller (Digital) block

Rotary Encoder block that feeds back into the PWM Brushless Servo Amplifier block

Brushless DC (BLDC/PMSM) Motor block

Rotational Load block

This completes the x-axis of the servo controller. Completing the y-axis takes only a couple of keystrokes, as all dynamics for this axis are assumed to be equal. Make a duplicate copy of X Axis Servo using the Edit > Copy command. In the dialog box for the newly-created X Axis Servo, change the name of the block to Y Axis Servo. At this point, there are two servo controllers in your diagram: an x-axis and a y-axis servo controller.

Next, create a simulation of the pipeline image processor. For this processor, the dominant feature is the sample frame rate of 60 Hz. Place two sampleHold blocks (located under Blocks > Nonlinear) and a pulseTrain block (located under Blocks > Signal Producer) in your diagram. Arrange these blocks as shown below:

tuto_24

In the pulseTrain block, set the time between pulses to 1/60 (0.0167). Then encapsulate the three blocks in a compound block Focal Plane Pipeline Processor.

tuto_25

Next, create the following block configuration:

tuto_26

This construction is used to create an elliptical motion for the target in the X-Y plane. Frequency for each axis is the same (1 rad/sec); however, phase differs.

The integrator (1/S) and sin blocks are located under Blocks > Integration and Blocks > Transcendentals, respectively.

Enclose this construct in a compound block and name it Target:

tuto_27

Connect the compound blocks as shown in the following diagram:

tuto_28

In this construction, command line of sight (LOS) is set to the target angle that is determined by the pipeline processor. The difference between the target angle and actual line of sight is calculated using summingJunction blocks that provide focal plane error. The error is converted into degrees using unitConversion blocks.