Option 1: In-built Ti DMC Speed Block
Issue: No RPM output
Troubleshoot Attempts:
The DMC theta inputs requires 32-bit fixed-point numbers with Q value between 1 and 29.
The fix point value was originally converted from the Divide Block
It was then replaced with IQmath's Float to IQN Block with Q_Value to 25
When testing the system, an display is used which could observed the output
When operating, the value could only be observe going from 0 to 1 and back to 0
This attempt ensure the Speed block's theta input has to correct format and working properly
dir input was choose to be 0 as the motor rotate clockwise.
The motor rotation direction could be justify by plotting the angle which results the below figure
Attempts was also done with dir = 1 with similar results.
The setup of the Speed Measure block was also checked
Base speed is the maximum motor rotation rate to measure. This value is probably not the maximum speed the motor can achieve.
Currently, this is set to 15kRPM as the testing speed of the motor is 10kRPM as calculated from this link
The differentiator constant is a scalar value applied to the block output.
Setting the constant to 1 means the output will be divide by 1 which alter nothing
For Low-pass filter constant "This block includes filtering capability if your position signal is noisy. Setting the filter constant to 0 disables the filter."
Hence it is set to 0
Setting the Sample Time to Measure Motor Speed
Instruction was given as below
It states that the sample time must be short enough to measure the full speed of the motor.
Currently the sample rate is 1k sample per second → Sample every 1ms
Motor speed is 10kRPM which is 166.67rps → Minimum sample time is 6ms
A rate transition block is used to make sure it "clocks" the speed block
Making the Speed block into a subsystem with trigger(From 1kHz clock) caused the Speed block to output values, but it giving a range from -50 to 50RPM which is not the real RPM.
Option 2: Manual Calculation
Derivative block
Making the input continuous










