motor - ebolzMagy/EMCFFBV2 GitHub Wiki

Motor Configuration

Click X or Y Motor Driver in the EMCFFBV2Utility to access the Motor Settings page. Motor Click Motor Settings

Motor Status

The Motor Status section provides real-time information about the motor and its operation:

  • Motor Type: Displays the type of motor connected (e.g., BDC or BLDC).
    • Green: Motor is ready.
    • Red: Motor error detected.
  • Brake Resistor Engaged: Indicates whether the brake resistor is active (true or false).
  • Voltage Plot: Displays the real-time voltage reading.
    Note: Voltage calibration may be required for accurate readings.
  • Current Plot: Displays the real-time current reading for each motor phase.
    Note: Current sensing functionality is currently under development.
  • Motor Angle Plot: Displays the real-time motor angle position.
  • Motor Target Plot: Displays the target position for the motor.

PSU and Brake Resistor Settings

This section allows you to configure the power supply and brake resistor settings.

Brake Resistor

PSU Settings

  • PSU Voltage: Sets the voltage of the power supply (in volts).
  • Brake Threshold: Sets the voltage threshold at which the brake resistor is activated (in volts).

Voltage Calibration

  • Calibration Factor: Adjusts the voltage reading to match the actual voltage measured by a multimeter.
    Formula: Calibration Factor = (Multimeter Reading) / (Voltage Plot Reading)

  • Resistor Divider (R1 and R2): Sets the values of the resistor divider used for voltage sensing.
    Example: For a maximum input voltage of 60V and an ADC output of 3.3V, use the following formula:
    R2 = (Vout * R1) / (Vin - Vout)

    Where:

    • Vin = 60V (maximum input voltage)
    • Vout = 3.3V (ADC output voltage)
    • R1 and R2 are the resistor values in ohms.

Brake Resistor PID Control

  • Brake P, I, D: Sets the PID control parameters for the brake resistor.
  • PID Filter: Sets the low-pass filter for the PID control signal.

Note: To enable brake resistor functionality and voltage sensing, ensure the following pin modes are configured:

  • VSENSE: For voltage sensing.
  • BRAKE_RESISTOR: For brake resistor control.

Motor Configuration

This section allows you to configure the motor parameters.

Motor Settings2

PWM Driver

  • Mode: Selects the motor driver mode (e.g., RC PWM, Centered PWM, PWM/DIR, etc.).
  • Frequency: Displays the PWM frequency in Hz.

Motor Settings

  • Invert: Reverses the motor direction.
  • Poles: Sets the number of poles in the motor.
  • Motor KV: Sets the KV rating of the motor.
  • Phase Resistance: Sets the phase resistance of the motor.
  • Phase Inductance: Sets the phase inductance of the motor.
  • Current Limit: Sets the maximum current limit for the motor.

Current Sense

This section is used to configure the current sensing settings.

Motor Csensing

Current Sense Settings

  • Sense Type: Not implemented yet.
  • Shunt: Not implemented yet.
  • Gain: Not implemented yet.
  • Ratio: Sets the mV/A ratio for the Hall current sensor.

Current PID Control

This section allows you to configure the PID control for motor current.

PID Settings

  • P, I, D: Sets the proportional, integral, and derivative gains for the PID controller.
  • PID Filter: Sets the low-pass filter for the PID control signal.

Troubleshooting Motor Error

If the motor status is red (indicating an error), it could be caused by several issues. Follow these steps to troubleshoot:

  1. Check Sensor Position:
  • Ensure the sensor is properly connected and positioned. Misaligned or disconnected sensors can cause motor errors.
  1. Check Power Supply:
  • Ensure the motor power supply (PSU) is turned on and providing the correct voltage.
  • Note: Always turn on the motor PSU before powering the ESP32 board.
  1. Check Motor Connections:
  • Verify that the motor is properly connected to the driver and the driver is connected to the ESP32 board.
  1. Check Motor Driver Configuration:
  • Ensure the motor driver mode and settings (e.g., PWM frequency, current limit) are correctly configured.
  1. Check Voltage and Current Readings:
  • Use the Voltage Plot and Current Plot to verify that the motor is receiving power and the current is within the specified limits.
  1. Restart the System:
  • Turn off the motor PSU and ESP32 board, then restart the system in the correct order (PSU first, then ESP32).

Next Steps

➡️ Continue to Wiring for wiring examples.


Need Help?

If you have any questions or need assistance, visit the Discussions section.


Happy building! 🚀