davidmolony / MESC_Firmware

FOC library for BLDC/PMSM compatible with all STM32 targets with FPU.
https://davidmolony.github.io/MESC_Firmware/
148 stars 36 forks source link

Request for CAN improvements #61

Open owhite opened 1 year ago

owhite commented 1 year ago

See: https://github.com/davidmolony/MESC_Firmware/blob/FW_ADC_sampling/MESC_RTOS/MESC/MESCinterface.c

starting around line 493

At present when we perform data logging, we export all these values:

  1. mtr[0].Conv.Vbus , "vbus"
  2. mtr[0].FOC.eHz , "ehz"
  3. mtr[0].Conv.MOSu_T , "TMOS"
  4. mtr[0].Conv.Motor_T , "TMOT"
  5. mtr[0].FOC.Idq_req.q , "iqreq"
  6. mtr[0].FOC.Idq_smoothed.d , "id"
  7. mtr[0].FOC.Idq_smoothed.q , "iq"
  8. mtr[0].Raw.ADC_in_ext1 , "adc1"
  9. MESC_errors , "error"
  10. mtr[0].FOC.Vdq.q , "Vq"
  11. mtr[0].FOC.Vdq.d , "Vd"

I believe only 1-5 are available through CAN, could you send the additional variables? An slight alternative is to basically send the same content as what is transferred with "status json".

Please consider creation of CAN commands to: