Announcement

Collapse
No announcement yet.

[OPEN-SOURCE] Machinery Modelling Toolkit

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

    #16
    Ok, bug fixed. Now packaging works. I've added link to compiled version.

    Thank you, 0lento! I'll add this into project together with some basic GUI.
    Youtube Channel

    Comment


      #17
      Originally posted by BoredEngineer View Post
      Blueprints and custom physics don't go along too well when FPS changes from what it was during development. One of the ways to solve this is to enable physics sub-stepping. Unfortunately in 4.10 and earlier versions of UE4 we don't have an event, accessible from blueprints, which would notify us about physic update during sub-stepping so we could run our own calculations.
      Do you know if this was fixed in 4.11 or master? If not, would you mind if I try to base a fix off of this plugin?

      Comment


        #18
        Originally posted by AoiGhost View Post
        Do you know if this was fixed in 4.11 or master? If not, would you mind if I try to base a fix off of this plugin?
        I've talked to 0lento about this some time ago and we came to conclusion that as this feature is hardly documented and perhaps even experimental, we won't see it as a first citizen anytime soon.
        It would be splendid if it get's accepted! Please do! The plan is to build up components to build machines, from this perspective it would be much easier if sub-step friendly function are provided out of the box by the engine, instead of rely on plugin which have to maintained.
        Youtube Channel

        Comment


          #19
          I was looking for some real-life or sci-fi machine. Which would be not too difficult to model in the sense of code and necessary math. It's purpose is to be a sort of tutorial/example on how to use plugin. Potentially with building few components that can be re-used later on other machines. So far I've boiled it down to Hovercraft, a prototype of the real one with an air-cushion, not magnetically levitating or using thrusters to move around.
          Basic model is almost done, just need to rig the "skirt" so it could be compressed and animated:
          Click image for larger version

Name:	Hovercraft.JPG
Views:	1
Size:	32.4 KB
ID:	1100414

          Steering and moving forward will be done using the engine on the back, which can be rotated to steer left/right. Air-cushion is going to be modeled as a set of invisible primitives to provide friction with the ground and some simple animation of the skirt. The physical effect of hovering will be done with a component which will approximate air pressure at some selected point under the aircraft. Most likely we will need a couple of PD or PID controllers to help driver with steering.
          So far my only concern is adequate collision of the skirt with surrounding objects. Skirt is done as a skeletal mesh, so it can be infated/deflated and animated when hovercraft goes over obstacles. Animation can be done by placing physics primitives attached to the chassis using constraints, movement of these primitives will drive bones of the skirt, which should animate surface. For collision of the skirt itself, like when two hovercrafts collide, we can use copy of the skirt mesh as static mesh, if we set it to ignore landscape or ground then it should work.
          Youtube Channel

          Comment


            #20
            sounds neat!

            Comment


              #21
              Work in progress:
              Click image for larger version

Name:	Hovercraft_progress1.JPG
Views:	1
Size:	47.6 KB
ID:	1100530

              Compiled version is here if you want to give it a try
              https://www.dropbox.com/s/7koyioj300...craft.zip?dl=0

              Controls:
              Press 2 to posses Hovercraft
              E - will turn on "hover" engine and Q will turn it off
              WASD - to steer using the prop engine

              It's really hard to steer it, but not because of the simulation but crappy design of the hovercraft itself
              This is one of the reasons why I'm working on this project, for me personally its an ability to model some approximation of the behavior of the real machine. That's why its called Machinery Modelling Toolkit. Where Modelling stand for approximating physical behavior rather than building a detailed 3d mesh.
              But I digress, the reason why it steers so bad is because I'm and awful hovercraft designer. I decided not to copy some existing design, like this one
              Click image for larger version

Name:	PACV_SK-5_Monster.jpg
Views:	1
Size:	460.4 KB
ID:	1100531
              but try to design something simple on my own. First mistake, is that prop engine is too high above the center of mass, this creates a lot of torque from propeller thrust in tight turns and when accelerating. Second mistake is steering using single engine by rotating it, instead of having an airfoil on the tail. The difference is that tail will work even if engine doesn't provide any thrust, just by deflecting incoming air, when hovercraft is costing, like on a glider for example. But here you need to turn engine and press on throttle, which will add some extra torque that you don't want.
              Anyway, this can be a really nice use-case for adding PID controller to help user with steering.

              Feedback is very welcome, sorry for absence of GUI, I'll try to add it before next build.

              EDIT: Forgot to establish context for this post. This is the "machine" for "tutorial" on how to use MMT plugin. This hovercraft is relatively simple and has few components. Math is simple too. Prop engine is a re-usable component from Aerosled, the only custom thing here is a rigged mesh for the hovercraft skirt and an air pressure component which imitates air-cushion effect.
              Last edited by BoredEngineer; 02-14-2016, 07:29 PM.
              Youtube Channel

              Comment


                #22
                Haha nice.. it is indeed very hard to steer

                I work with Naval Architects a lot, I think I will show them this.. they will love it

                Comment


                  #23
                  Originally posted by OldRaven View Post
                  Haha nice.. it is indeed very hard to steer

                  I work with Naval Architects a lot, I think I will show them this.. they will love it
                  Very curious about feedback
                  I think I was wrong about simulation being correct - skirt produces too little friction. My friction coefficients where rather small.
                  Another thing is that there should be more control over the air pressure in air-cushion. I'm not sure, but most likely in real life, pilots can adjust the hovering effect to balance speed and control. The less contact with the ground you have the faster you can go but at the same time it's harder to steer as there is less friction of skirt with the ground/water. Right now you can do something like emergency brake by shutting down hover engine. From videos of the real craft they seam to operate it in similar way. Right before it vehicle stops, cushion gets a bit deflated so you get more friction with the ground and you stop faster.
                  Youtube Channel

                  Comment


                    #24
                    Experimenting with different shapes for collision elements of the skirt. Up-side-down pyramidal prisms are working better than capsules, they can go over higher obstacles and movement is more smooth.
                    Added ability to change throttle of the hover engine. At 60% of engine power can be used as emergency or parking brake. At 70% percent, friction drops enough to start moving around but at the same time you have much better control over steering. At 100% you can get the maximum of acceleration but fiction is too small to steer effectively:
                    Click image for larger version

