OVMS3-idf/examples/peripherals/mcpwm/mcpwm_basic_config/README.md
Kewal M Shah 2008f4d88c feature: add Motor Control PWM(mcpwm) driver
1. Name change from chopper to carrier, block diagram update, minor changes to example codes
2. mcpwm_reg.h changed, brought uniformity in comments, worked on suggestions, duty to accept float. Some name changes!
3. Minor readme changes and Indetation
4. Minor change:  move mcpwm_reg.h and mcpwm_struct.h to new path
5. Minor change: addition of BLDC example code and Readme
6. Name changed from epwm to mcpwm
7. Improve the reg name in mcpwm_struct.h
8. Name change chopper>carrier, deadband>deadtime
2017-05-12 15:47:59 +08:00

1.2 KiB

MCPWM basic config Example

This example will show you how to use each submodule of MCPWM unit

The example can't be used without modifying the code first

Edit the macros at the top of mcpwm_example_basic_config.c to enable/disable the submodules which are used in the example

Step 1: Pin assignment

  • The gpio init function initializes:
    • six MCPWM output pins
    • three MCPWM fault input pins
    • three MCPWM sync input pins
    • three MCPWM capture input pins

Step 2: Connection

  • Six MCPWM output pins to motor driver input signals
  • Fault, sync, capture signals can be connected to respective signals

Step 3: Initialize MCPWM

  • You need to set the frequency and duty cycle of each three MCPWM timer along with other parameters mentioned
  • You need to set the MCPWM channel you want to use, with these timers

Step 4: Testing

  • The deadtime module, set deadtime type and with value as time*100ns
  • The sync module, synchonizes all the timer pulses
  • The fault module when enabled takes action on MCPWM signals when fault occurs
  • The capture module captures input signal(digital i.e. hall sensor value, etc), timing between two rising/falling edge