Commit Graph

17 Commits

Author SHA1 Message Date
Adeeb Shihadeh b342c2d724
fan: add stall threshold backoff (#1357)
* fan: add stall threshold backoff

* Update board/config.h

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-21 15:41:26 -07:00
Adeeb Shihadeh 272b81e97b
fan: fix stall detection (#1351)
* cleanup and fix

* dos must stall

* clean those up

* fix misra

* more test

* fix import

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-20 15:44:12 -07:00
Adeeb Shihadeh 3c75a8bc00
add fan stall count to health (#1355)
* add fan stall count to health

* fix misra

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-20 13:30:56 -07:00
Adeeb Shihadeh 0e2eb9c0f5
fan debugging script (#1354)
* fan debugging script

* merge those

* disable

* better print

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-20 13:00:40 -07:00
Robbe Derks 237ffedcb3
Dos fan fix (#1335)
* hitl fan test

* enable cooldown on dos as well

* small cleanup

* get expected RPM from panda class

* fix

* overshoot test

* fix max RPM getting

* fix percentage

* revert cooldown fix

* add cooldown for dos fan as well

* remove feedforward from the fan controller to eliminate overshoot

* update clip

* cleanup

* add that back

---------

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-04-18 14:15:06 -07:00
Robbe Derks c0aea3273a
Tres: fan cooldown + no stall recovery (#1287)
* add fan cooldown

* refactor to be inside the fan driver

* fix rebase

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-03-16 14:15:43 +01:00
Adeeb Shihadeh ae66bbcaa8
tres fan (#1162)
* fan on

* little cleanup

* move to main
2022-11-17 21:02:37 -08:00
Adeeb Shihadeh 609a8e087a
fan: reset error integral when disabled (#1119) 2022-10-27 13:58:19 -07:00
Adeeb Shihadeh 60f366c1b4
fan: don't fully reset integral when recovering from stall (#1058)
* fan: don't fully reset integral when recovering from stall

* clip to [0, 70]

* 50%
2022-09-01 21:11:06 -07:00
Robbe Derks ba8772123f
Simple integrating fan controller (#1022)
* fast rpm measurement

* fix indentation

* this seems stable

* clip fan integral

* fix misra

* add fan power to health

* board-specific max rpm

* refactor fan enable

* cleanup

* stall detection and reset

Co-authored-by: Comma Device <device@comma.ai>
2022-08-17 20:43:49 -07:00
Igor eab9c9ee4c
HAL refactoring part 2 (#682)
* Move harness threshold

* Move interrupt handlers

* timers.h refactor

* rtc.h refactor

* pwm.h and fan.h refactor

* clock_source is hw specific

* refactor uart.h

* macro naming

* minor fixes

* redo rtc
2021-07-13 14:12:07 -07:00
Igor 7d93e5a202
Refactor HAL (#656)
* Let refactoring begin!

* Fix pedal build

* Fix pedal safety tests

* Forgot few TIM2 instances

* Try this way with misra

* More misras...

* More misras...

* Still fighting with misra blindfolded

* Almost got it!

* Last misra error..

* Last misra error..

* Misra works locally..

* Maybe this?

* Looks like it was cppcheck bug, revert changes

* Suggested changes and reverts

* File structure change

* revert includes

* remove spaces

* remove timer delay

* endings

* more typing

* rename early to early_initialization

* Remove delay_us

* Revert RTC default values

* Revert initialization sequence

* Fix quotes

* Revert

* Return TIM6EN

* Alias slow timer to TICK_TIMER

* Refactor files structure

* Remove definition of PANDA

* Abstract timers

* Fix include

* tick_timer_init

* Split usb driver

* Move LL stuff: adc

* Move LL stuff: usb

* Fix include again...

* Will check pedal builds also locally..

* Move LL stuff: CAN

* Move LL stuff: clock

* Rename common to peripherals and move

* Move board HAL

* Change include, not needed for pedal

* llgpio to gpio and new lines fix

* remove board_has_relay, not used

* Remove board_functions.h and add to board struct

* Move include

* Fk MISRA...

* has_onboard_gmlan to has_hw_gmlan

* Typos

* Move board_declarations include

* Shuffle

* More abstraction

* fix paths, fix cppcheck test

* Fix for pedal build with USB
2021-07-02 18:25:35 -07:00
Riccardo df4159c846 Revert "Revert "Register readback on most modules. Still need to convert the other ones (#396)""
This reverts commit 56ec215024.
2019-12-05 14:19:29 -08:00
Riccardo 56ec215024 Revert "Register readback on most modules. Still need to convert the other ones (#396)"
This reverts commit 893e486194.
2019-12-05 13:55:20 -08:00
robbederks 893e486194
Register readback on most modules. Still need to convert the other ones (#396)
* Added an initial working implementation of the register readback and applied it to the LLCAN registers. Also fixed an init bug in CAN.

* Locally disable pylint import error

* Reverted change to CAN-obj->FA1R setting

* Fixed misra compliance

* Changed hash function name

* Fixed CAN filter setting

* Added voltage health test

* Converted ADC to register functions

* Converted clock to use register setters

* Added check to see if fault status is zero after running test

* Converted DAC to use register setters

* Converted fan to use register setters

* Converted gmlan bitbanging to use register setters

* Changed over interrupt driver to use register setters. Also moved some includes and definition places for critical sections

* Fixed build

* Converted LLGPIO to use register setters

* Converted pwm to use register setters

* Fixed cold boot

* Fixed health fault check in automated tests

* Added comment for the future (issue #367)

* Converted RTC driver to use register setters

* Converted SPI to use register setters

* Converted timer driver to use register setters

* Fixed register fault on white pandas and disabled showing of fault for release

* Bump version
2019-12-04 20:42:57 -08:00
robbederks 656f99b080
Interrupt refactor (NVIC_SM_1: #334) and Fault handling (#377) (PR #373) 2019-11-27 18:11:21 -08:00
rbiasini a12a148d5f Uno (#274)
* Added uno

* Added usb switch support

* Added PWM and IR power functions

* Implemented bootkick

* Added uno as a new hw type

* Bumped version

* Added fan control and tach readout

* WIP: RTC support

* Working RTC

* Fixed python

* Misra compliance

* Added USB control messages for fan/IR power

* Added USB commands + tests for fan & IR control. Fixed bootstub and pedal compilation

* Added IR and fan to power saving mode

* Changed defaults

* Fix safety considering uno

* passing safety now

* Minor UNO tweaks

* Fixed version

* More minor temporary tweaks

* Removed usb load switch from uno

* Added power control for shutting down the fan completely

* Disable IR LEDs by default

* Fixed linter issue

* Linter fix #2
2019-10-25 16:22:42 -07:00