Browse Search Popular Register Upload Rules User list Login:
Search:
4 Piston Engine Optimization

Image:
screenshot of the scene

Author: Chevelle1995

Group: Default

Filesize: 79.1 kB

Date added: 2017-03-09

Rating: 5

Downloads: 664

Views: 252

Comments: 3

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

Feel free to comment and rate... :)

oops.. forgot to add in the scene, all the scripting can be found in the little bright grey rectangle on the right side of the engine..
Last edited at 2017/03/09 03:02:58 by Chevelle1995
Please log in to rate this scene
edit
Similar scenes
Title: Thyme engine, 8 pistons.
Rating: 6
Filesize: 241.7 kB
Downloads: 1891
Comments: 1
Ratings: 3
Date added: 2009/04/24 08:59:43
Made with: Phun
Rating: rated 6
download
Title: Positive damping engine
Rating: 5
Filesize: 196.63 kB
Downloads: 471
Comments: 0
Ratings: 1
Date added: 2016/09/26 10:34:13
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: 12 piston radial engine
Rating: 7.4444
Filesize: 63.5 kB
Downloads: 1360
Comments: 7
Ratings: 9
Date added: 2008/06/28 22:18:56
Made with: Phun
Rating: rated 7.4
download
Title: Push-pull piston radial engine
Rating: 5.625
Filesize: 27.14 kB
Downloads: 604
Comments: 1
Ratings: 2
Date added: 2010/02/21 19:38:39
Made with: Algodoo before v1.8.5
Rating: rated 5.6
download
Title: 2 Piston Spring Engine Moved car
Rating: 4.875
Filesize: 49.32 kB
Downloads: 423
Comments: 0
Ratings: 2
Date added: 2012/08/25 02:27:58
Made with: Algodoo v2.0.2
Rating: rated 4.9
download
Title: DHC Engine
Rating: 8.0417
Filesize: 279.68 kB
Downloads: 2751
Comments: 12
Ratings: 18
Date added: 2010/07/19 20:34:58
Made with: Phun
Rating: rated 8
download
The scripting is actually very good, I kinda like it. You can use arrays where you measure 2 things in one place though, like

Scene.my.crank = [angle, angVel]
so when you want to know the angle you just use scene.my.crank(0) for angle and scene.my.crank(1) for angVel, and I guess that's a way to optimize the scripting

Another thing, the density is WAY too low on everything. Total mass is not really important in Algodoo, but we found out that engines actually end up with realistic weight when you use high densities. Here you're using density 8 on the pistons... use 250 or even more! Also crank the density up on the balls (be advised: on some engine designs, more than 600 on the balls generates uplift so you have to use a thruster to balance the whole thing). And I don't know if this applies anymore, but the optimal thing is to spawn a ball the size of the cylinder (40% in this case) with a lot of density.
Also select everything and put restitution to 0 on everything. it makes collisions worse

The timetoLive way to kill balls is kinda crude. pnvv used a better way using it long before, calculating with crank angVel how long the stroke will be (pretty easy: how many [milli]seconds the crank needed to do 1/2 rotation) and the ball got deleted after that. I don't know how good that was when you got a fast angvel variation, but it worked, and it was easier than the rotating killer technique and I guess more precise than the fixed killer. Try to implement that, maybe?
Oh, I see that you calculate time per 1/4 rotation, well calculate time by 1/2 rotation and use it for this

Laser spawning is always WAY worse than collision spawning. Collision spawning almost never fails as long as it's built right, and it's much easier to make. Also you can use a stretched axle and use variable ignition time to give some extra HP at high RPMs! I haven't seen variable timing on your engine but i guess it works somewhat like that

And if you use much higher densities you'll be able to get sim frequency down a lot. you know, helps with lag and stuff. 120 Hz may seem too little but I've built a 4 stroke V6 with 260 HP a 120 Hz, so you can make the engine work anyways...


One more thing: gun tech! that is pretty much what makes new engines worthwhile... use an inverted V shape made of 8 boxes (2 boxes, 4 of those for each piston) kinda where the timing thing is, that only collides with the balls. This will give you INSANE everything, RPM, torque, HP at high RPM, everything!

