Motor Inertia simulation

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
Altair
Posts: 5
Joined: Thu Feb 04, 2021 1:44 pm
Country: -

Motor Inertia simulation

Post by Altair »

Hi, this is my first post on this forum. It is a suggestion for the developpers.
I have been trying unsuccessfully to simulate the inertia of a bi-directional electric motor by using the Slow up/Slow dn option on the throttle channel.
The problem is that this option does exactly what its name says, that is to limit the slew rate of the output signal, e.g. limit the rate of change of the pulse width . This is perfect for flaps or landing gear, of course.
On a scale vehicle, a very heavy wheel loader in my case, if I set 3 seconds for the throttle signal signal to go from 0 to 100% and back, it will take the model 3 seconds to accelerate to maximum speed. On release of the throttle it will take again 3 seconds to go back to zero, but if I apply reverse throttle during the deceleration from full speed (to stop more quickly), it will take 6 seconds for the power to go from full forward to full reverse, which is much too long.
I would like to be able to simulate the behavior of a real vehicle, on a model that has no brakes. The way that would work best is to attach a large flywheel to the motor, but this is impractical for space and mechanical reasons.
One way I thought to acheive that electronically would be to make the rate of change of the throttle PWM signal, proportional to the amount of throttle applied. If we go back to the example above, we could have a mild or a quicker acceleration depending on the position of the throttle, and once at maximum speed, we could pretty much rapidly go into braking by putting the stick in full reverse, where the PWM will quickly change from wide to narrow, until we release back pressure to reduce the braking force. Equally, from full speed we can let go of the stick to let the model coast on its "inertia" to a stop, thanks to the PWM slew rate going back to a slow rate when the stick is in neutral.
It would not be perfect because we don't have available the RPM of the motor to make a feedback loop with the control software, but it still could give a realistic approximation.
So what would be needed is an option in the throttle settings, (could be called Motor Inertia), which would make the slew rate of the PWM signal, to be adjustably proportional to the absolute value of the throttle stick. There would need to be 2 data boxes where we would enter: 1- the (slow) slew rate at minimum throttle position, and 2- The (fast) slew rate at maximum throttle position.

I hope I have been clear enough in this description, but don't hesitate to ask for precisions if needed.
There might be other methods of achieving this inertia simulation, so ideas are welcome!

Thanks!

ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: Motor Inertia simulation

Post by ReSt »

In the past, I collected tips, that I thought, could be useful some times
I add a collection of possible mixes that control the speed of a servo movement depending on the stick position (ER9x/ERSkyTx as well as openTx).
Check, if there is something helful for you.

Reinhard
Tips.txt
(2.27 KiB) Downloaded 348 times
Altair
Posts: 5
Joined: Thu Feb 04, 2021 1:44 pm
Country: -

Re: Motor Inertia simulation

Post by Altair »

Thanks Reinhard for the information!
I will study it, to see if it could be applicable to my needs.
But I think it would be better if the Inertia option was integrated in the software.

Guy
User avatar
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Motor Inertia simulation

Post by MikeB »

This appears to be a very specific requirement. Probably best to try to make it work without changing the software.
I'm considering what is possible using just mixes.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Motor Inertia simulation

Post by MikeB »

Looking at your suggestion for a software change, if you are at zero throttle and you move the stick to full, then the slew rate will be at the highest rate and the acceleration from zero to full speed will be at the fastest rate. I don't think that would simulate the flywheel approach, I would think you would want to keep the slow slew rate for acceleration.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Altair
Posts: 5
Joined: Thu Feb 04, 2021 1:44 pm
Country: -

Re: Motor Inertia simulation

Post by Altair »

Thanks for your comments. I thought about that but I wouldn't accelerate with full throttle because the motor is more powerful than "scale" power. In fact, this is the case of almost all RC models isn't it? ;-) The reason to have the capability to instantly reach full power in reverse is for (emergency) braking. But the main point is still to simulate the inertia of a large vehicle, which the Slow-up/Slow-dn option doesn't really do.

There might be a way, using the Slow-up/dn option, if it could detect a change of direction of the stick while the model is coasting down to a stop, to cancel the deceleration phase and jump immediately to reverse. But I haven't thought that one through, it just came to my mind.

I think that once developped, the inertia option would be useful for many different kinds of models, to add more realism. Just the popularity of scale highway trucks & vans in europe is already impressive.
User avatar
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Motor Inertia simulation

Post by MikeB »

I use erskyTx, not openTx, but most things operate the same way.
As a start, try something like this (CH3 is the throttle channel):
CH3: +100% CH11 slow(up 1.0, down 1.0)
CH10: +100% Thr slow(up 3.0, down 3.0)
CH11: +100% CH10
R +100% Thr Switch(L2)

L1: v>val CH10 0
L2 v<val Thr 0 AND L1

L1 and L2 detect that the requested (slowed) throttle is forwards, but the Thr stick is reverse.
Normally CH3 will follow the throttle stick, but with a 3 second delay, however, if moving forwards and you put the throttle stick to reverse, the throttle will rapidly move to the throttle stick position (1 second slow on CH3 to prevent a sudden change from forwards to reverse), but will revert to the normally slow position (on CH10) once CH10 starts to show reverse.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Altair
Posts: 5
Joined: Thu Feb 04, 2021 1:44 pm
Country: -

Re: Motor Inertia simulation

Post by Altair »

Thanks for the suggestion! I understand how this would work.
However, we're still having a fixed acceleration rate, and this is what would add realism to the model, specially on startup from a stop.

Another idea came to mind; if I was to make many mixes for my throttle channel, with each one having a different Slow-up/dn value, and I would have logical switches selecting them according to the position of the throttle... I don't even know if this is possible in the software.
Oh no, it wouldn't work because when switching from one to another, the output signal would abruptly change, because each mix would be at a different place in its slope.
Well, back to square one.
User avatar
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Motor Inertia simulation

Post by MikeB »

On a full size vehicle (with gears) initial acceleration is high, while once up to speed acceleration is lower. This is opposite to your original suggestion (slow slew rate at low throttle and high slew rate at high throttle). So what is needed?

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Altair
Posts: 5
Joined: Thu Feb 04, 2021 1:44 pm
Country: -

Re: Motor Inertia simulation

Post by Altair »

Indeed, this is the case on all standard vehicles.
On most models however, there is rarely a transmission that allows changing gears during acceleration. Additionally, scale operations are done at low speeds, in a limited area, because a scale road or highway would take a lot of space. So we are always in low gear, and running at low speeds only, with a motor that delivers almost constant torque regardless of RPM, and is much more powerful than the scale dictates.
Note that I'm not talking about RC buggies, because they are not really "scale" representations of real vehicles.
I agree that my suggestion has the slew rate "reversed" but this is not really a problem, because of the characteristics of the motor, and also the fact that it is more important to have the slowest slew rate right from zero speed. That's where discrepancies from the behavior of a real vehicle will be the most apparent.
A very large flywheel directly on the motor itself would be the best way to tame the accelerations and decelerations, but not easy to implement.
Software takes much less space! 😉

Post Reply

Return to “openTx”