fluxoid-org / CyclismoProject

Contains all subprojects and libraries for the Cyclismo project
Other
7 stars 4 forks source link

PID/Power model to control brake resistance #8

Open jovial opened 11 years ago

jovial commented 11 years ago

Been mucking around with sycning the model to the wheel speed. Goes a little something like this:

What do you reckon? Is this madness? One thing it does do is to get rid of the initial resistance fluctuations. The PID does fairly well at keep ing speed close to that of model (once synced), as long as you are above a certain speed. I don't think the trainer does too well at simulating speeds below 18 km/h.

The disadvantages are that the acceleration to the steady state speed is some what contrived and you don't know what this will be. At present the initial resistance is fairly high to try an get a lower sync speed. This is noticeable in the feel when the resistance drops off once synced.

An alternative is to enforce a minimum setpoint (predicted) value. Maybe with high gain coefficients to get rapid convergence to that of the model. Would need to select an appropriate minimum speed though (kind of why I thought syncing would be better as that would depend on the power you are outputting).

Setting a resistance value manually, the brake can react within a second. However, to get a large enough initial value with the PID requires a large proportional term (to kick in quickly). This didn't work too well without the minimum speed limit as it aggressively tried to reduce the speed to near zero. A minimum speed however, would reduce this initial kick.

Basically it boils down to picking an appropriate minimum speed or an appropriate initial resistance.

Any thoughts?

Will

dougszumski commented 11 years ago

Good work, It looks much improved. Gone are the large oscillations from attempting to sync at all speeds. Perhaps worth posting the logs up for future reference.

Any chance of getting a log of the actual speed and the virtual speed from the brake as controlled by the head unit to see how closely they compare? It would be interesting to see how the head unit deals with syncing, and how the mismatch varies.

Perhaps best to set a minimum initial resistance so it's independent of the gradient? Something like whatever is required to get ~80 watts of resistance at normal cadence. I seem to remember it doesn't cope well below about that power level using the head unit.

jovial commented 11 years ago

Here is a log for a session where the headunit is controlling the brake. Slope was set to zero. Contains:

First section (small constant power steps)

Second bit:

I assume channel collisions were the cause of the missing data points.

Let me know if you have any requests for a different test / methodology!

The file: http://cowboycoders.org/data.log

jovial commented 11 years ago

Confirmed: Headunit's control of resistance is independent of power/virtual speed.

Test: Simulated a 10 kmh wheel speed and incremented power Observation: No change in resistance output

jovial commented 11 years ago

Confirmed: Virtual flywheel appears to be non-existent

Test: increment power to 300 watts, then drop to zero Expected result: Slow decay in virtual speed Observed: drops to 0.6 instantaneously (only syncs to zero when wheelspeed is also zero, else 0.6)

dougszumski commented 11 years ago

A plot of the log file.

comparisonVirtActualSpeed