Name:	Hovercraft_progress2.JPG
Views:	1
Size:	20.2 KB
ID:	1100632

                    Compiled version:
                    https://www.dropbox.com/s/7koyioj300...craft.zip?dl=0

                    Prop engine is placed much lower, this should minimize torque around Y axis.
                    We need two controllers to steer this efficiently. One would be a PID controller to help pilot with maintaining a direction in which he wants hovercraft to move. Second controller will detect when steering is inefficient because of luck of friction and will power done hover engine until control is restored.
                    Last edited by BoredEngineer; 02-16-2016, 05:15 AM.
                    Youtube Channel

                    Comment


                      #25
                      @BoredEngineer : Can you pm me your e-mail adres? I want to ask you something.. somehow I don't think you have pm notifications turned on

                      Comment


                        #26
                        Replied about an hour ago, did you received it?
                        Youtube Channel

                        Comment


                          #27
                          Originally posted by BoredEngineer View Post
                          Replied about an hour ago, did you received it?
                          ah yes, got it! thanx

                          Comment


                            #28
                            Originally posted by BoredEngineer View Post
                            Experimenting with different shapes for collision elements of the skirt. Up-side-down pyramidal prisms are working better than capsules, they can go over higher obstacles and movement is more smooth.
                            Added ability to change throttle of the hover engine. At 60% of engine power can be used as emergency or parking brake. At 70% percent, friction drops enough to start moving around but at the same time you have much better control over steering. At 100% you can get the maximum of acceleration but fiction is too small to steer effectively:
                            [ATTACH=CONFIG]78870[/ATTACH]

                            Compiled version:
                            https://www.dropbox.com/s/7koyioj300...craft.zip?dl=0

                            Prop engine is placed much lower, this should minimize torque around Y axis.
                            We need two controllers to steer this efficiently. One would be a PID controller to help pilot with maintaining a direction in which he wants hovercraft to move. Second controller will detect when steering is inefficient because of luck of friction and will power done hover engine until control is restored.
                            interesting.. indeed It handles pretty good when hoover throttle is at 70% .. lower and it's hard to move.. put it to 100% and it becomes very hard to keep under controll.
                            I wonder how they do this with real hovercraft.. doe they also have a sort of hoover throttle?

                            Comment


                              #29
                              Originally posted by OldRaven View Post
                              interesting.. indeed It handles pretty good when hoover throttle is at 70% .. lower and it's hard to move.. put it to 100% and it becomes very hard to keep under controll.
                              I wonder how they do this with real hovercraft.. doe they also have a sort of hoover throttle?
                              Most likely they do control it as long as they use friction with the ground to assist in steering. Like when you enter a turn and vehicle starts to slide sideways. Some of the hovercrafts have additional systems for steering, for example this one:

                              has two curved tubes in front part, they are placed right on top of the main engine and exhaust from them is used for steering. Those tubes can turn independently from the rudders at the back. I've heard that there are other systems which release part of the air through the series of vents in the skirt, which allows to move vehicle in any direction regardless of it's orientation. Small racing hovercrafts can be steered by the driver, simply by leaning into different directions, which moves center of mass and add both torque and sideways force.
                              Attached Files
                              Youtube Channel

                              Comment


                                #30
                                I've added PID Controller to MMT as one of re-usable components. It can be used to help with steering of physically controlled bodies.
                                This is a simple example where aerosled's chassis is rotated by output of PID controller, to keep orientation with red arrow. Red arrow is turning using user input. The rotation is done using AddTorque() and chassis has no friction on it, so imagine how hard would it be to control it if you apply torque manually using keys.


                                Applications are numerous, for example if you have a physics based vehicle and you want AI to drive in a certain direction, PID controller can steer a wheel for you. Or maybe you have a spaceship or helicopter and you want to turn it to face specific direction. For something like a hovercraft you can control the output of the hover engine to maintain specific altitude. Keeping vehicle on cruising speed or restoring a balance of a platform. Some of these things can be done using "springs" but PID controller exhibits more "intelligent" behavior. In practice it's a very simple mathematical construct and you can read more about them here: https://en.wikipedia.org/wiki/PID_controller
                                Last edited by BoredEngineer; 02-18-2016, 11:35 AM.
                                Youtube Channel

                                Comment

                                Working...
                                X