Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. // General config
  2. configSenseMaxThresh(THRESH_100MV);
  3. configCurrentLimit(1800, 100); //
  4. configSpeedFlags(DCC_DISABLED, DECEL_1);
  5. configSpeed(SpeedControlRes::RES_0_4HZ, 0, 820);
  6. configSpeedAccel(500, 31);
  7. configStopOnFail(ENABLED);
  8. configVLRvoltage(VLR_3_3V);
  9. configGateDrive(DRIVE_11V);
  10. configOperatingMode(SPI_ONLY);
  11. configWakeMode(WAKE_PWM);
  12. configPWMSense(PWM_DIRECT);
  13. configCurrentLimitEnable(ENABLED);
  14. configMotorMode(CLOSED_LOOP_SPEED);
  15. configDriveMode(SINUSOIDAL);
  16. configOvermodulation(OVM_100P);
  17.  
  18. // PWM
  19. configPWM(PHASE3, ALIGN_CENTRE, 50000); // hz
  20. configDither(DITHER_1600NS, DWELL_1MS, 10); // 0 steps = dither disabled
  21. configBridge(GAIN_20, 600); // gain, dead time ns
  22.  
  23. // Gate
  24. configGateCurrent(CUR_TURN_OFF, 0, 0); // drive turn-off current1, current2: mA, 0=switching
  25. configGateCurrent(CUR_TURN_ON, 0, 0); // drive turn-on current1, current2: mA, 0=switching
  26. configGateSlew(0, 0); // ns
  27.  
  28. // Current Limiting
  29. configCurrentLimit(1000, 100); // blank time ns, scale %
  30.  
  31. // VDS
  32. configVDSOvervoltage(1550); // mv
  33. configVDS(DEBOUNCE, 3150); // ns
  34.  
  35. // Startup
  36. configStartupAlign(100, 3); // hold time ms, duty cycle percent
  37. configStartupMotor(COAST_OFF, DESYNC_RESTART_OFF, 750, RAMP_0P);
  38. configWindmill(DISABLED, 7, 50); // freq hz, duty cycle percent
  39.  
  40. // Ramping
  41. const int rampStopHzx10 = freqx10 > 325 ? 325 : freqx10;
  42. configRamp(15, 3, rampStopHzx10, 3); // start freqx10 hz, duty, end freqx10, duty
  43. configRampStep(10, STF_2HZ); // step time ms, step freq
  44.  
  45. configPhaseAdvance(ADV_AUTO, ADV_GAIN_4, 0); // mode, gain, degrees*10
  46.  
  47. // BEMF
  48. configBEMFDetectWindow(560); // degrees*100
  49. configBEMF(SPC_6, BEMFFilterTime::BF_10MS); // samplecount, filtertime
  50.  
  51. // Commutation control
  52. configCommSteadyPow2(0, 0); // P, I (pow2)
  53. configCommTransientPow2(0, 0); // P, I (pow2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement