• Welcome to PiBoSo Official Forum. Please login or sign up.
 
March 28, 2024, 08:38:55 AM

News:

GP Bikes beta21c available! :)


Direct steer

Started by PiBoSo, April 28, 2013, 08:53:11 PM

Previous topic - Next topic

HornetMaX

Quote from: h106frp on December 25, 2014, 03:36:38 PM
But if the force feedback is 0 torque the rider cannot input a torque either, just displace the bars, only a reaction between both creates a resultant torque
Hmm ... there will be no force feedback, at least not as we know it.

GPB will dictate a bar position (angle), a control loop will use the motor to put the bars at that angle. GPB will not have to pass a FFB signal to the device, only the current bar position. The control loop will take care of putting the bars at that position (and holding them there), generating the necessary torque.

Imagine the bars are in the middle, and the rider is applying 1Nm left: to keep the bars there the control loop will have to generate 1Nm right: your sensor will pick up exactly 1Nm (with the correct sign), the rider-applied torque.

Now imagine that the environment torque (in GPB) goes down (for whichever reason): the front will turn left a bit.
The new position is passed to the device and in order to move the bars to the new position the torque generated by the device will go down: as the rider torque is still 1Nm, the bars will turn left. All fine up to here.

Once the final position is reached, the device will generate 1Nm right, to perfectly balance the 1Nm left generated by the rider.
But in the transient phase let's assume the device torque was 0.5Nm right: the sensor will no longer pick up 1Nm, even if the rider torque is still 1Nm. That's because the bars (the real ones and the GPB ones) are turning and some torque is spent to accelerate them.

That "missing" torque can in principle be computed (measuring the angular acceleration of the bars and knowing the inertia), but it's typically much better to use a proper observer.

MaX.

h106frp

Lucky I have a 'proper' servo controller, can choose between torque or position in the feedback loop. We should be able to compute velocity and acceleration from the rate of change in angular position. I think this will need to wait until I get the steering rig built sometime in the new year.

HornetMaX

Quote from: h106frp on December 25, 2014, 06:03:04 PM
Lucky I have a 'proper' servo controller, can choose between torque or position in the feedback loop. We should be able to compute velocity and acceleration from the rate of change in angular position. I think this will need to wait until I get the steering rig built sometime in the new year.
You should set it on 'position' (set point given by GPB). But I fear that computing velocity and acceleration from the angular position won't be enough.

The other approach (the usual one) would be to set your controller to torque and have its set point taken from GPB FFB output.
The angular position of the bars would then be the input of GPB. In that configuration, Direct Steer Angle is what makes sense.

Plenty of things to play with :)

MaX.

h106frp

December 25, 2014, 09:59:59 PM #33 Last Edit: December 25, 2014, 10:10:31 PM by h106frp
Think i will start with torque mode control until i get the mechanical side built as i suspect this will take a while to get right, then dabble with the other modes and monitor signals from the servo controller to see what works best. I know from experience that low frequency acceleration is a pain to measure directly as the output from an accelerometer will be small, velocity and displacement are easier then differentiate/integrate as required to get acceleration.

Thanks for the input, its very much a 'chicken and egg' type problem and needs a lot of thought/trial and error to get right :) If i get something that's better than my old thrustmaster bars i will be quite happy, spring return like a joystick just feels all wrong to me. Decent analogue throttle and brake will be a bit improvement as well especially with the higher power bike physics.

Just wondering if a MEMS gyro might be a better way of measuring bar rotational velocity?

HornetMaX

MEMS could be an option, for both speed and acceleration. Still to be checked if it's really needed.

If I find the time, I can try to write down the overall system (in something like matlab/simulink, or maybe just hand-write the equations): probably worth to spend a bit of time thinking before taking the jump :)

@admins: maybe we could clean up this thread (and leave only Piboso's posts) and split the interesting discussion to a separate post.

MaX.

h106frp

That would be great, still struggling with all the parameter interactions. MEMS is surprisingly cheap and looks fairly simple to implement.

Sorry for causing the thread to divert, discussion just seemed to evolve :)

HornetMaX

Quote from: PiBoSo on April 28, 2013, 08:53:11 PM
To directly control the torque applied to the handlebars, edit profile.ini and add:

[hardcore]
directsteer=1
directsteer_maxtorque=30
directsteer_maxtorque2=0.5


Use negative values to invert the forces.
The second torque scales with speed and then is added to the first one.

Not sure I get the "second torque" part right: how does it scale with speed exactly ?

MaX.

tseklias

Quote from: PiBoSo on April 28, 2013, 08:53:11 PM
To directly control the torque applied to the handlebars, edit profile.ini and add:

[hardcore]
directsteer=1
directsteer_maxtorque=30
directsteer_maxtorque2=0.5


Use negative values to invert the forces.
The second torque scales with speed and then is added to the first one.

