Pivot arm won't pivot
-
Hi, brand new to SP. My model is fairly simple. I want it to pivot around the pin but it just falls off.
Please see attached.
Thank you for your time.
Rick
-
Hi Rhots,
I managed to get your model to work. First click on the "UI" button. This is the 3rd icon in the Sketchy Physics menu bar. This brings up the user interface. Now click on the "joint connector". This is the 4th button on the right in the SP menu bar. Click on the pin and then hold down the "Ctrl" key on your keyboard. You should now have a plus sign next to your mouse pointer. If the plus sign does not appear try the other "Ctrl" key on your keyboard. While still holding the ctrl button click on the joint. THe joint should now be highlighted in a yellow box and in the UI inspector it should say "connected to hinge 108461". In the UI click on the black text that says "hinge 108461". It should now be highlighted in yellow and shows details of the joint. Untick the "Connected collide" box. This is necessary because the pin and the arm share the same physical space. Although there is a hole in the arm for the pin, the wireframe black box when the simulation is running shows the simulation considers the arm to be a large rectangular box with no hole. It might be better to cut off the cylinders and the ends of the pivot arms and add new ones. Group the arm. Group the new cylinders with the arm. Group the whole assembly with the joint and remake the connection. This will give a better approximation of the physical shape of the arm in the simulation for collisions. While you have the UI open you might want to set the accel parameter to 0.0 so that the arm does not accelerate continuously and shake itself to pieces. If you really want the arm to be self powered, you would be better off replacing the joint with a motor. Let me know how you get on and if this is any help.
-
Beautiful!! Now, I changed to a servo, added another servo and a piston. With your help I got them all working. Please see my new file. Is there any way to make them work simultainiously?
Thanks again!!!!
Rick
-
Have a look at the attached model and see if it is the sort of thing you are after. I have put the working mechanics in a hidden layer called "Bones" and using your original parts as a non working pretty skin for the ugly mechanical parts. The load can be lifted by using the lock servo or dragging the arm handle.
-
Sketchykev, pretty slick, two questions: how did you do that? and how do I "drag" the handle?
Thanks,
Rick -
@unknownuser said:
... two questions: how did you do that? and how do I "drag" the handle?
Thanks,
RickHi Rick,
When the simulation is running the cursor becomes a hand and you can use it drag things around by holding down the left mouse button when over the object you want to "grab". The default is to drag left, right, forward or backward horizontally but if you press shift while holding down the left mouse button you can drag things vertically. Use it to pull on the handle of your pivot arm device as you would if it were a real object.
For some reason (at least for me) this "drag" functionality disappears if you select any other functions like orbit while the simulation is running and the "grab hand" can not be reactivated. Maybe a bug?
I am not sure what you mean by "that" when you ask "how do I do that"? I am guessing you are asking how I hide the functional parts inside a skin? If so I have done a little tutorial that requires you to use the attached file. It contains two hollow boxes. The purple box looks nice because the joins have been deleted using the "Outer Shell" tool but when the simulation is running you can see that if the little red box is dragged over the hole it does not fall in, so the purple box is not behaving physically as it should. The green box behaves (because it is made of individual groups) but it does not look as nice. Sketchy Physics can not handle shapes with concave surfaces automatically so you have to break concave objects into smaller non-concave parts and group them.)
Here is how you get the best of both worlds. Select the purple box and change the state to "ignore" in the "UI" or right click and use Sketchy Physics/State:/Ignore. Run the simulation again and the red box falls straight through the solid surface of the box because it is no longer a physical object and you can not interact with it or drag it and nothing collides with it. Now with the layers menu open, make sure the "main" layer is the active layer with the radio button on the right of it highlighted. Select both the purple box and the green box and make them into a group. Now triple click on the green box so that only the green box is selected. (Triple clicking opens the group for editing.) Use the move tool to move the green box 50 units to the left so that it is exactly superimposed on the purple box. Click outside the box to close the group again. Now turn off the layer called "internal" to hide the functional green box. Now when you run the simulation the box looks nice and behaves nice with the hole acting as it should and the box can be dragged about. If you need to edit the internal box, switch off the outer layer and turn on the internal layer again.
Let me know if any of that helps or makes any sense
-
Actually what I was asking was how did you link all 3 servos to one slider?
-
@unknownuser said:
Actually what I was asking was how did you link all 3 servos to one slider?
I didn't. The slider only manipulates the lock bar. There are no other servos. Everything else follows because the surfaces are sliding and pushing against each other as they would in the real world. It is a "real" physics simulation
You could arrange for one slider to control more then one object if you really want to. Use two servos, one for each object. In the UI you will we see that each servo has a number something like slider('servo1856')in the controller box. Just change the number of the second servo to be the same as the first. This works fine if you want the two items to move by the same amount but if you want a ratio other than 1:1 it gets a bit buggy.
Another way is to use one servo on one object and an ordinary hinge joint on the other (instead of a second servo). Link the servo and the hinge joint to make a gear connection. Change the gear ratio in the UI to whatever you want. One problem is that by default the gear connection rotates one gear in the opposite direction to the other and you cannot use a negative gear ratio to fix this. You have to rotate the rotary joint axis through 180 degrees to reverse the action. Both methods allow you to control more than one object with one slider.
See the simple demo attached of one slider controlling two bars. The ratio is set so that the second bar rotates twice as much as the first with the servo. The ratio can be changed by treble clicking on the blue joint of the second bar then click on the UI icon and then change the value of the ratio in the parameters for hinge hinge1841.
-
Sketchykev, thanks. Check out my attachment. Using your idea of renaming, I used the servo slider to control the piston and the hinge. I got rid of the "gear" affect by rotating the hinge 180 deg to correct the rotation. I know it's not physically correct because the lock is too long. But the overall effect is just what I was trying to do.
I know nothing about physics, I am a CAD guy, but this is great for design. I wish I understood what it actually takes to make the parts interact correctly. For example my very first upload you looked at; why doesn't the lock physically push the arm, and the arm in turn push the block like the one you did.
I will study yours further, but I doubt I'll get it. We'll see.
Thanks again for your time,
Rick
-
Hi again Rick,
You did a good job with linking the slider with the servo. It looks almost perfect. Unfortunately the movement of the lock arm is more complicated and trying to simulate the action of the linkages with servos would be difficult even for an expert. The servo method is not the way to go as it "fakes" the physics and does not look realistic and takes things like gravity out of the equation. Anyway, I have modified you model yet again. This time the the lock arm is manipulated by the A and D keys and swings freely when not being actively manipulated. To use the model use the slider to pull the load up and use the D key to put the lock arm in place. A key to release the lock. If you turn the "Internal" and "physics joints" layers on you can see the working parts. Click on the big servo with the UI open and you can see the code for controlling the servo with the keyboard in the blue box. For more info on SP keyboard controls see http://sketchyphysics.wikia.com/wiki/Beginner.
@unknownuser said:
... I wish I understood what it actually takes to make the parts interact correctly. For example my very first upload you looked at; why doesn't the lock physically push the arm, and the arm in turn push the block like the one you did.
I will study yours further, but I doubt I'll get it. We'll see.
Thanks again for your time,
RickThe key part is that for complex parts is that what you see is not necessarily what the physics simulation thinks the shape is. Use the "Debug" feature in the SketchyPhysics right click menu to see what the simulation thinks the shape is. You need to break parts into smaller non-concave parts.
I was wondering if you use extrude or the "outer shell" method to make your parts? Either method tends to make parts that are not directly compatible with sketchy physics. There is another method to hide the unsightly joins in the parts other than the method I described earlier. It involves exploding the parts down to the individual line and faces level. Add in extra lines to divide the shape into simple non concave solids. Now treble click to select all the lines in the larger solid. Right click and select the "intersect with model" option. Now hide the join lines you do not want to see. Now group the smaller solids individually. Make the state of the small parts "convex hull". Group all the sub-parts back into one large part. Now you should have a large complex part that looks good and behaves realistically in the simulation.
-
Thanks again SK, to answer your question, I just used the "push/pull" method to make my parts. I don't know what "outer shell" is. But now I will go look for it.
Rick
Advertisement