mc_parameters.c 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**
  2. ******************************************************************************
  3. * @file mc_parameters.c
  4. * @author Motor Control SDK Team, ST Microelectronics
  5. * @brief This file provides definitions of HW parameters specific to the
  6. * configuration of the subsystem.
  7. *
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
  12. * All rights reserved.</center></h2>
  13. *
  14. * This software component is licensed by ST under Ultimate Liberty license
  15. * SLA0044, the "License"; You may not use this file except in compliance with
  16. * the License. You may obtain a copy of the License at:
  17. * www.st.com/SLA0044
  18. *
  19. ******************************************************************************
  20. */
  21. /* Includes ------------------------------------------------------------------*/
  22. #include "main.h"
  23. #include "parameters_conversion.h"
  24. #include "r3_2_f1xx_pwm_curr_fdbk.h"
  25. /* USER CODE BEGIN Additional include */
  26. /* USER CODE END Additional include */
  27. #define FREQ_RATIO 1 /* Dummy value for single drive */
  28. #define FREQ_RELATION HIGHEST_FREQ /* Dummy value for single drive */
  29. /**
  30. * @brief Current sensor parameters Motor 1 - three shunt
  31. */
  32. const R3_2_Params_t R3_2_ParamsM1 =
  33. {
  34. .FreqRatio = FREQ_RATIO,
  35. .IsHigherFreqTim = FREQ_RELATION,
  36. .TIMx = TIM1,
  37. .ADCx_1 = ADC1,
  38. .ADCx_2 = ADC2,
  39. /* PWM generation parameters --------------------------------------------------*/
  40. .RepetitionCounter = REP_COUNTER,
  41. .Tafter = TW_AFTER,
  42. .Tbefore = TW_BEFORE,
  43. /* PWM Driving signals initialization ----------------------------------------*/
  44. .LowSideOutputs = (LowSideOutputsFunction_t)LOW_SIDE_SIGNALS_ENABLING,
  45. .ADCConfig1 = { MC_ADC_CHANNEL_6<<ADC_JSQR_JSQ4_Pos
  46. ,MC_ADC_CHANNEL_5<<ADC_JSQR_JSQ4_Pos
  47. ,MC_ADC_CHANNEL_5<<ADC_JSQR_JSQ4_Pos
  48. ,MC_ADC_CHANNEL_5<<ADC_JSQR_JSQ4_Pos
  49. ,MC_ADC_CHANNEL_5<<ADC_JSQR_JSQ4_Pos
  50. ,MC_ADC_CHANNEL_6<<ADC_JSQR_JSQ4_Pos
  51. },
  52. .ADCConfig2 = { MC_ADC_CHANNEL_7<<ADC_JSQR_JSQ4_Pos
  53. ,MC_ADC_CHANNEL_7<<ADC_JSQR_JSQ4_Pos
  54. ,MC_ADC_CHANNEL_7<<ADC_JSQR_JSQ4_Pos
  55. ,MC_ADC_CHANNEL_6<<ADC_JSQR_JSQ4_Pos
  56. ,MC_ADC_CHANNEL_6<<ADC_JSQR_JSQ4_Pos
  57. ,MC_ADC_CHANNEL_7<<ADC_JSQR_JSQ4_Pos
  58. },
  59. .ADCDataReg1 = { &ADC1->JDR1 // Phase B, Phase C
  60. ,&ADC1->JDR1 // Phase A, Phase C
  61. ,&ADC1->JDR1 // Phase A, Phase C
  62. ,&ADC1->JDR1 // Phase A, Phase B
  63. ,&ADC1->JDR1 // Phase A, Phase B
  64. ,&ADC1->JDR1 // Phase B, Phase C
  65. },
  66. .ADCDataReg2 = { &ADC2->JDR1 // Phase B, Phase C
  67. ,&ADC2->JDR1 // Phase A, Phase C
  68. ,&ADC2->JDR1 // Phase A, Phase C
  69. ,&ADC2->JDR1 // Phase A, Phase B
  70. ,&ADC2->JDR1 // Phase A, Phase B
  71. ,&ADC2->JDR1 // Phase B, Phase C
  72. },
  73. /* PWM Driving signals initialization ----------------------------------------*/
  74. .EmergencyStop = (FunctionalState) ENABLE,
  75. };
  76. /* USER CODE BEGIN Additional parameters */
  77. /* USER CODE END Additional parameters */
  78. /******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/