@Piboso, can the two types of diret steer you provide be split out in two different controllers working at the same time?

eg: can i connect two logitech g25s and use one for handlebar steer and the other one for lean steer?

PiBoSo

Quote from: HornetMaX on March 03, 2015, 08:55:29 PM
Quote from: PiBoSo on April 28, 2013, 08:53:11 PM
To directly control the torque applied to the handlebars, edit profile.ini and add:

[hardcore]
directsteer=1
directsteer_maxtorque=30
directsteer_maxtorque2=0.5


Use negative values to invert the forces.
The second torque scales with speed and then is added to the first one.

Not sure I get the "second torque" part right: how does it scale with speed exactly ?

MaX.

Linearly.
"La perfezione non è il nostro obiettivo, è la nostra tendenza".

HornetMaX

speed (in m/s I guess) * 0.5 ?

Isn't there any limitation to the max torque a rider can generate with direct steer torque ?
Also, is there any limitation on the torque the virtual rider generates (in direct steer angle and in usual non-direct steer mode) ?

MaX.

passerBy

@Piboso,
Could you please explain the second DS mode in more detail? From what I can tell, it's more of a hybrid. Do I understand it correctly that it's more of an angle command up to higher speeds, where it starts acting more like the directsteer=1 angle to torque mapping (to a certain degree)?

Also, I think it would be better to have the max angle parameter optional, so that if it's missing or set to 0, the actual angle would be taken from the bike's lock every time the bike is changed. Ideally, with the soft-lock in FFB wheels being set to the same angle (multiplied by 2, of course).

PiBoSo

April 19, 2017, 08:26:40 PM #41 Last Edit: April 19, 2017, 08:29:14 PM by PiBoSo
Quote from: passerBy on April 19, 2017, 03:02:43 AM
@Piboso,
Could you please explain the second DS mode in more detail? From what I can tell, it's more of a hybrid. Do I understand it correctly that it's more of an angle command up to higher speeds, where it starts acting more like the directsteer=1 angle to torque mapping (to a certain degree)?

Also, I think it would be better to have the max angle parameter optional, so that if it's missing or set to 0, the actual angle would be taken from the bike's lock every time the bike is changed. Ideally, with the soft-lock in FFB wheels being set to the same angle (multiplied by 2, of course).

The second direct steer mode is meant for a real handlebar with force feedback.
A PID controller uses torque to reach the target steer set by the input.
The "maxangle" parameter is meant to be the max lock of the real handlebar. It is needed to match real and virtual rotation.

Unlike the first directsteer mode, it is not hybrid. It uses the same PID controller regardless of bike velocity and "lowspeed" control.
"La perfezione non è il nostro obiettivo, è la nostra tendenza".

passerBy

Quote from: PiBoSo on April 19, 2017, 08:26:40 PM
The second direct steer mode is meant for a real handlebar with force feedback.
A PID controller uses torque to reach the target steer set by the input.
The "maxangle" parameter is meant to be the max lock of the real handlebar. It is needed to match real and virtual rotation.

Unlike the first directsteer mode, it is not hybrid. It uses the same PID controller regardless of bike velocity and "lowspeed" control.
In other words, if the controller's lock (times two) and the max angle value are both set to the bike's lock angle, the physics engine will always try to turn the virtual handlebars to the exact same angle as the current angle of the controller, even if it would take extreme amounts of rider's input torque, right? And at the same time, it tries to set the controller's angle so that it would exactly match the virtual bars to the best of the force feedback abilities.

And if I had a strong enough direct drive wheel (preferably with a handlebars addon), it would give me an experience coming very close to real life.

Judging by the jolts my Logitech G27 generates sometimes even on lower FFB levels, I think a direct drive wheel might be simply dangerous. Maybe it makes sense to add some kind of an FFB filter that would smooth out these peaks?
Also, in the center it feels too vague. Would be great if there was an option to set the "minimum force" for FFB as in other titles (WRS and KRP users would benefit from this as well).

HornetMaX

Quote from: passerBy on April 20, 2017, 12:07:05 AM
In other words, if the controller's lock (times two) and the max angle value are both set to the bike's lock angle, the physics engine will always try to turn the virtual handlebars to the exact same angle as the current angle of the controller, even if it would take extreme amounts of rider's input torque, right?
If I recall correctly, there's a cap to the force the virtual rider can generate (rest is OK, GPB will try to align its virtual bars to the angle you have on your wheel/controller, via the PID control loop).

