Done :-)

Also, as the Twizy (and I suppose other cars as well) charges the 12V battery further on as long as it's plugged in, I now use the plug in status (car_linevoltage + car_chargecurrent) to detect a 12V charge status.

After plug-out, the OVMS waits for 10 minutes (time for the 12V battery to calm down) until taking the new ref voltage. That will still be a bit above the nominal voltage, but the span should be short enough to allow for taking a new ref even if taking the car for the next drive soon after charging.

I hope this will work on other cars as well without change/config, but it will now need the car_linevoltage and car_chargecurrent reflecting the actual plugin status. If a car cannot provide this info, we can introduce a new vehicle hook for a function that checks for a valid calibration time.

Regards,
Michael


Am 26.01.2013 22:05, schrieb Michael Balzer:
I've got a flaw in there: as the code begins taking ref max values right after charging ends, the ref gets too high. After charging my current ref is now 14.7 due to that bug, should be around 12.7.

I need to factor in the voltage decay after end of charge. I'll see if I can get that in without introducing a new timer variable...

@Mikeljo: "> 13" is correct (just ensures ref-13 > 0), your change to "> 130" is not correct, as the ref can be much lower.
...also consider using stp_l2f() for the STAT message, see the DIAG message for a copy source.

I really should document the stp functions...

Regards,
Michael


Am 25.01.2013 17:16, schrieb Mark Webb-Johnson:
Michael,

Seems like a sensible approach.

Your car is now showing "11.9,0,12.2".

I'll try it in my car over the weekend.

Regards, Mark.

On 25 Jan, 2013, at 9:16 PM, Michael Balzer <dexter@expeedo.de> wrote:

Mark, Tom,

I just checked in the auto calibration implementation.

It works by taking the maximum voltage reading while the car is off and not charging as the reference voltage, so it should adapt to all possible variations.

Alert is triggered if current reading is at/below ref - 1.3V, which should fit for all cases.

The alert now also includes the reference, and it can be queried by the "DIAG" SMS command. It's also now included as a new field in the environment message ("D").

Regards,
Michael


Am 22.01.2013 04:19, schrieb Mark Webb-Johnson:
Tom,

My understanding is that the 2.x cars work the same way. The 12V battery is just for emergency systems.

Presumably if the main pack fails (fuse blows, whatever), the 1.5 cars have no way of running hazard warning lights, brake lights, etc.

It would still be useful to see the stability of that 12V line, on the v1.5 Tesla Roadsters.

Regards, Mark.

On 21 Jan, 2013, at 12:48 AM, Tom Saxton <tom@idleloop.com> wrote:

on 1/19/13 10:08 PM, Mark Webb-Johnson wrote:

If anyone has a 1.x roadster with a v2 hardware module, and has recently
parked it for some days, it would be helpful if you could send me the
date/time range and your vehicleid.
I don't think the v1.5 Roadster has a 12V battery. It's my understanding
that it uses a DC-to-DC converter on one of the ESS sheets to power the 12V
systems when the car is off.

    Tom


_______________________________________________
OvmsDev mailing list
OvmsDev@lists.teslaclub.hk
http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________
OvmsDev mailing list
OvmsDev@lists.teslaclub.hk
http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- 
Michael Balzer * Paradestr. 8 * D-42107 Wuppertal
Fon 0202 / 272 2201 * Handy 0176 / 206 989 26

<dexter.vcf>_______________________________________________
OvmsDev mailing list
OvmsDev@lists.teslaclub.hk
http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________
OvmsDev mailing list
OvmsDev@lists.teslaclub.hk
http://lists.teslaclub.hk/mailman/listinfo/ovmsdev



_______________________________________________
OvmsDev mailing list
OvmsDev@lists.teslaclub.hk
http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-- 
Michael Balzer * Paradestr. 8 * D-42107 Wuppertal
Fon 0202 / 272 2201 * Handy 0176 / 206 989 26