Explorar el Código

电压上报加上转把5v

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui hace 3 años
padre
commit
4ce10f30ff

+ 1 - 1
Applications/foc/motor/motor.c

@@ -176,7 +176,7 @@ static void _led_off_timer_handler(shark_timer_t *t) {
 static void mc_gear_vmode_changed(void) {
 	mc_gear_t *gears = mc_get_gear_config();
 	
-	sys_debug("limit %d-%d-%d, mode = %s\n", gears->n_max_speed, gears->n_max_idc, gears->n_max_trq, motor.b_is96Mode?"96V":"48V");
+	//sys_debug("limit %d-%d-%d, mode = %s\n", gears->n_max_speed, gears->n_max_idc, gears->n_max_trq, motor.b_is96Mode?"96V":"48V");
 	PMSM_FOC_SpeedLimit(gears->n_max_speed);
 	PMSM_FOC_DCCurrLimit(gears->n_max_idc);
 	PMSM_FOC_TorqueLimit(gears->n_max_trq);

+ 0 - 1
Applications/foc/samples.c

@@ -245,7 +245,6 @@ void sample_uvw_phase(void) {
 
 	_uvw_phase[2].value = (float)uvw[2] * UVW_VOL_CEOF;
 	LowPass_Filter(_uvw_phase[2].filted_value, _uvw_phase[2].value, _uvw_phase[2].lowpass);
-
 #endif
 }
 

+ 1 - 3
Applications/foc/samples.h

@@ -1,13 +1,10 @@
 #ifndef _SAMPLES_H__
 #define _SAMPLES_H__
 #include "os/os_types.h"
-#define MIN_GAS_VALUE 1000.0F
-#define MAX_GAS_VALUE 5000.0F
 
 void samples_init(void);
 int get_vbus_int(void);
 float get_vbus_float(void);
-float get_throttle_sfix5(void);
 float get_throttle_float(void);
 void get_phase_vols(float *uvw);
 void sample_uvw_phase(void);
@@ -26,6 +23,7 @@ void sample_ibus_offset(u16 offset);
 float get_adc_vref(void);
 float get_thro2_5v_float(void);
 float get_thro_5v_float(void);
+float get_throttle2_float(void);
 
 #endif /* _SAMPLES_H__ */
 

+ 9 - 0
Applications/prot/can_foc_msg.c

@@ -146,6 +146,15 @@ void can_response_vols(u8 can, u8 key) {
 	float vbus = get_vbus_float() * 10.0f;
 	encode_s16(data + len, (s16)vbus);
 	len += 2;
+	float thro_5v = get_thro_5v_float() * 10.0f;
+	encode_s16(data + len, (s16)thro_5v);
+	len += 2;
+	thro = get_throttle2_float() * 10.0f;
+	encode_s16(data + len, (s16)thro);
+	len += 2;
+	thro_5v = get_thro2_5v_float() * 10.0f;
+	encode_s16(data + len, (s16)thro_5v);
+	len += 2;
 	can_send_response(can, data, len);
 }