ROMI not running Motor Controller

We are programming for an off-season competition using the FRC’s Romi and having issues running code to control a SparkMAX motor (We are using a pwm connection to connect to ROMI rather than CAN). We can connect our driver station laptop to the ROMI over wifi and deploy robot code in WPILib but it instantly deploys (which is strange) and doesn’t seem to actually control the motor when in simulation or FRC Driver Station Application.

Our main theory has to do with the fact when we try to change the gateway on wpilib.local (the ROMI’s local webserver) to 10.65.0.2, which is our teams IP Notation, it resets back to 0.0.0.0 even if we save it in writable. This could explain the fact that even though all of the lights on Driver Station for communication, robot code, and joystick are green, it still provides warnings in the right hand log for “Warning 40044” and “44000” that the Driver station loses connection with the robot.

It should be noted the purpose of our program (Our branch is attached below) is to simply set a pwm motor to 0.5 when we press A on a joystick, which happens in simulation- but clearly not in the actual powered motor controller in real life.

Our Branch “Test”: ERC-SethError/src/main/java/frc/robot at test · 6500gearcats/ERC-SethError · GitHub

So there could be a few things going on here. You should be aware that there are some differences between how the Romi configures its network vs. a normal Rio setup.

If you are losing the network connection from the drive station to the Romi then the EXT outputs will be disabled, so it’s best to start there. If you disconnect the SparkMAX, does the Romi connect and drive normally?

If the network works intermittently, you could have a power problem. Make sure you have fresh batteries in the Romi, and review your wiring and power distribution to all peripherals.

If the Romi is connected and otherwise working (ie: its own drive motors respond) then you should check the GPIO configuration to make sure you’ve enabled the correct output pins for PWM, and that the PWM port number matches what you’re using in your Romi code for the subsystem. (This part looks possibly incorrect to me as your code looks like it expects to find the SparkMAX on Port zero.)

public static final class ShooterConstants {
    public static final int kShooterMotorPort = 0;
}

If you have placed a jumper on the Romi to put the 5V supply on the center rail of the EXT0 - 4 ports, this will attempt to power any accessories off of the Romi’s power supply, which could cause brownouts if you draw too much power.

If you can include details about how you have configured your EXT outputs and photos of your setup, that would help with a better diagnosis.

1 Like

Update: We got the motor controller running with a romi! The few fixes we made were changing the PWMMotorController class from just a Spark to a PWMSparkMax (which is what we were using) as well as changing the port number in code from a 0 to a 2 since we assumed using EXT 0 for the romi pin meant PWM 0 but in reality was PWM 2 (as shown in your above diagram). In terms of supplying power we were already doing that externally- I’m not sure quite the details on that but it was being done correctly and we checked it with an Oscillometer to make sure we were getting signal from the romi to control the motor.

1 Like