Ideal Torque and Rotational Motion Sensors

I am trying to monitor the angular velocity and torque generated by a brushless DC motor. I am using the 'elec_brushless_dc_motor' example as a reference. The Ideal Rotational Motion Sensor block is an "across variable" block, so it should be hooked up in parallel to the motor and driver. The Ideal Torque Sensor block is a "through variable" block, so it should be hooked up in series with the motor and driver. As you can see, I have done this. However, the Ideal Rotational Motion Sensor block doesn't report any angular velocity (0 rad/s). There are no issues with the torque block, it reports the torque correctly.
What am I doing wrong?

 Accepted Answer

The setup of Through/Across looks correct. The problem may be with that "Goto" block.
By default, Goto blocks have a "tag visibility" parameter such that the data is local only to the subsystem that the block is in. If you change this from "local" to "global", does it fix the visualization of that velocity signal?
- Sebastian

14 Comments

Hi Sebastian,
Thanks for getting back with me on this. The "tag visibility" parameter of the Goto block is set to "global". Therefore, I do not think this is the issue.
Oh, wait. I see the problem!
The R and C ports are directly connected to each other, so that whole thing is hooked up to ground. This is why you get zero motion.
What you want to do is use that Torque Sensor to measure the force flowing in/out of any Inertia blocks at that node... which hopefully are inside that "Motor and Driver" subsystem.
To rephrase: That Torque Sensor block is causing a "short-circuit" between R and C, where C is connected to ground. So, both R and C ports are constrained to have zero velocity.
- Sebastian
Jonathan
Jonathan on 7 Mar 2016
Edited: Jonathan on 7 Mar 2016
The output of the "Motor and driver" subsystem comes from a Servomotor model from the SimElectronics toolbox. The Servomotor has an inertia parameter of J = 5e-10 kg*m^2. So yes, the "R" port does have an inertia tied to it.
I simply want to get the torque and rotational speed PS outputs from the Servomotor. What is the most standard way of doing this with the blocks that I have laid out.
See my updated commend above.
Maybe it helps to have context. I am trying to drive a revolute joint on a quadcopter model. The torque generated by the Servomotor model is used to drive the revolute joint modeling the propeller connected to the brushless DC motor.
What is the best way to hook this up?
(Sorry for the confusion, I kept editing my posts while you were responding)
The original Torque Sensor block is causing a "short-circuit" between R and C, where C is connected to ground. So, both R and C ports are constrained to have zero velocity.
So, what you want to do is stick the Torque Sensor inside that subsystem, to be in series between the Servomotor's R port and the connection port #5.
On the top-level, the R and C ports should not have a line between them.
Also, to answer your second question, connecting Simscape to SimMechanics shouldn't be a one-way connection. That is, you can't simply feed the motor torque to the SimMechanics model without applying the SimMechanics velocity back to the motor... the Simscape motor needs to know about the mass on the SimMechanics side it needs to accelerate.
This two-way connection can be done with standard blocks, but you can also download pre-made "interface blocks" from the following File Exchange entry:
- Sebastian
Thank you very much Sebastian. You have been a huge help! I appreciate the feedback.
I wanted to follow up with your last comment Sebastian. My Simulink and SimMechanics models are attached here . I have attached the blocks according to the File Exchange entry that you posted. Does this model appear to be hooked up correctly? I am new to all of this, so any insight is much appreciated!
Those connections look right.
The quad is spinning when you drive the motors, so that's good. Not sure if this is the behavior you expect to see or not, but at least the model is connected right now.
- Sebastian
My concern was mainly due to the warnings that I was getting. Have you seen these warnings before?
Warning: In instantiating linked block 'F450_Simulink/Motor and Driver1/Rotational Simscape
Intf/Ideal Torque Sensor' : Ideal Torque Sensor block (mask) does not have a parameter named
'w_Log'
Warning: In instantiating linked block 'F450_Simulink/Motor and Driver1/Rotational Simscape
Intf/Ideal Torque Sensor' : Ideal Torque Sensor block (mask) does not have a parameter named
't_Log'
Warning: In instantiating linked block 'F450_Simulink/Motor and Driver1/Rotational Simscape
Intf/Ideal Torque Sensor' : Ideal Torque Sensor block (mask) does not have a parameter named
'LocalVarNames'
Warning: In instantiating linked block 'F450_Simulink/Motor and Driver1/Rotational Simscape
Intf/Ideal Torque Sensor' : Ideal Torque Sensor block (mask) does not have a parameter named
'LocalVarDescs'
Warning: In instantiating linked block 'F450_Simulink/Motor and Driver1/Rotational Simscape
Intf/Ideal Torque Sensor' : Ideal Torque Sensor block (mask) does not have a parameter named
'LocalVarLogging'
Those warnings just look like version incompatibilities.
If you save the library file in your version and try again, those warnings should go away... hopefully.
Either way, that won't affect your simulation at all.
Worked like a charm ;)! Thanks for the help with all of this Sebastian. I really appreciate it.
Hi Sebastian, I have a follow up on this...
As we talked about earlier, I have connected the SimMechanics blocks to the Simscape blocks using the "Rotational Simscape Intf" block that you suggested. However, the RPM output of the motors doesn't follow the parameters of the brushless DC model. My model can be found here.
When I apply a 5V input to the motors, I would expect a maximum RPM output (4675 RPM) for my motors. However, I only see a maximum output of about 1400 RPM.
Could you give me some insight as to why this is happening? I have not been able to figure it out, or get any answers from the community.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!