Abilities of XRP Robot?

I’m trying to build a mini swerve robot that requires 8 motors, 4 of which have encoders. I previously tried to use ROMIs but quickly realized they would be insufficient.
prototype

The XRP has 4 integrated motor controllers, which is perfect for the azimuth motors. However, I need additional slots for the driving motors. All I really need for this is 8 DIO ports for direction, and 4 PWM ports for speed. it looks like it may be possible, but I can’t quite find the documentation that allows me to use these ports with the WPILib Java software.

I’m using the swerve library YAGSL and am hoping that it can also be used on the XRP to teach freshmen how to program swerve on our bot.

Also, is there a difference between these 2 boards?

2 Likes

I’ve also seen this on Printables: XRP Differential Swerve Drive Robot! by Jacob Williams | Download free STL model | Printables.com

1 Like

I know there is a swerve kit for XRP, but it is differential drive, not a traditional swerve. It also needed a custom protocol to talk to it, and the boards networked together. I don’t think it is fully useful for your purpose, but you might be able to learn from it.

1 Like

Not in how you use them

It looks like the v1 board is now using a standalone RP2350 as a microcontroller rather than the Pi Pico (with RP2040). The RP2350 runs at 150Mhz (as opposed to the 133Mhz of the RP2040) and has 256KB more memory (520KB SRAM total). The RP2350 also has a better PIO implantation which should improve PWM handling.

It looks like if you are using the V1 board you are going to need to wait for at least the next WPILib release: [xrp] Update XRP for new SparkFun RP2350 Board (#7880) · wpilibsuite/allwpilib@dcd397e · GitHub

Is there a way to address the PWM ports and DIO ports directly in the code? I’m trying to look for examples of some simple LEDs and stuff on an external breadboard for an example, but no luck.

Depends on what you mean by “directly”. XRP Hardware Support — FIRST Robotics Competition documentation lists the hardware support; DIO and AnalogInput is supported, PWM is supported via the XRPServo class. The full builtin IO mapping is documented in the firmware README: GitHub - wpilibsuite/xrp-wpilib-firmware

If you want to do something different than what the WPILib firmware provides, you’ll need to customize it at that level.

1 Like

YAGSL does not support XRP right now but its not impossible to add as long as you had encoders

so the only available DIO ports i can address in the code are the ones listed 0-11? if so I may have to figure out how to use two boards like in the examples above. one for the azimuth motors and the other for the driving motors.

I’m new to YAGSL. I’m trying to create a Swerve bot that’s a little safer for new programmers to use. Would it be possible to split it up so that one board does the rotating part and the other board does the driving part?

Most likely. I’ve heard of a couple people doing this (using two boards to make a swerve drive) but I’m not sure what setup they’re using to make that work. The WPILib XRP HAL plugin only supports a single XRP board, and usually networking wise the XRP is an access point.