I started a thread on the problems of Hybrid-Sleep. hybrid-sleep-win7-trying-to-solve-a-strange-problem
As a result, I came up with another way of having Hibernate, Sleep and Shutdown options for my Car-PC.
When coming up with a solution to overcome a Hybrid – Sleep problem with Win7 on some hardware, I found that using software commands to suspend the PC into 3 different states caused a problem that needed to be overcome, that was, making the M4 drop +5v standby in Shutdown and Hibernate but NOT in Sleep.
At first glance you would think that PC mode could be utilised on the M4 instead of mode 1 and above, however you end up with the same problem and then even more.
My FE takes information from a number of Microcontrollers; one I call the Vehicle interface controller. This already monitors the state of the Auto/Manual switch, the Accessory voltage and the Ignition on voltage. Using this info the FE can select which Suspend mode I want with the state of a switch I call the Auto/Manual switch. This is the switch going to the IGN line (On/Off line) of the M4. Note: You could use a Fusion Brain board for detecting ACC, IGN and switch logic.
Because the FE is now controlling the suspend state of the PC, the first thing is to set the PC to ignore the off pulse from the M4, done by setting the PC power button action = nothing in Windows.
The M4 is then set for an off-delay (delay before acknowledging the state of its IGN (on/off line), that’s longer than the time taken for the FE to see the on/off toggle of the Auto/Manual switch. The time chosen in this case is 5 seconds.
When the PC is Shutdown, Hibernated or placed into Sleep mode with a software initiated command, the M4 will see that condition and switch off, however it does not switch off the +5v standby rail. This is action we want for sleep, but not for the other two modes.
For any of the software suspend modes the M4 can be made to drop +5v standby when the M4 IGN line is taken low – Providing the M4 has not sent a turn-off signal to the PC itself. Otherwise the M4 will be in the “waiting for PC off acknowledgement” mode and will think the PC has acknowledged when it closes after finishing the software initiated close command, in that case, when the IGN line goes low, it will NOT drop +5v standby for a delay period programmed into the M4 Hard off timer. In addition the M4 IGN line must be high when the PC closes down, only then will the M4 drop +5v standby as the IGN line is taken low.
At the moment, I manually turn the Auto/Manual switch off until the Front End announces it has seen the switch state (one second) now the FE locks into that state and will ignore any change in the A/M switch. Turning the switch back on again, before the time that the M4 is programmed to respond to the IGN input, makes the M4 automatically kill +5v standby when the Vehicle is turned off “after the M4 powers off”
Action: PC -> Sleep
Turn the Vehicle off.
The majority of time I turn the Vehicle off, get out and lock the car. The IGN line goes low and the FE announces Sleep mode and starts the sleep state process. The M4 IGN line, which is low will reach it’s off timeout period and send a power switch pulse (which the PC is set to ignore), a few seconds later when the PC closes in sleep mode, the M4 sees that as an acknowledgement of it's Power switch pulse and now powers down correctly with +5v standby enabled. In other words, it acts exactly the same as before.
PC -> Hibernate.
The option to Hibernate is enable by turning the Vehicle IGN to accessory and pressing the Auto/Manual switch until the FE announces Hibernate (1 second), then turn the switch back on and wait for the PC and M4 to power down (7 seconds) then turn the vehicle off. The M4 drops +5v standby and the PC is in hibernate with no +5 standby voltage.
PC -> Shutdown.
Shutdown is rarely used and would only be needed if the PC was behaving strangely after numerous sleep/resume and-or hibernate/resume cycles and usually at the worst possible time – while driving. So as the FE sees the car is fully on or running, I can just turn off the Auto/Man switch for a second, after the PC has shutdown turn the A/M switch off and on and the PC will start with a fresh reboot.
Of course this can be selected from a Sub Menu, but doing it with the A/M switch means no distracting menu clicking or touch screen navigation – you eyes need never leave the road.
I’m about to automate the need to wait for the M4 to stop before turning the Vehicle completely off when selecting Hibernate or Shutdown, just for the times when 7 seconds is the difference between life and death – or in my case, I forget to wait before turning off and leave standby +5 running for x number of hours, in my case I have it set for 17 hours.
To automate this, the FE tells the Interface Micro that a software Hibernate or Shutdown has started and is locked in. The Micro will switch and hold the IGN line to the M4 high so that the M4 does not trigger itself into off mode. Once +12v output from the M4 has dropped (M4 is off with Standby +5 running) the M4-IGN line is automatically restored, which will take the IGN line low, dropping +5 standby and now ready for the next valid start signal.
If +12 does not drop in a predetermined time the Micro will momentarily drop +12v input to the M4 and shut it off, which is pretty much what the M4 does below if it could not shutdown the PC.
In sleep mode which is completely controlled by the M4, as before, if for some reason the PSU had not shutdown and because the IGN is low, the M4, as it’s in mode 1, will still do it’s normal Emergency-off after a predetermine time.
Now someone will be saying, why go to the trouble?
Well, resume from sleep is under 2 seconds. Hibernate is around 25 seconds and cold boot with this new MB is around 60 seconds (was 29 seconds with the previous MB.)
For some of us who do short trips and are in and out of the car quite a bit, sleep is exactly what we want (almost instant on). But short trips will gradually deplete a battery, overnight in sleep mode with only short trips will kill sleep mode by discharging the battery after a night or two. So Hibernate is what we want at night when not doing a lot of driving. Even if you set Hard-off for say, 7 hours, with infrequent short drives you are still going to slowly drain the battery and once again kill sleep mode.
A number of PC owners have found Hybrid-Sleep to be unreliable or unusable, as I have. On top of that Hybrid-Sleep does not solve the problem of short trips and not driving the car for a day or two. Exactly how long do you set the PSU Hard–off timer to allow for continually varying driving times and battery state? I can’t find one, maybe someone has, but I bet it won’t suit me.
With this system I can resume from sleep all day long and overnight if needed. If not using the car the next a day, I can put it into Hibernate with the touch of a button and not have to wait for any long Hard-off period to flatten the battery even further.
Is having the option to Hibernate by simply pressing a button for “a lousy second” before you leave the car at the end of the day that much of an inconvenience?