1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice
Like RaceDepartment on Facebook.

Generic Models problem

Discussion in 'Racer Problems & Fixes' started by boomer541, Jan 27, 2011.

  1. Problem with suspension generic models:
    From racer webpage, "Generic models for vehicles" swingarm example.
    ;Suspension LF Bottom Arm
    model1
    {
    file=left_frnt_susp001.dof
    from=x y z ; x=+left/-right y=+up/-down z=+fwd/-back?????
    ; from=susppos0
    from_offset=x y z ; x=+left/-right y=+up/-down z=+fwd/-back?????
    to=wheelpos0
    ; Bring to centerline
    to_offset=x y z ; x=+left/-right y=+up/-down z=+fwd/-back?????
    fit=0
    scale=1.0
    }
     
    generic.jpg
    What values from the example go where to put it in the same place as it was drawn on the body.dof? I've tried just about every combination to no avail. HELP, Please.
     
  2. Is the generic model centered and 1m long or whatever the standard is?
    I would ASSUME that from and to are the main vars and the _offset values are there to fudge it if it looks wrong.

    Your image is a little confusing. Though if your model's nullpoint (not the car nullpoint) was at the centre line my values would be:

    Code:
    model1
    {
    file=left_frnt_susp001.dof
    from= -0.005 1.182 -0.04
    ;from_offset=x y z 
    to=wheelpos0 ;(assuming it terminates at the wheel center, alternatively -0.61 1.273 -0.04)
    ; Bring to centerline
    ;to_offset=x y z
    fit=0
    scale=1.0
    }
    
    Though it's hard to say without a proper test. You could also ignore the z values and put them in the offset if you'd like.
    To be honest I'm not 100% sure but that's what makes sense to me. Just make sure your generic model is centered to the origin in modeler.exe
     
  3. Think of how the SMD cameras work and it will make sense.

    Alex Forbin
     
  4. Stereo

    Stereo
    Premium Member

    Yeah,
    from= x y z -> offset from the nullpoint (left/right, up/down, front/back)
    from= susppos1 -> use that carpoint
    from_offset= x y z -> offset from the carpoint mentioned - using 'show carpoints' script helped with tuning this.
    Same applies to 'to' and 'to_offset'.

    If 'from' is an x y z position, it doesn't need a from_offset.

    fit=1 means the ends of the object (at 0,0,0 and 0,1,0, I think) will be put exactly at the two points.
    fit=0 means the end of the object at 0,0,0 will be put at from (plus from_offset), and it will be pointing at 'to'.
    When fit=0, scale just affects the size of the model.

    In the example, if you want it to be a stationary object, you'd put the coordinates in from and to. If one end's attached to the wheel, you need to figure out the offset from the centre of the wheel instead.
     
  5. Thanks for the comments, I'll give them a try.
     
  6. I gave the good old college try but none of them worked! So I took the .dof's from the baja and put them into Blender to see how they were made and then tried them on the car I'm working on using the baja car.ini data as a guide.

    I found that the components must be made referenced to 0,0,0 the car null point. That works but the variables are quite difficult to get to work as some are referenced to the car null point (0,0,0) and some are referenced to the wheel center and some are referenced to God knows where.

    When I get it sorted aout I'll post an explaination of how to do it so cars can have articulated suspensions. I did find that coil springs move rather than compress and I'm trying to get that to work right.
     
  7. Stereo

    Stereo
    Premium Member

    [​IMG]

    5 components here, 4 of them are mirrored, the 5th is the front axle and a single piece. It's fairly simplified, mostly made it to test out how generic objects work.

    They connect to 6 points on the vehicle - the top ends of 1, 2, 4, the point where those meet, and the centre of the front wheels for 5. First 3 are stationary on the body, last 2 depend on the wheelpos.

    I can't remember which front wheel is which right now, so I'll just assume this is wheel1. If not, it's just mirrored anyway.

    Object 1:
    Code:
      ; front susp arm long
      model1
      {
        file=suspension_long.dof
        from=-0.50 -0.44 0.77
        to=wheelpos1
        ; Bring to centerline
        to_offset=0.38 -0.0 0.0
        ;to_offset=-0.4 -0.10 0.1
        fit=1
      }
    From is on the body - -0.50 puts it out from the centreline, -0.44 puts it below the nullpoint (which happens to be very high on this truck), 0.77 puts it forward.
    To is the wheelpos center - the end of the axis. So to_offset insets it 0.38m towards the centre of the vehicle.
    Fit=1 just means the ends of the object are always on the points defined.

    Objects 2&3:
    Code:
      ; front shock top
      model2
      {
        file=shock_top.dof
        from=-0.50 -0.45 1.47
        to=wheelpos1
        ; Bring to centerline
        to_offset=0.38 -0.0 0.0
        fit=0
        scale=1.0
      }
      ; front shock bottom
      model3
      {
        file=shock_bottom.dof
        from=wheelpos1
        ; Bring to centerline
        from_offset=0.38 -0.0 0.0
        to=-0.50 -0.45 1.47
        fit=0
        scale=1.0
      }
    
    These work as a pair - the endpoint definitions are identical, but as the shock, they're intended to compress together.
    So from and to are swapped here - the top of the shock is from the body down to the axle, the bottom of the shock is from the axle up to the body. On the body, 1.47 is roughly above the front axle.
    Then, since fit=0, they work with 'from' as a fixed point, and extend outward basically according to the size of the object.

    Object 4
    Code:
      ; front susp arm short
      model4
      {
        file=suspension_short.dof
        from=-0.50 -0.49 1.87
        to=wheelpos1
        ; Bring to centerline
        to_offset=0.38 -0.0 0.0
        fit=1
      }
    Nothing much to say - this one starts 1.87 forward on the body, so it's ahead of the axle going down.

    Object 5, the axle:
    Code:
        model5
        {
          file=axle.dof
          from=wheelpos0
          to=wheelpos1
          fit=1
        }
    Very straightforward, ends go to the centres of the wheels and fit=1 ensures it's always the right length. Model itself is 1 meter long, squished narrower since it gets stretched to around 2m wide.




    None of the coordinate definitions seem too inexplicable here. The truck's about 1.2MB in a rar, I can host it somewhere if you want to play with it.
     
  8. Thanks Stereo, I'll try your info to try to get the spring compressed with the shock.
    In the meantime this is what I have.

    susp.jpg susp1.jpg

    ;LEFT FRONT SUSPENSION
    ;Suspension LF Bottom Swing Arm
    model0
    {
    file=left_bottom.dof
    from=0.005 0.040 1.273 ; -right/+left -down/+up -back/+fwd sets location from 0,0,0
    to=wheelpos0
    to_offset=-0.000 -0.040 0.000 ; x keep=0 -down/+up z keep=0 from wheel center reference
    fit=0
    scale=1.0 ; length of component from mounting point
    }
    ;Suspension LF spring
    model1
    {
    file=spring.dof
    from=wheelpos0
    from_offset=-0.173 0.276 0.000 ; -right/+left -down/+up z keep=0 moves bottom from wheel center ref.
    to=0.458 -0.000 1.273 ; -right/+left vary to align vertical y keep=0 or strange behavior -back/+fwd moves bottom from 0,0,0
    fit=0
    scale=1.0 ; +adjusts length of spring down/-up
    }
    ;Suspension LF damper top
    model2
    {
    file=damp_top.dof
    from=wheelpos0
    from_offset=-0.173 0.348 0.000 ; -right/+left -down/+up -back/+fwd moves top point from wheel center ref.
    to=0.458 0.226 1.273 ; -right/+left vary to align vertical -down/+up -back/+fwd moves bottom point from 0,0,0
    fit=0
    scale=1.0 ; +adjusts length of unit down/-up
    }
    ;Suspension LF damper bottom
    model3
    {
    file=damp_bot.dof
    from=wheelpos0
    from_offset=-0.173 -0.025 0.000 ; -right/+left -down/+up moves entire unit -back/+fwd moves bottom point from wheel center ref.
    to=0.458 0.286 1.273 ; -right/+left vary to align vertical -down/+up erratic if not set to right val. -back/+fwd moves top point from 0,0,0
    fit=0
    scale=1.0 ; -adjusts length of unit down/+up
    }
    ; Some notes: The spring doesn't compress and the top damper moves with the suspension. Both
    ; problems need fixing!
    ; IMHO the components should be set acording to the offset for the car null point with the from being
    ; the anchor and the to being the attachement point to the car chassis. I hope Ruud or MitchVl reads this.
     
  9. Stereo

    Stereo
    Premium Member

    For stuff that needs to compress (like the spring) they need fit=1.

    from is (0,0,0) on the dof - and should always correspond to something the piece is fixed to (for the top of the damper, the body. For the bottom of the damper, the suspension arm. For the suspension, the body or the wheel. And so on.)
    to can be a couple things:
    - if fit=1, it's the other thing the piece is fixed to (for springs, one end is on the body, the other end's on the wheel)
    - if fit=0, it just defines a point for the object to point towards.
    Either of them are attached relative to the nullpoint if from=x y z, or to=x y z.

    ;LEFT FRONT SUSPENSION
    ;Suspension LF Bottom Swing Arm
    model0
    {
    file=left_bottom.dof
    from=0.005 0.040 1.273 ; -right/+left -down/+up -back/+fwd sets location from 0,0,0
    to=wheelpos0
    to_offset=-0.000 -0.040 0.000 ; x keep=0 -down/+up z keep=0 from wheel center reference
    fit=0
    scale=1.0 ; length of component from mounting point
    }
    ;Suspension LF spring
    model1
    {
    file=spring.dof
    from=wheelpos0
    from_offset=-0.173 0.03 0.000 ; -right/+left -down/+up z keep=0 moves bottom from wheel center ref.
    to=0.458 0.226 1.273 ; -right/+left vary to align vertical y keep=0 or strange behavior -back/+fwd moves bottom from 0,0,0
    fit=1
    scale=1.0 ; +adjusts length of spring down/-up
    }
    ;Suspension LF damper top
    model2
    {
    file=damp_top.dof
    from=0.458 0.226 1.273 ; -right/+left vary to align vertical -down/+up -back/+fwd moves bottom point from 0,0,0
    to=wheelpos0
    to_offset=-0.173 -0.025 0.000 ; -right/+left -down/+up -back/+fwd moves top point from wheel center ref.
    fit=0
    scale=1.0 ; +adjusts length of unit down/-up
    }
    ;Suspension LF damper bottom
    model3
    {
    file=damp_bot.dof
    from=wheelpos0
    from_offset=-0.173 -0.025 0.000 ; -right/+left -down/+up moves entire unit -back/+fwd moves bottom point from wheel center ref.
    to=0.458 0.286 1.273 ; -right/+left vary to align vertical -down/+up erratic if not set to right val. -back/+fwd moves top point from 0,0,0
    fit=0
    scale=1.0 ; -adjusts length of unit down/+up
    }
    ; Some notes: The spring doesn't compress and the top damper moves with the suspension. Both
    ; problems need fixing!
    ; IMHO the components should be set acording to the offset for the car null point with the from being
    ; the anchor and the to being the attachement point to the car chassis. I hope Ruud or MitchVl reads this.




    I think that should work about right - bolded the spring scale, which most likely needs to be adjusted (as it was adjusted on the Baja, to make the spring fit right - basically just needs to be increased until the spring is long enough) The 0.03 bolded might also need to be adjusted up a little bit, I just guessed at it. Should be set so the bottom end of the spring is at the right height.
     
  10. Thanks Stereo!
    I got the spring set to compress, thaanks to the info about using the same locations. Took scale=4.0 to get it to fit properly, the 0.03 didn't help.

    There is a problem with camber which tilts the wheel and the lower swing arm is located below the wheel center. the shock top shaft and lower housing tilt and don't line up for the coil over shocks. Calculating the locations, to/from is a bear, so I just try hit or miss to get them lined up.

    Now to do the rear suspension which has a trailing link.

    I really appreciate your help.
     
  11. Stereo

    Stereo
    Premium Member

    Yeah, coil overs are problematic for this system, cause they're really attached to the shocks, rather than to the wheel or body.


    I thought about a workaround, but I think a better solution, if MitchVL or anyone's reading, is to allow generic models to be used as targets, with offset being in object coordinates.

    So the proposed method would look something like
    Code:
    ; damper top 
    model0
    {
      from=D
      to=A
      ...
    }
    ; damper bottom
    model1
    { 
      from=A
      to=D
      ...
    }
    ; coilover
    model2
    {
      from=model0
      from_offset=C
      to=model1
      to_offset=B
      fit=1
    }
    [​IMG]
    A is linked to the wheel, D is linked to the body - B and C are relative to the damper models, and thus as the suspension moves, the coilover follows them correctly.

    Don't know how practical this is to implement, but it would allow most suspension geometry to be accurately represented. I think if it was strictly limited to models less than the current one (ie. model 3 can only be linked to/from models 0 ~ 2) the positions could all be calculated in order.



    The alternative, which is very much a workaround, would be to put object (0,0,0) at B and C, the ends of the springs, and offset the to/from to compensate. Then the coilover could correctly go between those two points - but A and D would travel slightly sideways when the suspension travels.
     
  12. Got a good front suspension working. The rear suspension uses a trailing arm which doesn't work right as a generic model.

    a couple of images showing the trailing arm problem and the front/rear suspension I'm trying to make work.

    susp3.jpg susp2.jpg