the model is as simple as this: I'd like to apply a torque to the Rotational Flange of a Revolute Joint.
However, the torque reaction should not be applied to the Support Flange of the Revolute Joint.
The torque reaction is indeed counterbalanced elsewhere and not in the Revolute Joint itself.
A real-world example is a vehicle wheel: the torque is given by a powertrain and transferred to the wheel by a shaft, so the torque reaction is not perceived on the wheelhub but on the powertrain mounts.
So, none of the above seems to be correct:
in BLUE: there is a reaction on the Revolute frame_a that there shoudn't be. The support (white circle) seems to always balance the torque applied to the flange (gray circle)) but it doesn't make sense in this case;
in RED: there is no reaction on Revolute frame_a but there is no speed in the 1D line and this is not ok.
So, how can apply a Torque to a Revolute Joint without being forced to sense the counterbalanced torque directly on the joint?
Here the code
I came up with this solution that requires modifying the Revolute joint.
This is a minimal library with the modified Revolute Joint and a minimal example
Basically I just required that the torque on frame_a and frame_b is equal only along two directions orthogonal to the revolute axis (before they were equal along any direction).
And the torque called 'tau' provided by the auxiliary flange is applied along revolute axis direction only to frame_b, while for frame_a along this direction the torque is imposed to be zero.
This makes much more sense to me, but I'll be glad if someone proves me wrong.
As #tbeu just saw, I also sent an issue to the Modelica Standard Library GitHub, so it might be worth to wait for some official answer.
Related
I have 2 sensors: on an upper arm and on a hand, each gives me a quaternion (or Euler angles) of its position in global 3d space, do you have any ideas, how can I find the forearm position?
For example, I need this value to solve the issue:
when I hold my hand on a table and move up my upper arm (like a wing), the program thinks that I move my hand up together with the upper arm.
The situation you describe sounds like an inverse kinematics problem. In effect, this is the way of determining the required angles (and by extension, positioning) of intermediate joints in a limb (or other jointed object) based on the desired position of its free end (the end effector).
Rather than tackling this difficult mathematics question on your own, you may want to look at Unity's own inverse kinematics implementation. However, this might not be feasible if you can't adapt your in-game object(s) to an Animator.
You could also code a solution on your own. Creating a generic solution to this problem is extremely mathematically complex - but you've got some extra information available to you: the actual angle and positioning of the hand and upper arm. If you specify either the forearm length or upper arm length (you can even derive this mathematically, up to you!), then some light linear algebra should be enough for your purposes (provided your sensor readings are correct).
If you specify a forearm length FL, then you need to find the point of intersection (the elbow) along the upper arm's direction vector which is distance FL from the hand. Alternatively, if you specify an upper arm length UL, you just need to move UL/2 down the upper arm's direction vector (since the position is in the middle of the upper arm) to get the elbow position.
In both cases, once you have the elbow position, it's trivial to get the forearm position and angle. Here's a diagram for visualization of the problem:
I am leveraging SimMechanics, SimElectronics, and Simulink to model a quadcopter system for an embedded system class project ( files here ). I have generated a 2nd Generation SimMechanics model of an F450 quadcopter frame, including the motors and propellers. We were hoping to develop a model of a quadcopter with only a single rotational degree of freedom around either the x or y axis. I was hoping to model this with a revolute joint connecting the quadcopter frame to the "world frame". However, the "revolute joint" block in SimMechanics only acts around the z-axis. How can I change the axis of rotation for a revolute joint?
It appears that another individual has asked the same question, but no one has yet responded to his question.
See Assembling Multibody Models in the SimMechanics documentation, in particular the section on "orienting joints":
To obtain the motion expected in a model, you must align its various
joint motion axes properly. This means aligning the joints themselves
as observed or anticipated in the real system. Misaligning the joint
axes may lead to unexpected motion but it often leads to something
more serious, such as a failure to assemble and simulate.
You can specify and change joint alignment by rotating the connection
frames local to the adjoining body subsystems. For this purpose, you
specify rotation transforms using Rigid Transform blocks, either by
adding new blocks to the body subsystems or, if appropriate, by
changing the rotation transforms in existing blocks within the
subsystems.
Why change the orientation of joints through body subsystem frames?
The primitives in a Joint block each have a predetermined motion axis,
such as x or z. The axis definition is fixed and cannot be changed.
Realigning the connection frames local to the adjoining body
subsystems provides a natural way to reorient joints while avoiding
confusion over which axis a particular joint uses.
For an example of how to rotate joint connection frames, see Model
Mount.
So the answer is to use a Rigid Transform block to change the orientation of the frames, you cannot change the axis of the revolute joint.
I think you should change it in your CAD file. Change your propeller axis to align with z axis. But you should only change the propeller axis, not the whole body.
I have a CAD model of a bar 25cm x 5cm x 2cm imported into SimMechanics.
On one of the sides, I have a small "hole", around which I have to apply a certain torque, to make the bar spin.
I have applied said torque through a revolute joint, but the axis of rotation is assumed by SimMechanics to be one of the edges, giving a "lopsided" rotation.
How can I shift the position of the torque to this specific point on the bar?
To answer my own question, the way I solved it was to add a Rigid Transform "after" the revolute joint.
What happened was that adding the Rigid Transform after the revolute joint essentially "shifted" the bar to the imaginary axis of rotation of the revolute joint, which was what I was looking for.
I want to use the iPhones's accelerometer to detect motions while driving. I'm a bit confused what the accelerometer actually measures, especially when driving a curve.
As you can see in the picture, a car driving a curve causes two forces. One is the centripetal force and one is the velocity. Imagine the iPhone is placed on the dashboard with +y-axis is pointing to the front, +x-axis to the right and +z-axis to the top.
My Question is now what acceleration will be measured when the car drives this curve. Will it measure g-force on the -x-axis or will the g-force appear on the +y axis?
Thanks for helping!
UPDATE!
For thoses interested, as one of the answers suggested it measures both. The accelerometer is effected by centrifugal force and velocity resulting in an acceleration vector that is a combination of these two.
I think it will measure both. But don't forget that the sensor will measure gravity as well. So when your car is not moving, you will still get accelerometer readings. A nice talk on sensors in smartphones http://www.youtube.com/watch?v=C7JQ7Rpwn2k&feature=results_main&playnext=1&list=PL29AD66D8C4372129 (it's on android, but the same type of sensors are used in iphone).
Accelerometer measures acceleration of resultant force applied to it (velocity is not a force by the way). In this case force is F = g + w + c i.e. vector sum of gravity, centrifugal force (reaction to steering centripetal force, points from the center of the turn) and car acceleration force (a force changing absolute value of instantaneous velocity, points along the velocity vector). Providing Z axis of accelerometer always points along the gravity vector (which is rare case for actual car) values of g, w and c accelerations can be accessed in Z, X and Y coordinates respectively.
Unless you are in free fall the g-force (gravity) is always measured. If I understand your setup correctly, the g-force will appear on the z axis, the axis that is vertical in the Earth frame of reference. I cannot tell whether it will be +z or -z, it is partly convention so you will have to check it for yourself.
UPDATE: If the car is also going up/downhill then you have to take the rotation into account. In other words, there are two frames of reference: the iPhone's frame of reference and the Earth frame of reference. If you would like to deal with this situation, then please ask a new question.
Let's consider a disk with mass m and radius R on a surface where friction u also involved. When we give this disk a starting velocity v in a direction, the disk will go towards that direction and slow down and stop.
In case the disk has a rotation (or spin with the rotational line perpendicular on the surface) w beside the speed then the disk won't move on a line, instead bend. Both the linear and angular velocity would be 0 at the end.
How can this banding/curving/dragging be calculated? Is it possible to give analytical solution for the X(v,w,t) function, where X would give the position of the disk according to it's initial v w at a given t?
Any simulation hint would be also fine.
I imagine, depending on w and m and u there would be an additional velocity which is perpendicular to the linear velocity and so the disk's path would bend from the linear path.
If you're going to simulate this, I'd probably recommend something like dividing up the contact surface between the disk and the table into a radial grid. Compute the relative velocity and the force at each point on the grid at each time step, then sum up the forces and torques (r cross F) to get the net force F and the net torque T on the disk as a whole. Then you can apply the equations F=(m)(dv/dt) and T=(I)(dw/dt) to determine the differential changes in v and w for the next time step.
For what it's worth, I don't think a flat disk would curve under the influence of either a frictional force (velocity-independent) or a drag force (linearly proportional to velocity).
A ball will move in a large arc with spin, but a [uniform] disk on a 2D surface will not.
For the disk it's center of spin is the same as it's center of gravity, so there is no torque applied. (As mentioned by duffymo, a nonuniform disk will have a torque applied.)
For a uniform ball, if the axis of the spin is not perpendicular to the table, this causes the ball to experience a rotational torque which causes it to move in a slight arc. The arc has a large radius, and the torque is slight, so usually friction makes the ball stop quickly.
If there was a sideways velocity, the ball would move along a parabola, like a falling object. The torque component (and the radius of the arc) can be computed in the same way you do for a precessing top. It's just that the ball sits at the tip of the top (err....) and the bottom is "imaginary".
Top equation: http://hyperphysics.phy-astr.gsu.edu/HBASE/top.html
omega_p = mgr/I/omega
where
omega_p = rotational velocity...dependent on how quickly you want friction to slow the ball
m = ball mass
g = 9.8 m/s^2 (constant)
r = distance from c.g. (center of ball) to center, depends on angle of spin axis (solve for this)
omega = spin rate of ball
I = rotational inertia of a sphere
My 2 cents.
Numerical integration of Newton's laws of motion would be what I'd recommend. Draw the free body diagram of the disk, give the initial conditions for the system, and numerically integrate the equations for acceleration and velocity forward in time. You have three degrees of freedom: x, y translation in the plane and the rotation perpendicular to the plane. So you'll have six simultaneous ODEs to solve: rates of change of linear and angular velocities, rates of change for two positions, and the rate of change of angular rotation.
Be warned: friction and contact make that boundary condition between the disk and the table non-linear. It's not a trivial problem.
There could be some simplifications by treating the disk as a point mass. I'd recommend looking at Kane's Dynamics for a good understanding of the physics and how to best formulate the problem.
I'm wondering if the bending of the path that you're imagining would occur with a perfectly balanced disk. I haven't worked it out, so I'm not certain. But if you took a perfectly balanced disk and spun it about its center there'd be no translation without an imbalance, because there's no net force to cause it to translate. Adding in an initial velocity in a given direction wouldn't change that.
But it's easy to see a force that would cause the disk to deviate from the straight path if there was an imbalance in the disk. If I'm correct, you'll have to add an imbalance to your disk to see bending from a straight line. Perhaps someone who's a better physicist than me could weigh in.
When you say friction u, I'm not sure what you mean. Usually there is a coefficient of friction C, such that the friction F of a sliding object = C * contact force.
The disk is modeled as a single object consisting of some number of points arranged in circles about the center.
For simplicity, you might model the disk as a hexagon evenly filled with points, to make sure every point represents equal area.
The weight w of each point is the weight of the portion of the disk that it represents.
It's velocity vector is easily computed from the velocity and rotation rate of the disk.
The drag force at that point is minus its weight times the coefficient of friction, times a unit vector in the direction of its velocity.
If the velocity of a point becomes zero, its drag vector is also zero.
You will probably need to use a tolerance about zero, else it might keep jiggling.
To get the total deceleration force on the disk, sum those drag vectors.
To get the angular deceleration moment, convert each drag vector to an angular moment about the center of the disk, and sum those.
Factor in the mass of the disk and angular inertia, then that should give linear and angular acclerations.
For integrating the equations of motion, make sure your solver can handle abrupt transitions, like when the disk stops.
A simple Euler solver with really fine stepsize might be good enough.