In this module, we will bypass the XRP’s mechanical drivetrain and examine the digital motor-control signal generated by the RP2350-based production XRP Controller. Using the Red Pitaya STEMlab oscilloscope, you will measure the 3.3 V logic waveform on the left motor Phase signal, GPIO 34, which is routed to the DRV8411A motor-driver circuitry. You will compare the measured PWM period and duty cycle with the motor effort commanded in MicroPython.
Materials and Setup
- XRP Robot
- Red Pitaya (configured for LV ±1V inputs)
- Oscilloscope probe (configured for 10x attenuation)
- Two male-to-male jumper wires (GPIO 34 and GND).
Measurement Configuration
- Verify Zero-Power State: Ensure the XRP is completely disconnected from USB-C and the physical battery switch is OFF. Power off the Red Pitaya before changing its input jumpers or probe connections.
- Ground Connection:Â Insert a male-to-male jumper wire into a XRPÂ
GNDÂ pin on the extension header. - Connect the Probe Ground:Â Attach the Red Pitaya Channel 1 probe ground clip to the exposed male end of the jumper connected to XRPÂ
GND. Connecting the ground clip first is a good practical habit, but make sure the system remains unpowered while making all connections. - Prepare the Signal Connection:Â Insert another jumper wire into the XRP expansion-header pin labelledÂ
GPIO 34Â /ÂMotor L Phase. - Connect the Probe Tip:Â Attach the Channel 1 probe hook to the exposed metal end of the jumper connected toÂ
GPIO 34. Make sure the hook contacts the metal conductor, not only the black plastic housing - . Configure the Probe and Input: Set the physical probe to 10×, set the Red Pitaya software probe attenuation to 10×, and verify that the Red Pitaya input hardware is configured for LV.
- Vertical Scale: Set the vertical scale to 1 V/div. With a correctly configured 10× probe, this displays the 3.3 V logic waveform clearly while keeping the voltage at the Red Pitaya input within the LV range.
- Timebase: Set the timebase to 10 ms/div to display the approximately 20 ms PWM period.
- . Trigger: Set the trigger source to Channel 1, the edge to rising, the level to approximately 1.65 V, and the mode to Normal.
- Enter Safe Testing State: Once the wiring and oscilloscope configuration are verified, connect the USB-C cable to the XRP and leave the battery switch OFF. In the tested setup, this powers the controller logic without battery-powered motor operation. Keep the robot secured during the test.
Connection summary:
1. XRP GPIO 34 ── male jumper wire ── Channel 1 probe hook
2. XRP GND ── male jumper wire ── Channel 1 ground clip
3. Secure the jumper wires or probe hooks so that the connections do not need to be held by hand while the XRP is powered. Do not adjust or reposition the connections during the measurement.
Exploration and Analysis
- Signal Capture: Run the MicroPython script commanding the left motor to drive at 25%, 50%, and 75% effort. Use the Red Pitaya oscilloscope interface to capture the waveforms Click STOP in the Red Pitaya web interface during any stage to freeze the waveform for cursor measurements.
import time from XRPLib.defaults import * print("Starting Left Motor Verification Sequence...") try: # 1. 25% Motor Effort for 7 seconds left_motor.set_effort(0.25) time.sleep(7) # 2. 50% Motor Effort for 7 seconds left_motor.set_effort(0.50) time.sleep(7) # 3. 75% Motor Effort for 7 seconds left_motor.set_effort(0.75) time.sleep(7) except KeyboardInterrupt: print("\nExecution interrupted by user.") finally: # 4. Safe automatic stop left_motor.set_effort(0)
- Duty Cycle Verification:
Treat your oscilloscope display as a digital ruler. For each commanded effort, use your time cursors (X1, X2) or count the grid divisions to verify the waveform timing, then expand the toggle to check your results. Calculate the empirical duty cycle using the formula below and compare it to your commanded software effort:
Â
Â
- Test 1: 25% Effort
- Visual Target: (2 horizontal divisions at 10 ms/div)
- Task: Measure the duration the signal stays HIGH .
- Expected 5.0 ms (0.5 horizontal divisions)
- Calculated duty cycle:
- Observed frequency: 50 Hz
Check expected values & waveform
Â
- 50% Effort
- Visual Target: T = (2 horizontal divisions at 10 ms/div)
- Task: Measure the duration the signal stays HIGH .
- Expected : 10 ms (1 horizontal division)
- Calculated duty cycle:
- Observed frequency: 50 Hz
Check expected values & waveform
Â
- 75% Effort
- Visual Target: T = (2 horizontal divisions at 10 ms/div)
- Task: Measure the duration the signal stays HIGH .
- Expected 15.0 ms (1.5 horizontal divisions)
- Calculated duty cycle:
- Observed frequency: 50 Hz
Check expected values & waveform
Â
- Waveform Anomalies (Overshoot): Examine the sharp rising edge of each pulse. You may observe a transient voltage spike exceeding (often peaking near before settling. This is not true battery voltage leakage, but rather high-frequency inductive overshoot caused by jumper wire inductance, probe ground lead loop inductance, and the fast switching speed of the microcontroller GPIO.
Summary reference table
Commanded Effort | Expected Duty Cycle | Expected HIGH Time (ΔtHIGH) | Period (T) | Grid Divisions (10 ms/div) |
0.25 (25%) | 25% | 5.0 ms | 20.0 ms | 0.5 div HIGH / 1.5 div LOW |
0.50 (50%) | 50% | 10.0 ms | 20.0 ms | 1.0 div HIGH / 1.0 div LOW |
0.75 (75%) | 75% | 15.0 ms | 20.0 ms | 1.5 div HIGH / 0.5 div LOW |
Â
Conclusion
By analyzing digital logic signals in the time domain, you directly verify the software-commanded effort before mechanical inertia or battery droop affects the drivetrain. The observed deviations, such as inductive ringing and carrier frequency harmonics, illustrate the real-world electrical behaviors inherent to embedded microcontroller platforms
Â
Shutdown Procedure
- Halt Execution: Stop the MicroPython script in XRPCode.
- Verify Waveforms: Confirm via the Red Pitaya interface that all active PWM logic traces on GPIO 34 have ceased pulsing and flatlined.
- Unplug Logic Power: Disconnect the USB-C cable from the XRP Controller.
- Isolate Battery: Double-check that the physical battery switch is set to OFF.
- Safe Modifications: Only alter, disconnect, or clean up your physical probe connections and jumper wires once the system is in this completely unpowered state.