Stabilized Code (Removed clicking eliminator and reduced output voltage)
This commit is contained in:
parent
3c1446ef2a
commit
0784295572
|
@ -2,7 +2,6 @@
|
|||
#include "pico/stdlib.h"
|
||||
#include "pico/time.h"
|
||||
#include "hardware/pwm.h"
|
||||
#include "hardware/adc.h"
|
||||
|
||||
#include "CC_Charger.h"
|
||||
#include "pulse_generator.h"
|
||||
|
@ -12,9 +11,9 @@
|
|||
|
||||
//OUTPUT PULSE PARAMETERS (times in usecs)
|
||||
#define OUTPUT_ON_TIME 20
|
||||
#define OUTPUT_OFF_TIME 80
|
||||
#define OUTPUT_OFF_TIME 70
|
||||
#define ISO_PULSE false
|
||||
#define CAP_VOLTAGE_SETPOINT 70
|
||||
#define CAP_VOLTAGE_SETPOINT 65
|
||||
|
||||
//CC Charger Parameters (don't change unless you know what you're doing)
|
||||
#define CHARGER_CURRENT 850
|
||||
|
@ -65,8 +64,6 @@ int main() {
|
|||
|
||||
sleep_ms(1000);
|
||||
|
||||
adc_init();
|
||||
|
||||
CC_Charger_init(CHARGER_CURRENT, CAP_VOLTAGE_PWM_LEVEL); //Setup the CC Charger Outputs
|
||||
|
||||
pulse_generator_init(70); //Setup Pulse generator
|
||||
|
|
|
@ -117,16 +117,10 @@ int64_t begin_off_time(alarm_id_t id, void *user_data){
|
|||
|
||||
gpio_set_irq_enabled(OUTPUT_CURRENT_TRIP_PIN, GPIO_IRQ_EDGE_RISE, false); //Disable the ignition sense irq
|
||||
|
||||
adc_select_input(1);
|
||||
uint16_t v_cap = adc_read();
|
||||
bool low_v = v_cap < 900;
|
||||
gpio_put(SHORT_ALERT_PIN, low_v);
|
||||
if(low_v)
|
||||
LIMIT_set_timing(97, 7, false); //Limit CC Charger PWM duty cycle to avoid inrush (was 97)
|
||||
|
||||
enable_CC_timing(v_cap < 1300); //Start CC Charger
|
||||
enable_CC_timing(true); //Start CC Charger
|
||||
|
||||
if(low_v)
|
||||
add_alarm_in_us(15, change_CC_timing, NULL, true); //Setup the alarm to correct CC charger timing
|
||||
add_alarm_in_us(pulse_off_time-11, begin_on_time, NULL, true); //Setup the alarm to turn on the output MOSFET after the off time
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -63,7 +63,7 @@
|
|||
36,
|
||||
40
|
||||
],
|
||||
"visible_layers": "8089110_7fffffe1",
|
||||
"visible_layers": "8089130_7fffffe1",
|
||||
"zone_display_mode": 0
|
||||
},
|
||||
"meta": {
|
||||
|
|
Loading…
Reference in New Issue