A bit of context first. I'm trying to model an RC plane, using blender as a kind of CAD software:
In the process, I try to model the actuators, i.e. rudder, elevator and ailerons. I did manage to rig the tail unit using some IK chains, but I am stuck with the ailerons control.
The idea is to have the servo arm command the ailerons movement. The mechanical system has three components:
- a servo arm (blue)
- a crank (brown)
- two symetrical aileron command rods (silver)
First, the servo arm rotates (1), pushes the crank through a rigid link (2), forcing it to rotate too (3).
This part is easily rigged with a couple of bones.
Second, each aileron command rod slides into its crank slot (4), thus being forced to rotate along its only free axis (5).
- a typical servo has a +-45° course, while the ailerons might have another (+20°/-15° in my case, if I want to mimic the real plane). Since aerodynamic constraints do no scale well, I would rather make provisions for other values.
- aileron movement is asymetrical, i.e. the deflection is greater upwards than downwards. Having a limited downward course helps preventing adverse yaw.
- aileron hinge direction is dictated by wing geometry, and is not aligned with any global axis. The difference is about 6° on Y and 4° on Z.
- the aim of the rig is to provide me with the key locations needed to design the crank: main axis, aileron rod slots and servo linkage hole.
In real builds, most of the time, you can approximate this movement by a simple rotation (assuming the contact point between the crank and the rod is stationary, which would require it to travel on a plane/cone intersection, i.e. an arc of hyperbola approximated by a circle). Small mechanical adjustments will take place to compensate (the structure or rods will move or warp slightly, at the cost of more strain on the servo and a small loss of precision).
I could live happily with that, but I find it interesting to see how blender would allow to produce a more accurate solution.
The crank/aileron rod movement is rather complex, being a composition of rotation and translation that depends on the relative positions of the crank and the rod (which, again, are not aligned in any way).
I figure the key is the contact zone between the crank and the rod. If I could get an empty to follow it as the crank rotates, the rest would be easy.
As far as geometry is concerned, this zone can be approximated (neglecting thicknesses) as the point of intersection between the crank slot (whose shape can be chosen arbitrarily within certain limits, though assuming it's a fixed point is bound to produce some degree of approximation) and the cone swept by the rod end as it rotates around its axis.
Servo position is likely to change, mainly on the Y axis, to balance the plane's CG
Aileron command rods geometry is highly constrained. The only parameters you can play with is the hinge length (as long as it fits within the fuselage) and the angle/length of the upwards end.
The crank is the main variable part.
- It can be placed at any height and should be as large as possible (larger means more precision), so I bet the sweet spot is near the height where the fuselage is broadest.
- The link with the servo must be symetrical, so that both ailerons have a proper opposed motion. Playing on the distance from the axis allows to change the rotation course of the crank.
- The slots guiding the aileron rods can have an arbitrary shape, though a straight line is preffered (the part is quite small considering the plane scale and is supposed to be cut out of thin plywood by hand, so a complicated shape would be difficult to reproduce precisely).
- Their lateral offset from the crank's axis will define the proportion of upward/downward motion. This can be calculated approximately with a couple of arccosine, but I'll be happy to tune it manually by trial and error.
Any idea how to tackle this problem?
some contributor posted an interesting answer in another thread I posted trying to come up with a more general problem, though it did not fully answer this question (here I need a cone-line intersection, but having a practical means of intersecting two lines would get me closer to the solution). The answer is still useful as an elegant approximation.
The trick is, the contact "point" between rod and crank (neglecting thicknesses) is neither stationary relative to the rod nor the crank, so any solution using a fixed empty parented to the rod or the crank is bound to be inexact. It will either position the rod outside the slot or deform/displace it at some point of the trajectory.
the suggestion of letting the rod slide along its axis and somehow compensate for it might be worth a try. Still, the problem is, the rod main axis (i.e. the aileron hinge) has no alignment with the crank axis : it is rotated about Y by wing dihedral and about global Z by the slanted wing shape, so any trigonometry would have to consider some vector cross product, not just an angle along some global axis. Same goes for the rod end, which can have an arbitrary orientation relative to the hinge.