Layer one first. Pull up the connector pinout before writing a line of code. An integrated servo drive of this class brings out DC bus, three motor phases, feedback, and a comms/IO header — nothing else. The six gate signals that switch the bridge are generated by a timer peripheral inside the MCU and reach the gate driver as PCB traces. There is no pin, header, or test point where an external PWM source joins that path, so the question is not whether it is allowed but whether a physical hop exists. It does not.
Where does an external PWM signal stop?
Follow the packet from your application down to the motor and mark where each hop ends. Every stage above the modulator is addressable; everything at or below it is compiled into the firmware image and routed in copper.
| Hop | Runs on | Rate set by | Reachable from the public API | What stops here |
|---|---|---|---|---|
| Application setpoint | Host CPU / RTOS | Your loop scheduler | Yes | Host jitter, non-real-time scheduling |
| Host link (USB or CAN) | Host stack + drive peripheral | Bit rate, message period | Yes | Frame loss, arbitration delay, USB frame scheduling |
| Protocol endpoint / object model | Drive MCU service task | Firmware task rate | Yes | Wrong control mode, axis not in closed loop, latched error |
| Position and velocity loops | Drive MCU | Firmware loop rate | Setpoints, gains, limits | Limit clamps, integrator saturation |
| Current (FOC) loop, Clarke/Park | Drive MCU | Current-loop rate, ADC trigger phased to the carrier | Setpoint and limits only | Current limit, voltage/modulation-index limit |
| Space-vector modulator, timer compare registers | MCU timer hardware | PWM carrier period | No | Modulator boundary — the API ends here |
| Gate driver, dead-time insertion | Board hardware | Hardware dead time | No | Driver fault, gate supply UVLO |
| Half-bridges to motor phases | Power stage | — | No | Overcurrent trip, thermal limit |
The lowest setpoint the API exposes is a torque/current command. Read the actual carrier and current-loop rate out of the drive's configuration and datasheet rather than assuming them — those two numbers cap the bandwidth of anything you build on top.
Why is gate-level access withheld?
Four hardware mechanisms sit between the timer registers and a working inverter, and all four fail silently if an external source drives the gates.
- Shoot-through. If the high and low switch of one leg are asserted together, or separated by less than the driver's required dead time, that leg becomes a short across the DC bus limited only by RDS(on) and bus impedance. The device fails in microseconds — far faster than any software trip.
- Current sampling phase. Phase-current acquisition is triggered from the PWM carrier so the ADC samples inside a known conduction window. Decouple the switching from that trigger and the current measurement becomes noise, which also takes out every protection derived from it.
- High-side gate supply. A bootstrapped high-side rail needs a minimum low-side on-time per cycle to recharge. Sustained near-100% duty starves the gate drive, the FET leaves full enhancement, and dissipation climbs before anything reports a fault.
- Fault handling has no actuator. Overcurrent, bus over/undervoltage, and thermal faults act by forcing the modulator to a safe state. If the modulator is driven from outside, the latch clears nothing — the drive reports an error and keeps switching.
Add regeneration: any deceleration pushes energy back into the bus capacitors, and the firmware's clamp or brake logic is what keeps them below rating. That is the reason gate-level access is a firmware-source conversation under NDA rather than an API parameter.
Which path fits the requirement?
| Approach | Gate-level control | Drive protections | Extra hardware | Fits when |
|---|---|---|---|---|
| Custom law on the host, torque/current setpoint to the drive | No | Intact | None | Impedance/admittance control, custom trajectories, novel outer loops |
| Hardware setpoint input (PWM duty or analog decoded as a command) | No | Intact | Signal source only | Legacy RC-style or analog command sources; check the drive's IO mapping options first |
| Firmware source under NDA | Yes | Only what you keep | None | The modulation strategy itself is the experiment |
| Own inverter and gate-driver board | Yes | You build them | Full power stage, sensing, protection | Power-electronics research where topology or device is the variable |
Decide with one question: what does your algorithm actually output? If the output is a current or torque vector in the rotor frame, the modulator is not your problem and the first row solves it with the protection stack untouched. If the output is a switching sequence — six-step, discontinuous PWM, custom vector ordering, high-frequency injection with non-standard vectors — only rows three and four apply.
How do you implement the supported command path?
- Complete motor and encoder calibration through the normal drive procedure. A miscalibrated electrical angle offset makes every torque command a partly reactive one, and no host-side algorithm compensates for that.
- Set the axis to the lowest-level supported control mode — direct torque/current command — so the drive's position and velocity loops are out of the path and your law owns the outer loop.
- Set the current limit low, well under the motor's continuous rating, and current-limit the bus supply. Raise limits only after each stage of the loop verifies.
- Run your law at a fixed period on the host and timestamp every setpoint write. Measure command-to-response round-trip latency before touching a gain — on a non-real-time host, transport jitter dominates the loop's phase margin.
- Enable the drive's command watchdog and refresh it in the same iteration that writes the setpoint. A stalled host process must drop the axis to idle, not hold the last torque command.
- Clamp velocity and torque in your own code as well as in the drive, so a numerical blow-up in the host algorithm hits two independent limits.
If measured step response is dominated by link latency rather than by the current loop, the fix is not a higher gain. Move to the faster transport, reduce the loop period, or accept that the algorithm belongs inside the drive — which returns you to the firmware question.
How do you pursue firmware-level access?
Gate-level and modulator-level work is handled case by case as a firmware-source arrangement under NDA. Write to ODrive Robotics' official contact address ([email protected]) with the technical case, not a feature request. Include: the application and duty cycle; the motor's electrical parameters and the torque/speed envelope; precisely which layer you need to replace (modulator only, current regulator, or the full FOC chain); why the supported control modes cannot express the algorithm; and what protections you intend to retain versus reimplement.
Whatever you receive, the responsibilities transfer with the source. Dead-time enforcement, ADC trigger phasing, bootstrap minimum on-time, bus overvoltage clamping during regen, desaturation and thermal fault response, and the safe state on fault all become yours to maintain. Budget a dedicated bench supply with hard current limiting, a current probe, and a sacrificial motor for the first bring-up. The alternative — a separate gate-driver evaluation board and discrete power stage — costs more hardware but keeps a product drive out of the failure path when the modulation experiment misfires.
How do you verify the loop before loading it?
- Probe one phase with a current clamp against the commanded torque. Ripple should sit at the carrier frequency (or twice it, depending on the modulation), with no DC offset drift as the rotor turns slowly.
- Log the drive's measured current alongside your setpoint and compare step rise time to your host loop period. If they are the same number, you are measuring the transport, not the motor.
- Record bus voltage through a hard deceleration at the highest inertia you will run. Confirm headroom to the capacitor and drive rating, with the brake path or battery absorbing the regenerated energy.
- Force a fault deliberately — stall the rotor into the current limit — and confirm torque goes to zero, the error latches, and your host code detects the state change rather than continuing to stream setpoints.
- Soak at the intended duty and check motor and drive temperatures until they plateau, not just until the test ends.
- Last check: with the axis moving under command, pull the host link. The command watchdog must drop the axis to idle within the configured timeout and leave the mechanism where it stops.
FAQ
How do I run my own control law on an ODrive Pro without custom firmware?
Put the axis in the direct torque/current control mode, run your algorithm on the host at a fixed period, and write the current setpoint each cycle. The drive keeps FOC, current limiting, and fault handling; you own only the outer loop. Enable the command watchdog so a host stall drops the axis to idle.
How do I get access to ODrive firmware source for gate-level PWM control?
Contact ODrive Robotics at their official info address with the application, the torque/speed envelope, the specific layer you need to replace, and why the supported control modes cannot express your algorithm. Firmware availability is handled case by case under NDA, not through the public API.
How do I decide whether I actually need gate-level PWM?
Look at your algorithm's output. If it produces a current or torque vector in the rotor frame, the supported torque-command path covers it. If it produces a switching sequence — six-step, discontinuous PWM, custom vector ordering, or injection with non-standard vectors — you need firmware source or your own inverter.