Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/us charger #8

Merged
merged 6 commits into from
Apr 25, 2024
Merged

Feature/us charger #8

merged 6 commits into from
Apr 25, 2024

Conversation

takurot
Copy link
Contributor

@takurot takurot commented Apr 22, 2024

FastChargeではベースとしている充電器の違いから、従来シーケンスのAMR側SSRオン→Charger側SSRオンとすると、AMR側SSRがオンした瞬間にCharget側SSRのダイオードを経由してAMR側から電流が流れてしまい、BMUが過電流を検出してAMRが落ちてしまう。その対策として、Charger側SSRをONした後に、AMR側SSRをONする。これによりCharger側の電位が高い状態でAMR側SSRがオンするので、AMR側から電流が流れることを防止できる。

対策として

  • 充電器を検出(5Vを検出)したらCharger側のSSRをON
  • 自動充電電極で充電電圧の90%以上が検出されたならば、Charger側の準備ができたとして、AMR側のSSRをONにする

としている。この対策は、FastChargeでも従来の充電器でもどちらにAMRが充電しにいっても問題なく動作する。

Due to the difference in the chargers on which FastCharge is based, if the conventional sequence is AMR side SSR on -> Charger side SSR on, current flows from the AMR side via the diode in the Charget side SSR the moment the AMR side SSR turns on, and the BMU detects the overcurrent and The BMU detects the overcurrent and the AMR falls down. As a countermeasure, turn on the AMR-side SSR after turning on the Charger-side SSR. This turns on the AMR-side SSR while the Charger-side potential is high, thus preventing current from flowing from the AMR side.

Countermeasures

  • Turn on the Charger side SSR when the charger is detected (5V is detected)
  • If 90% or more of the charging voltage is detected at the automatic charging electrode, then turn on the SSR on the AMR side as the Charger side is ready

This measure works fine whether AMR goes to FastCharge or a conventional charger to charge the battery.

main.cpp Outdated Show resolved Hide resolved
main.cpp Outdated
@@ -399,6 +399,15 @@ class auto_charger { // Variables Half-Implemented (Not Thermistors ADC)
set_enable(false);
send_heartbeat();
}
bool is_charger_ready() const {
if(connector_v > (CHARGING_VOLTAGE * 0.9)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"以上"だとしたら符号が違う。
( 大差ないとは思います。 )

If it is "more than", the sign is different.
( I don't think there is much difference. )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。ここのしきい値はあまり厳密な値ではなく、Charger側のSSRがONしたかどうかが見れればよいので、> で問題ありません。

Thank you very much. The threshold value here is not very strict, but just enough to see if the SSR on the Charger side is turned on or not, so > is fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なるほど。承知しました。

I see. I understand.

main.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@shujima shujima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
コメントしたところは将来2000人のエンジニアで300種類のAMRを開発してるころには問題になりそうですが、現時点では自分でtoo muchな指摘だと思っています。

@@ -882,8 +899,10 @@ class state_controller { // Variables Implemented
LOG("plugged to manual charger\n");
set_new_state(POWER_STATE::MANUAL_CHARGE);
} else if (!charge_guard_asserted && ac.is_docked() && bmu.is_chargable()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ac.is_docked()とis_charger_ready()の2つで電圧を評価しているのがやや気持ち悪い感じがします。is_docked()が本来は充電中ではない充電器が出している5Vを検出するための関数であるのに、目的外の利用になっているような感じです。
ただ弊害はなく、is_dockedを消しちゃうと温度センサの評価が無くなったりもするので、このまま修正しなくていいのかなと思いました。

@takurot takurot merged commit e91418b into main Apr 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants