Outerra forum

User mods, screenshots & videos => Vehicles => Topic started by: giucam on June 11, 2013, 04:23:09 pm

Title: Yamaha YZF-R1
Post by: giucam on June 11, 2013, 04:23:09 pm
After many days of working on it i decided to release an early version of the first bike for Outerra :)

(http://i.minus.com/dtFdgkrMmvAx6/screen_1370981105.jpg)
(http://i.minus.com/deT6FUNIZvTZc/screen_1370981054.jpg)
Gallery (http://min.us/mbkXBRQCdZ4Yle)

The script uses a PID controller (PD only actually, i'm not using the I yet) to steer the handlebars and keep the bike balance. It works quite good below 50-60 km/h, going over it may induce an oscillation which makes the bike fall, and which i can't get rid of.
When you spawn it you have a couple of seconds to make it run before it falls, by which you can recover only by resetting it (Alt+r). There's no center/kick-stand. :)

It has no sound, nor it has any real motor code, it just applies a constant force. My focus for now is only on the balance.

Download (https://www.dropbox.com/s/4xzwh6v8nkaviov/Yamaha%20YZF-R1.giucam.otx)
Title: Re: Yamaha YZF-R1
Post by: M7 on June 11, 2013, 04:59:01 pm
very interesting!
Title: Re: Yamaha YZF-R1
Post by: Atrax on June 12, 2013, 04:20:14 am
Pretty cool, glad someone is working on bikes too. Great stuff!
will try it out :)

Thank you!
Title: Re: Yamaha YZF-R1
Post by: zaelu on June 12, 2013, 04:40:53 am
great!

A dirt bike would be also nice for Outerra.
Title: Re: Yamaha YZF-R1
Post by: bugsblake on June 13, 2013, 10:24:00 pm
thanks for the download! just wish it would stay up long enough to enjoy. i look forward to the new added features that will help this thing stay up! :)

till then im just gonna cheat and import a quad bike or 2! ;)
Title: Re: Yamaha YZF-R1
Post by: Bartolomeus on June 14, 2013, 04:02:49 am
Awesome. Great work on the bike model, looks really nice.

Marko
Title: Re: Yamaha YZF-R1
Post by: Denime on June 20, 2013, 06:22:36 pm
Really liking this mate, I love the R1! Please make it able to go quick whilst remaining stable?
Title: Re: Yamaha YZF-R1
Post by: giucam on June 21, 2013, 05:06:14 am
Well, now i've been sucked into other things, but all my tries were not successful to make it run stable at high speeds. I guess the problem is that the physics simulation treats the bike as a single body, while the physics of the front wheel and the steer alone plays a major role in making a bike stable. I've tried to emulate it in the js but it didn't change much.
Title: Re: Yamaha YZF-R1
Post by: ZeosPantera on June 21, 2013, 01:11:56 pm
Yeah the wheels need to have weight, rotate and act as a gyroscope to stabilize the bike.
Title: Re: Yamaha YZF-R1
Post by: giucam on June 21, 2013, 01:42:01 pm
Actually the gyroscopic forces are not what keep a bike upright. They help, but they are an order of magnitude inferior to the gravity and the centrifugal force.
Title: Re: Yamaha YZF-R1
Post by: cameni on June 22, 2013, 01:56:20 am
Have you found a doc describing the forces? Maybe we could implement a constraint representing how the driver helps balancing the bike.
Title: Re: Yamaha YZF-R1
Post by: giucam on June 22, 2013, 10:35:00 am
The wikipedia has a good qualitative article here (http://en.wikipedia.org/wiki/Bicycle_and_motorcycle_dynamics) .

Basically, a running bike stays upright because the driver manages to move it always below himself, by steering left or right. There are bikes more stable than others though, and that depends on the trail (http://en.wikipedia.org/wiki/Bicycle_and_motorcycle_geometry#Trail). A positive trail makes the front wheel steer into the lean, and helps keep the bike stable, even without a rider. A bigger trail makes a bike more stable, but also more difficult to steer. I think that is what is missing here. Currently it has 0 trail, i tried to emulate it in the js but without much success.

Another problem, i think, is that i can only set the steering value, and that will be applied the next frame. It is like pushing the handlebars of a real bike with an infinite force, and it's not much realistic. I think having a way to steer the wheel with a certain force would help.
Title: Re: Yamaha YZF-R1
Post by: KWUEST on July 26, 2014, 11:14:45 am
How ever they did it back in Motor cross madness 2, was so much fun

https://www.youtube.com/watch?v=kD74MVru1Yc#t=108 (https://www.youtube.com/watch?v=kD74MVru1Yc#t=108)
Title: Re: Yamaha YZF-R1
Post by: M7 on March 27, 2015, 10:31:15 am
I want to revive this one from the dead. Back in the days , i tried to ride it with keyboard and could go past 20-30 kmh  but now i'd like to see how it drive with an xbox controller. One problem ... it's sinking upon spawning :(  I got the same thing with other older model like  bugsblake's mustang. I'd like to know what part of the js script makes models sink.

The front wheel here  seems to want to stay above ground but all the rest wants to go down.

(http://i.imgur.com/1VbwDw0.jpg)
Title: Re: Yamaha YZF-R1
Post by: PytonPago on March 27, 2015, 10:52:07 am
id say its the tire-width ... i had to do tiny wheels for the ZU- and found out, that ya need some thick stuff wheels, if ya dont use 4 wheel configuration (even 3-wheel can be an issue when the centre of mass is at some not favorable places compared to the wheel locations).
Title: Re: Yamaha YZF-R1
Post by: M7 on March 27, 2015, 11:01:24 am
I tried playing with the tire width and it doesn't seems to affect the sinking, Actually the tires looks like they want to stay above ground. It's the bike body that is pulling down.
Title: Re: Yamaha YZF-R1
Post by: PytonPago on March 27, 2015, 11:27:26 am
Yea ... tried it myself now, now i suspect the importer generated collision mesh, wheel placing and the center of mass are wrong. I think he doesnt like the colision-mesh being at a almost equal level as the wheels (or ewen below them) and confusing him in where or what to drop to ground level ? Id like to see the model in blender or .obj format for this.
Title: Re: Yamaha YZF-R1
Post by: cameni on March 27, 2015, 11:35:46 am
Sinking bodies usually mean a problem with mass vs. the suspension parameters.
Title: Re: Yamaha YZF-R1
Post by: PytonPago on March 27, 2015, 12:20:10 pm
Thanks cameni !

Id found no other way as setting it to a 8 tonn machine with power and braking force set accordingly ... i dont think anything under 2-3 tonns is sufficient as a less than 4 wheel thing.

Still, you can ride only on road   ... any bump and its jumpy-time  ... any too-much angled turning and its jumpy-time ... any even slight drive ower the edge of the road and its jumping-time ...

Give it fuel right after spawning !! (a second later and it flips ower)

Also, the gyro should be somehow tweaked, it isnt bad, but when ya brake, its wiggeling too much ...

Front wheel-animation should be done a compleetly other way - the wheel mesh souldnt be used as a wheel in script (the problem is, script-used wheel meshes are oving just along the Z axis (up-don direction) and so cant be really used on suspensions of other than straight vertical configurations), but just animated properly on an empty mesh used as one. Whyle the mesh should be bound on the steering-stick mesh and set to move along the suspenders ...





  .... .... maybe, just maybe, it could work on a much lighter weight, but perhaps the intensity of the gyro-script forces is too much on a 150 KG vehicle level (it seems to me it wants to stabilize it, but such light objects will be forced ower much too rapidly to counter itself from owerdoing it), still i cant find any sufficient wheel-parameters for such light objects to not bounc around too much.  I wonder how we make a mountainbike. :O
Title: Re: Yamaha YZF-R1
Post by: M7 on March 27, 2015, 12:29:01 pm
Thanks Cameni! it rides nicely over the alsphalt now. That's  the parameters i use now.

    var front_wheelparam = {
        radius: 0.29,
        width: 0.30,
        suspension_max: 0.02,
        suspension_min: -0.02,
        suspension_stiffness: 50,
        damping_compression: 0.6,
        damping_relaxation: 0.01,
        slip: 2.9,
        roll_influence: 0.1,
        rotation: -1
    };
   
    var rear_wheelparam = {
        radius: 0.33,
        width: 0.30,
        suspension_max: 0.02,
        suspension_min: -0.02,
        suspension_stiffness: 50,
        damping_compression: 0.6,
        damping_relaxation: 0.01,
        slip: 2.9,
        roll_influence: 0.1,
        rotation: -1

 With the xbox controller it's better to set  with a lot dampened sensitivity and a good dead zone. It doesn't turn easaly but it does at low speed.
Too bad Giucam got stopped by some limit of the engine, it's actually pretty cool to see it moving and the physics seems about right.
Title: Re: Yamaha YZF-R1
Post by: josem75 on March 27, 2015, 01:33:50 pm
Edit: now instaled correctly
Title: Re: Yamaha YZF-R1
Post by: M7 on March 27, 2015, 01:48:14 pm
I lowered the CoG and it's quite stable now. Still hard to turn but i'm sure it's possible to resolve that as well within js script

https://www.youtube.com/watch?v=Pizzhom0HVE&feature=youtu.be (https://www.youtube.com/watch?v=Pizzhom0HVE&feature=youtu.be)
Title: Re: Yamaha YZF-R1
Post by: josem75 on March 27, 2015, 02:08:07 pm
Maybe we should ask that guy?  Jumping in outerra all over the mountains and roads, this is why the bikes should be made for in Outerra..

Video coming from this Bullet forum  http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=4941
https://www.youtube.com/watch?v=aB-JVW0fsXM#t=10
Title: Re: Yamaha YZF-R1
Post by: PytonPago on March 27, 2015, 02:51:47 pm
  ... i just thinking ... Cameni, whats actually happening when a vehicle hits the ground in a non-wheel manner ? ... is it like a rubber-balls deflection, or is there some force portion taken away ?  ... also, how do wheels react when they hit the ground upside down ? ...


 ... i think , if not a collision mesh, maybe placing few miniature wheels all ower the body might keep it from flippin around when it falls ower ... but yet, wheels work just on the verical (model main Z) axis ...

If this would be solved (it not panicking after getting off wheels), then there could be some special adition to the gyro, so it would stop all forces on it (in a second or two of uncontrolled spinning) and get it up straight, waiting, till ya give it some gas again ...