rusefi / alphax-4chan

3 stars 4 forks source link

Make Battery Voltage read from A2 (main relay) instead of F7 #166

Closed ElDominio closed 8 months ago

ElDominio commented 10 months ago
image

Pictured: Key input has 11.3v when battery has 12.1v

Using key input as battery voltage is incorrect since we base our Dwell and Injection dead time corrections off battery voltage, we should read from the same source. On most cars, key-on is usually a bit smaller voltage than main relay, but sometimes even 1v off.

rusefillc commented 10 months ago

@ElDominio this is harder than just a hardware change. At the moment we engage main relay when we sense voltage on ignition key.

if we only make the hardware change we would have to adjust 4chan settings to ALWAYS engage main relay which I assume is not desired.

For 4chan to read voltage from main relay we would need to ADD analog input not just MOVE.

@ElDominio looks like we would have to reuse one of aux analog inputs for main relay voltage. I suggest https://rusefi.com/docs/pinouts/hellen/alphax-4chan/?pin=X3

@ElDominio please confirm that we repurpose X3 analog input for main relay input

ElDominio commented 10 months ago

Can we not sense ignition ON voltage with a digital pin, then use analog to read voltage from A2?

And right now we have no complex main relay control, I think we could even engage main relay outside of MCU (what do we use MCU main relay control for besides delaying poweroff by one second?) with no real repercussions (make a circuit that engages a grounded output on F5 when there is >8v on F7) and move all voltage circuitry to A2

ElDominio commented 9 months ago

I made a circuit to do this in one of my boards, if you want i can post it here (external main relay control)

ElDominio commented 9 months ago
image

just in case

rusefillc commented 8 months ago

image

Qwerty-OFF commented 8 months ago

image

rusefillc commented 8 months ago

@ElDominio I do not have brain capacity to deal with this until January.

Do you want "rev-i" without this ticket in Dec or with it in January?

ElDominio commented 8 months ago

With it in January

rusefillc commented 8 months ago
#if EFI_MAIN_RELAY_CONTROL
    hasIgnitionVoltage = Sensor::getOrZero(SensorType::BatteryVoltage) > 5;
rusefillc commented 8 months ago

Let me remove R53 to test https://github.com/rusefi/rusefi/commit/3b88f847e0370de6afc359f88c7c315cf695689c

open question what pin to use for ignitionKeyDigitalPin

rusefillc commented 8 months ago

Попробуй такое, резистор 1-10к, транзистор AO3400A. Пин будет инверсный, т.е. "0" когда есть vign

Схема не подойдет для вариантов где всегда есть напряжение на нашем vign входе, будет подъедать аккумулятор

WhatsApp Image 2023-12-10 at 12 58 40_4135a36b

Qwerty-OFF commented 8 months ago

Схема не подойдет для вариантов где всегда (на заглушенной машине) есть напряжение на нашем vign входе, будет разряжать аккумулятор. Также измерение напряжения главного реле через резисторный делитель тоже будет расходовать заряд батареи. Для автомобилей у которых питание always hot и запуск по can wakeup надо придумать что-то лучше.

rusefillc commented 8 months ago

устал я от этой темы, я уже согласен на второй аналоговых вход

а можем ли мы сделать AV из AT1 например удалением резистора?

image

Qwerty-OFF commented 8 months ago

Да, можно сделать av через replace

rusefillc commented 8 months ago

@Qwerty-OFF давай заведём main relay +12v на AT1 с делителем