Quote from: passerBy on April 20, 2017, 12:07:05 AM
And at the same time, it tries to set the controller's angle so that it would exactly match the virtual bars to the best of the force feedback abilities.
No. With DS2/DSA it's you dictating the angle to GPB, not GPB dictating the angle to your wheel. You can't have both at the same time.
You set the angle on your wheel (fighting the FFB sent by GPB to your wheel) and GPB tries to match it.
This means that strictly speaking, the two angles (your controller's one and GPB's virtual bars one) will not be identical at any given time: when you change suddenly your controller's angle, it will take some time to GPB to align and it may align in a smooth manner or it may overshoot it and oscillate a bit around it, it all depends on the PID settings and the bike physics. But it may be that the tracking (virtual bars following your real bars) is good enough to be unnoticeable.

On paper there may be a "dual" strategy but it would need an input device that today does not exist: GPB sends the bars angle to the wheel and the wheel tries to align to that angle (fighting your input, using a control loop like the PID in DSA). At the same time the wheel reads the torque you apply to it (only that torque, net of the torque it generates by itself) and sends it to GPB (that's hence DST/DS1). But again, there's zero warranty that would be any better than DSA/DS2 and we have no such device available.

Quote from: passerBy on April 20, 2017, 12:07:05 AM
Also, in the center it feels too vague. Would be great if there was an option to set the "minimum force" for FFB as in other titles (WRS and KRP users would benefit from this as well).
I suspect PiBoSo just does not like the idea of adding artificial FFB stuff.

passerBy

Quote from: HornetMaX on April 21, 2017, 08:40:12 AM
Quote from: passerBy on April 20, 2017, 12:07:05 AM
In other words, if the controller's lock (times two) and the max angle value are both set to the bike's lock angle, the physics engine will always try to turn the virtual handlebars to the exact same angle as the current angle of the controller, even if it would take extreme amounts of rider's input torque, right?
If I recall correctly, there's a cap to the force the virtual rider can generate (rest is OK, GPB will try to align its virtual bars to the angle you have on your wheel/controller, via the PID control loop).
Well, that makes sense. Would be nice to be able to actually create a customized rider using a set of parameters including the maximum force.

Quote
Quote from: passerBy on April 20, 2017, 12:07:05 AM
And at the same time, it tries to set the controller's angle so that it would exactly match the virtual bars to the best of the force feedback abilities.
No. With DS2/DSA it's you dictating the angle to GPB, not GPB dictating the angle to your wheel. You can't have both at the same time.
You set the angle on your wheel (fighting the FFB sent by GPB to your wheel) and GPB tries to match it.
I shift my weight to a side (using the rider L/R lean), the bars drop to that side. Also, on a slope the bars tend to turn into the direction of the slope. Not to mention that I do feel what appears to be meaningful FFB (albeit with some weird jolts happening even while at a standstill and with the infamous Logitech's empty center problem), which doesn't appear to be purely reactive at all.

You really need to give the DS2 + FFB a try, Max. I know you won't believe me that it is this good, but at least give it a try when you can (remember to keep the steering ratio 1:1, though).

QuoteThis means that strictly speaking, the two angles (your controller's one and GPB's virtual bars one) will not be identical at any given time: when you change suddenly your controller's angle, it will take some time to GPB to align and it may align in a smooth manner or it may overshoot it and oscillate a bit around it, it all depends on the PID settings and the bike physics. But it may be that the tracking (virtual bars following your real bars) is good enough to be unnoticeable.
That's a pretty obvious idea. And it made me assume that the DS2 could be a hybrid mode. Also, this is why I thought a hybrid mode could be a good middle ground for those not wanting to learn any of the two current direct steering modes. After all, nothing prevents us from uncoupling the virtual bars from the controller completely to handle some instantaneous high steering rate stabilization action (or a banal tank-slapper for that matter).

QuoteOn paper there may be a "dual" strategy but it would need an input device that today does not exist: GPB sends the bars angle to the wheel and the wheel tries to align to that angle (fighting your input, using a control loop like the PID in DSA). At the same time the wheel reads the torque you apply to it (only that torque, net of the torque it generates by itself) and sends it to GPB (that's hence DST/DS1). But again, there's zero warranty that would be any better than DSA/DS2 and we have no such device available.
I'm pretty sure that's exactly how the directeer=2 mode works. Except, it takes the resulting angle and derives the torque you apply from it.
Might sound like a sloppy solution (no way to go around that), but the bottom line here is that it works. It works so good in fact, I forgot about any other sims beside GPB and MXB. Now, if only there was a way to do something about the violent shaking of the wheel with no apparent reason...

Quote
Quote from: passerBy on April 20, 2017, 12:07:05 AM
Also, in the center it feels too vague. Would be great if there was an option to set the "minimum force" for FFB as in other titles (WRS and KRP users would benefit from this as well).
I suspect PiBoSo just does not like the idea of adding artificial FFB stuff.
Oh, come on, it's not artificial stuff. It's just a filter and a sort of an equalizer (by the way, why have nobody thought of an actual equalizer for FFB devices yet?). And contrary to so called canned effects, these two things would be extremely helpful.