After you added density to the pistons, you should make the flywheel heavier. Also you can make a ring, make the flywheel light, and the ring heavy, then fixate the ring to the flywheel. this will have MUCH more inertia than just a heavy wheel
Dude!!! Thank you so much for the comment!! I'll be sure to implement these into one of my new designs I'll be making. The feedback for real means a lot.

I sort of tried making the timetolive variable with the speed of crank, using 1/4 rotations because I wanted each piston to push the crank 90 degrees further at their optimal time. It's further cut down though with vtr so the actual timetolive of each circle is only 2/3s the time it take the crank to rotate 1/4 around. I figured I mess around with the ratio of timetolive to 1/4 rotation time and see if one worked better then the other. I'll try and make each piston push for a longer period of time perhaps?

I'm definitely gonna try and make a collision spawning method instead of laser. As well as I'll be increasing the density and getting rid of restitution completely, it's currently only on the pistons and top block the circles collide in between. I'm not entirely sure how I'd go about variable ignition timing, if I'm understanding correctly that would mean the spot of fire for each piston would change depending on the rpm? It's currently set up statically so that each piston fires in the same spot already traveling downward.

And for the upwards lift on the high densities spawns, I've experienced that before, that's part of the reason I don't put them so high, but considering it'll help the performance a lot I'm going to try. Perhaps instead of thrusters I could have a second fire happen at the same time at the bottom so a piston is pushed up and one's pushed down? to counter act the upwards force? I don't like using thrusters for anything that doesn't fly lol. I will if I have to though.

I really do appreciate the feedback and ideas. I'm definitely going to try to add all the things you said.
Well it's better having domeone bring you up to speed on algo engines instead of having to look mostly by yourself in the Algotrashbin... I learnt that the hard way in the first 4 years in here.

Variable spawn timing changes the angle of the spawner assembly so that it fires slightly before the piston gets to stroke. Actually this would destroy the engine when at low RPM or high sim frequencies, but if yoir sim freq is like 120 Hz (preferred!) and you script it so that it engages at mid-to-high rpm, it gives a noticeable boost. This is because high RPMs tend to make the ball spawn one or two steps later (a step is like a frame on a game) and you lose powar. so you compensate there

For the variable spawn timing you have to make the usual circle with little circles that rotate, and each collides with a fixed circle that is a spawner. I really didn't upload many engines so i haven't got a clear example of that I think. Just look at any of pnvv's engines if you don't get me on that one.

Okay, so the circle that rotates is connected to the crankshaft (or 2:1 gear, if you want a 4stroke) with a stretched axle. Be very careful with the circles where the axle is connected: both gotta have angle 0° or at least the same angle. To avoid slipping and unsyncing you HAVE TO use bend, NOT brake (+inf brake actually slips a little after some time). In case you didn't know, bend works with radians, so you'll either have to calculate or just try numbers (which is what I do :lol: ). So use hingeConstant = 1e-30 (a little bit too excessive i know, but works), bend = true, bendConstant = +inf, bendTarget = {scene.my.whateveryouuseforangVel > something ? 0.5:0 }

The something number is the num where the VTEC kicks in. At 120 Hz you'd use probably 60 or 70. If angVel is negative then you have to use something like < -70 obviously

To get rid of the spawn drag and avoid making a 1 stroke engine (I hate those, too unrealistic <_< ) just make a Boxer... Or you can point a thruster downwards and make it activate with the acceleration key, then turning force view on (this only if your engine is mounted on a vehicle with suspension) ticking only the spring forces, and tuning the thruster so that the forces on the suspension are the same when accelerating and on idle.

Also you can use keys.isDown("w") for the accelerator. keys.isDown("") outputs true when you press the key, and false when you don't. you can use up, down, right, and left too. That way you can make an easy throttle where the spawner is, like:

density := keys.isDown("w") ? 400:5;

on the spawn script of course. This puts density 400 when holding W and 5 when not holding it


And I got carried away again...