[Ovmsdev] Relay through diag port.
Mark Webb-Johnson
mark at webb-johnson.net
Tue Apr 16 09:01:01 HKT 2013
Time is easy (hours*3600 + mins*60 + secs), but date is tricky.
How about this: http://aa.usno.navy.mil/faq/docs/JD_Formula.php
INTEGER FUNCTION JD (YEAR,MONTH,DAY)
C
C---COMPUTES THE JULIAN DATE (JD) GIVEN A GREGORIAN CALENDAR
C DATE (YEAR,MONTH,DAY).
C
INTEGER YEAR,MONTH,DAY,I,J,K
C
I= YEAR
J= MONTH
K= DAY
C
JD= K-32075+1461*(I+4800+(J-14)/12)/4+367*(J-2-(J-14)/12*12)
2 /12-3*((I+4900+(J-14)/12)/100)/4
C
RETURN
END
Fortran! Brilliant :-) I feel so nostalgic...
Regards, Mark.
On 16 Apr, 2013, at 3:41 AM, Michael Balzer wrote:
> Mark,
>
> thanks for the reminder: of course, the GPS clock should be usable. In fact I already gave it a try once but had to put it back, because the C18 libs seem to lack support for time functions. So we just need to port at least the basic time functions to convert textual representation to UNIX time.
>
> Regards,
> Michael
>
>
> Am 15.04.2013 02:54, schrieb Mark Webb-Johnson:
>> Michael,
>>
>> For the clock, can we use the GPS clock? I know that some cellular networks also support time services, but I'm appalled that they are often several minutes inaccurate.
>>
>> The virtual car model actually has a car_time (second counter) which is supported on the Tesla Roadster. For other cars, we could standardise this and have it periodically synced to gps time (when available).
>>
>> I think the main thing we are missing is time zone offset (which tomsax was also asking for) - my concern is things like daylight savings time complicating things.
>>
>> Regards, Mark.
>>
>> On 15 Apr, 2013, at 4:01 AM, Michael Balzer wrote:
>>
>>> Mark, that reminds me: a clock would be nice on the next hardware to enable cron jobs on the module.
>>>
>>> Until then, we could introduce some time info sent from the server to the car.
>>>
>>> Nikki, this kind of charge control could also be used to sync the charge to solar panel peak output time.
>>>
>>> Regards,
>>> Michael
>>>
>>>
>>> Am 14.04.2013 13:01, schrieb Nikki Gordon-Bloomfield:
>>>> I've been thinking about this some more, and I think I've come up with a plan.
>>>>
>>>> If I could pull the IO out there and connect it to a relay driver chip, I think it could be possible to give Twizy owners the same remote on/off charge capabilities as the Tesla.
>>>>
>>>> My thoughts:
>>>>
>>>> 1) use output one from OVMS to drive a relay which is NO. When the IO output from OVMS goes high, we use that to close the relay, and let power flow, turning on the charger. When it goes low, the relay opens, and the charger turns off.
>>>>
>>>> 2) use a second IO on the OVMS to sense when a switch is pressed on the dash. This allows us to start/stop charging from the vehicle using a simple push-to-make switch.
>>>>
>>>> 3) using a home instance of perl and OVMS client software, write a cron job which turns on the car's charging on/off at a given time every day, or have perl listen for SOC and shut off charging when we reach 80% SOC.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> My goal? To give Twizy owners the ability to use time-of-use metering to get cheaper charging of the Twizy at night-time. And also to allow users to set 80% SOC rather than 100% SOC. It would require folks to run a perl script all the time on their home computers though.
>>>>
>>>> Nikki.
>>>>
>>>>
>>>>
>>>> On 2 Apr 2013, at 14:05, Mark Webb-Johnson <mark at webb-johnson.net> wrote:
>>>>
>>>>> Tricky. It is just a tap into the modem comms.
>>>>>
>>>>> But, there is an expansion connector on the board itself.
>>>>>
>>>>> The part labelled "HEADER 9X2" is a standard layout for expansion plugs, or holes are there to directly solder to the board. The I/O is 5v digital on those pins, and there are quite a few spare I/O pins that you can use.
>>>>>
>>>>> There is also GND, +12V and +5V if you need power.
>>>>>
>>>>> If you have a use for this, it would be quite simple to control some of these pins on/off on command (similar to the way home link works).
>>>>>
>>>>> Regards, Mark.
>>>>>
>>>>> <PastedGraphic-1.pdf>
>>>>>
>>>>> <20120814-boarddesign.pdf>
>>>>>
>>>>> On 2 Apr, 2013, at 8:56 PM, Nikki Gordon-Bloomfield <nikki at littlecollie.com> wrote:
>>>>>
>>>>>> Guys,
>>>>>>
>>>>>> Is there any scope for enabling IO from the diagnostic port to operate an relay, either directly or through some opto-isolators?
>>>>>>
>>>>>> Nikki.
>>>>>> _______________________________________________
>>>>>> OvmsDev mailing list
>>>>>> OvmsDev at lists.teslaclub.hk
>>>>>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>>>>> _______________________________________________
>>>>> OvmsDev mailing list
>>>>> OvmsDev at lists.teslaclub.hk
>>>>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>>>> _______________________________________________
>>>> OvmsDev mailing list
>>>> OvmsDev at 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 at lists.teslaclub.hk
>>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>> _______________________________________________
>> OvmsDev mailing list
>> OvmsDev at 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 at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20130416/a977f994/attachment.htm>
More information about the OvmsDev
mailing list