Announcement

Collapse
No announcement yet.

[OPEN-SOURCE] Machinery Modelling Toolkit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Click image for larger version

Name:	ice_screenshot_20160620-204415.png
Views:	1
Size:	365.5 KB
ID:	1108687

    hey Viktor,

    Here's a start with the wheel setup.

    Do you have a simple way of copying an entire Hierarchy for a wheel?
    As you can see when you look at 1 roadwheel setup.. it's Hierarchy is like this.

    -SuspensionRight_01 (Scene component)
    ---SuspensionArmRight_01 (Static mesh with collision volume and collision enabled)
    ------SuspensionArmRight_01PC (This is the Physics constraint holding the suspension arm to the Hull, This one has the angular drive enabled and is limited in Y only, rest is locked)
    ------RoadwheelPhysicsRight_01 (Physics Collision mesh for the Wheel, collision and physics enabled)
    ---------RoadWheelVisualRight_01 (Static Visual Mesh)
    ---------RoadWheelPhysicsRight_01PC (This is the Physics constraint holding the Roadwheel to the SuspensionArm
    ---------RoadWheelPhysicsRight_01TAF (This is the track Anisotropic Friction component)

    The Tiger has 16 of these road wheels, and If I cannot duplicate the entire wheel Hierarchy .. it's going to be a hell to setup and tweak.

    For now I added simple Cylindrical Physics Collision Wheels.. I will replace them later with a better shape. I just need to get all the wheels working and suspension functioning first.

    Comment


      Originally posted by kyillene View Post
      I used MMT plugin to move Abram M1 tank and build a firing system on top of it. Here you can see some basic main turret firing in action. Thanks for the great plugin boredengineer (and of course everyone else who spent some time on this)

      https://www.youtube.com/watch?v=nC3IFgtsa-Q
      Nice work! Happy to see the results

      Originally posted by OldRaven View Post
      I'm starting to move the wheels,idler and sprocket in the new modular setup. Am creating a suspension arm since I want to set it up like a real torsion bar suspension. just have to check all my technical drawings for the dimensions and location.
      I see now what you mean with the angular motor in the Physics Constraint.. this is a great way for now to do the Torsion bar. Do you have plans to turn these constraints into some sort of MMT node as well? Or do you keep using the physics constraints that are in UE4 right now?

      I also have sound clips now for the maybach engine.. starting sound, idle, rev up, etc. Just need to figure out where to put them.. If you have any suggestions based on the outputs of the various engine and transmission nodes.. just let me know.
      I know sound comes later..

      Peter
      For the torsion bar I haven't decided yet. Most likely there will be a separate component as there is one for springs, but I haven't decided yet on all of the implementation details for it. Physics constraints should be working fine for this purpose, the only issue with them is that they press on wheels with the same force as on chassis, which is physically correct but can lead to some undesirable effects. In any case, it will be easy to replace them.

      With sounds situation is following - if you check modular drive train (press 8 to posses) it has sounds on everything except tracks and rotation of sprocket/roadwheels. It's very easy to add even more sounds and I'm pretty sure it can be done much better than what I did as I have little experience with it. For an "arcade" version of tank they can be added too, like sound of engine can be driven just by throttle, I think this is how it's done in WarThunder and it seams to be working just fine.


      Originally posted by OldRaven View Post
      [ATTACH=CONFIG]98555[/ATTACH]

      hey Viktor,

      Here's a start with the wheel setup.

      Do you have a simple way of copying an entire Hierarchy for a wheel?
      As you can see when you look at 1 roadwheel setup.. it's Hierarchy is like this.

      -SuspensionRight_01 (Scene component)
      ---SuspensionArmRight_01 (Static mesh with collision volume and collision enabled)
      ------SuspensionArmRight_01PC (This is the Physics constraint holding the suspension arm to the Hull, This one has the angular drive enabled and is limited in Y only, rest is locked)
      ------RoadwheelPhysicsRight_01 (Physics Collision mesh for the Wheel, collision and physics enabled)
      ---------RoadWheelVisualRight_01 (Static Visual Mesh)
      ---------RoadWheelPhysicsRight_01PC (This is the Physics constraint holding the Roadwheel to the SuspensionArm
      ---------RoadWheelPhysicsRight_01TAF (This is the track Anisotropic Friction component)

      The Tiger has 16 of these road wheels, and If I cannot duplicate the entire wheel Hierarchy .. it's going to be a hell to setup and tweak.

      For now I added simple Cylindrical Physics Collision Wheels.. I will replace them later with a better shape. I just need to get all the wheels working and suspension functioning first.
      Unfortunately I haven't found an easy way to copy components, UE4 does rather bad job in this respect, it doesn't auto-iterate names and looses hierarchy when you copy a set of components. It took me more than a day to assemble T-26 fully because of this.
      I was looking into options where components would be added in constructor from some sort of configuration, but there is issue with it too - OnComponentHit events have to be assigned manually, there might be some way to do it from c++ but I'm not sure how to do it properly and still be clear for BP.
      The fastest and safest way was to copy components one by one, drag them into new position and rename.

      Hierarchy looks fine except Physics Constraints, place them on the same level of hierarchy as the 2-nd component that they connect. Meaning SuspensionArmRight_01PC should be a child of SuspensionRight_01 (Scene Component) and RoadWheelPhysicsRight_01PC make a child of SuspensionArmRight_01 (Static mesh with collision volume and collision enabled). I know that in T-26 I did it differently but I don't think that it's the right way as in such case constraint is moving together with object it constraints.

      I want to test if it's possible to use Skeletal Meshes as elements of the suspension, something like all collision and visual components of a single suspension stack would be a single static mesh. I don't think it will work but if it does it will save a lot of this labor.
      Youtube Channel

      Comment


        Thanx,

        I would not bother with Skeletal meshes just yet.
        I like the fact that you add all meshes as seperate objects in the blueprint.
        Doing that with a skeletal mesh makes it more of a hastle to prepare everything.. since you must make sure everything is setup right in Modo already.

        With the current way it is very easy to start setting up everything without having the final model ready.
        Just like I'm currently setting it up with low resolution standin objects.. and can later replace the parts with the Final Highres geometry as I move along.

        I changed the Hierarchy with the constraints.. and will just continue manually copying and renaming the rest of the wheels.

        I'll report back when the wheels are in place.

        Comment


          This is the current wheel hierarchy for the Tiger

          Click image for larger version

Name:	ice_screenshot_20160620-232342.png
Views:	1
Size:	8.8 KB
ID:	1108700

          Comment


            Originally posted by OldRaven View Post
            This is the current wheel hierarchy for the Tiger

            [ATTACH=CONFIG]98590[/ATTACH]
            This should be fine.
            Youtube Channel

            Comment


              Originally posted by BoredEngineer View Post
              This should be fine.
              I have all the wheels and suspension connected.

              btw, do you have tips for what to do with weight of the physics objects?

              The full tiger is like 60 tons, I now have the hull set to 10000 kg
              I see the Physics constraints have trouble holding all that weight.

              Here's how I setup the TorsionBar Constraint

              Click image for larger version

Name:	ice_screenshot_20160621-195934.png
Views:	1
Size:	39.4 KB
ID:	1108782

              Enables Angular Orientation Drive.

              The angular Position Strength is now set to 100000 <--- what does this value mean?

              Should I increase this one to make the suspension stiffer?

              -----

              What is the next step now that all the wheels are connected?

              Comment


                o wait.. I can start with the first friction function

                Comment


                  Originally posted by OldRaven View Post
                  I have all the wheels and suspension connected.

                  btw, do you have tips for what to do with weight of the physics objects?

                  The full tiger is like 60 tons, I now have the hull set to 10000 kg
                  I see the Physics constraints have trouble holding all that weight.

                  Here's how I setup the TorsionBar Constraint

                  [ATTACH=CONFIG]98736[/ATTACH]

                  Enables Angular Orientation Drive.

                  The angular Position Strength is now set to 100000 <--- what does this value mean?

                  Should I increase this one to make the suspension stiffer?

                  -----

                  What is the next step now that all the wheels are connected?
                  Don't forget velocity drive, otherwise wheels will be shaking:
                  Click image for larger version

Name:	Torsion_bar.JPG
Views:	1
Size:	57.8 KB
ID:	1108787
                  Swing Limit Soft should be off too, there was some sort of limitation when it's turned on, don't remember right now.

                  Angular Position Strength is a stiffness of the spring, set tank to it's proper mass and tune this value up until you get proper clearance - distance between bottom of chassis and the ground. This is where I don't like physics constraints as springs - if you change angle limit you have to tune Position Strength and Velocity Strength again, the wider allowed angle the more force you need.
                  The estimate for the spring strength is something like this:
                  Mass of tank in kg * acceleration due gravity / amount of wheels.
                  60000 * 980 /16 = 3675000 would be a basis.

                  Btw, in case you don't know, you can multiselect all your suspension physics constraint by ctrl+left click in the list and then any change of parameters will be applied to all of them.
                  Youtube Channel

                  Comment


                    so the estimated Angular Position Strength is calculated by

                    Mass of tank in kg * acceleration due gravity / amount of wheels

                    How do you determine the Angular Velocity Strength? You have it set to 5000.. where did that number come from?

                    When I enter the estimated Angular Position Strength and set the weight of the hull to 50000kg , the torsionbars don't hold the weight

                    Should I then set the Angular Position Strength higher or the Velocity Strength? Or Both?

                    I created the ResetFrictionPoints Function, so guess now it's time to add the Update Friction function?

                    Comment


                      Originally posted by OldRaven View Post
                      so the estimated Angular Position Strength is calculated by

                      Mass of tank in kg * acceleration due gravity / amount of wheels

                      How do you determine the Angular Velocity Strength? You have it set to 5000.. where did that number come from?

                      When I enter the estimated Angular Position Strength and set the weight of the hull to 50000kg , the torsionbars don't hold the weight

                      Should I then set the Angular Position Strength higher or the Velocity Strength? Or Both?

                      I created the ResetFrictionPoints Function, so guess now it's time to add the Update Friction function?
                      Angular Velocity Strength is a dampener, on my own springs it's usually about 1% of stiffness value. You have to find it experimentally, when it's too low suspension will wobble, when it's too high it will jump erratically or stop it's motion very rapidly.
                      Try higher values for Angular Position Strength, if you can't find such that won't allow spring to compress at all then something is wrong with settings.

                      Tuning is in two steps, you set something like 1 for Angular Velocity Strength (just so that it's not a zero) and that approximation from formula for Angular Position Strength. If suspension doesn't hold then make Angular Position Strength 10 times bigger. When it's too much you will see that it won't bend at all, then return it back to previous value and make it 5 times stronger instead of 10 and etc. until you get to something that looks right clearance wise.
                      After this you can tune Angular Velocity Strength until tanks doesn't wobble after landing on wheels.

                      Have you created and connected all OnComponentHit events already? Those need to be done before UpdateFriction otherwise you can't test it.
                      Youtube Channel

                      Comment


                        One thing that could be giving you troubles is a position of the torsion bar in relaxed state - it should form something like 70-80 degrees angle with chassis. So when it's compressed under the weight and angle of torsion bar is about 10 degrees, the torsion bar will be producing a lot of force - necessary to handle the weight. I could make a diagram if this is confusing
                        Youtube Channel

                        Comment


                          Originally posted by BoredEngineer View Post
                          One thing that could be giving you troubles is a position of the torsion bar in relaxed state - it should form something like 70-80 degrees angle with chassis. So when it's compressed under the weight and angle of torsion bar is about 10 degrees, the torsion bar will be producing a lot of force - necessary to handle the weight. I could make a diagram if this is confusing
                          Currently the Torsion bars are at a 15 degree angle from horizontal position in rest state.. and for now I have set the max travel to 15 degrees.

                          I will first create and connect all the OnComponentHit events first.

                          As soon as it is more or less mobile I will play with the suspension settings and weight to get that right.

                          Comment


                            Originally posted by OldRaven View Post
                            Currently the Torsion bars are at a 15 degree angle from horizontal position in rest state.. and for now I have set the max travel to 15 degrees.

                            I will first create and connect all the OnComponentHit events first.

                            As soon as it is more or less mobile I will play with the suspension settings and weight to get that right.
                            This could be a part of the problem. I think I have the same issue on T-26, just haven't thought about it.

                            If it's default position is 15 degrees and this is where you get necessary clearance then you never going to get it. Unless you set position strength to some ridiculously high number such that deviation by just 1 degree produces force necessary to hold tank. Which means that at 2 degrees force will be so high that tank will go flying.

                            Default position can be something like 30 degrees or higher, then allow constraint to move 30 degrees too (+-15) if you want 15 degrees to be "normal" position under weight. This way you will have 15 degrees of compression for the force to actually act and you can tune it such that at midpoint (15 degrees) you have exact amount of force necessary to support tank.
                            I don't know how Angular Position Strength is scaled over the range of freedom that object is allowed to move. But I would expect that full amount of Angular Position Strength is used only at the last points of the range. Let's say that default position for the handle is 15 degrees and physics constraint is allowed to move by 40 degrees. It means that handle can go as far as -5 to 35 degrees (+-20 from 15). The force of the spring, will be equal to Angular Position Strength only near -5 and 35 degrees, everywhere in the between it will be smaller and it will be zero at the center, 15 degrees in our case.
                            This means that you have to deflect handle of suspension to a much higher degree by default, so that when it get to 15degrees of "desired" deflection you already have enough of Angular Position Strength to hold the tank.
                            Youtube Channel

                            Comment


                              Click image for larger version

Name:	ice_screenshot_20160622-155434.png
Views:	1
Size:	645.2 KB
ID:	1108857

                              Here's all the wheels, idler and sprocket attached to the hull with constraints.
                              This should also somehow be the rest position when it "lands" on the ground.

                              I did setup the Torsion arms just like the real tiger where on one side they are all leading, and on the other side they are all trailing.

                              Hooking up OnComponentHit events as we speak.

                              Comment


                                Originally posted by OldRaven View Post
                                [ATTACH=CONFIG]98886[/ATTACH]

                                Here's all the wheels, idler and sprocket attached to the hull with constraints.
                                This should also somehow be the rest position when it "lands" on the ground.

                                I did setup the Torsion arms just like the real tiger where on one side they are all leading, and on the other side they are all trailing.

                                Hooking up OnComponentHit events as we speak.
                                Yeah, then you will have to rotate them, but this should be simple. Just select all of your handles and add roll value in rotation.

                                For UpdateFriction either wait when I post a short guide on it or simply copy the code from T-26. It's relatively simple:
                                1) We need to calculate total amount of friction points in contact with ground. This is where local integer variable is used Num_Friction_Points or something like that. The most important is for it be local.
                                2) Then we have two sequence branches, each for each side of the tank. We just need to fetch velocity of the track from "TrackProcessor" (?) on corresponding side and pass it to friction component.

                                I need to look into "track processor" to describe it's input parameters but feel free to add them already. Look at the bottom of the list in T-26 components.
                                Youtube Channel

                                Comment

                                Working...
                                X