Programming

Changing CAN ids… i see it. What should i put?

How are you connected to the robot?
If not over USB, change over to USB, use the USB IP address instead of your team number, and then get back to the CAN Devices tab once it reconnects.

Follow the CTR documentation: https://phoenix-documentation.readthedocs.io/en/latest/ch08_BringUpCAN.html#open-phoenix-tuner

and specifically for ID’s: https://phoenix-documentation.readthedocs.io/en/latest/ch08_BringUpCAN.html#set-device-ids

You’re also running an older version of Tuner. Latest is 1.6.0.0, you can install it here, but it’s not stopping you from doing what you’re doing: https://github.com/CrossTheRoadElec/Phoenix-Releases/releases

Printer cable thru the rio

Will update Tuner when i get home (my school doesnt allow windows laptops to have access to wifi)

IF the device connect/reconnect issue continues, you can move the IP address on the first tab to the USB connection, instead of using your team number - but it sounds like it is working so don’t change it if it’s working.

The CAN ID is a user-set parameter that identifies your hardware in code. Any integer between 1 and 62* works - think of it as a nametag for that speed controller. (Lower number is higher priority.)

Once the CAN ID is set on that individual controller, it will know that when the roboRIO addresses a command to that CAN ID, that controller should take action. Your Java code will have constructors that create SpeedController objects in code that require those CAN IDs, so that when the code addresses that SpeedController object, it maps to the correct CAN ID in the hardware.

https://docs.wpilib.org/en/latest/docs/software/can-devices/using-can-devices.html

*thanks @TytanRock!

1 Like

This isn’t correct, it’s between 0 and 62 (inclusive). Look at the first tip here: https://phoenix-documentation.readthedocs.io/en/latest/ch08_BringUpCAN.html#set-device-ids

2 Likes

How do i change their name?

note: all the PDP, SPX and PCM are blinking orange with flashes of red

Same method one line down

So not every SPX gets a unique ID, but the ID is unique between totally different electronics.

EDIT: I SEE now. Pretty cool

From the factory, every SPX has the same long-form CAN ID (device prefix + userCANID) because the userCANID is set at 0 at the factory.
You need to make every SPX have a different userCANID, so that they all have different long-form CAN IDs.

It’s possible to leave the rest of the device IDs alone, because they have different device prefixes.

If you design a robot that needs two PCMs, the second PCM will need a new CAN ID.

Aaron,

Follow the instruction in the link in TytanRock’s message. I would just assign them 31 to 38 to start. Once you have them all showing up on different lines, use the blink button to find out what each one is connected to.

My team uses a left part of the robot is odd, right part of the robot is even. So the two motors on the left gear box are 1 and 3. The two on the right are 2 and 4. The numbering is up to you, however, write it down in an engineering notebook so while you are programming you know which ID is which.

-Jim

1 Like

Good news-

These are all blinking orange, no red flashes.

EDIT 2: BAD NEWS I guess renaming the SPX before blinking them was not a good idea.

1 Like

That just means the robot is disabled. Everything’s good I think.

Current Status

Currently leaving the build site, will be updating entire Tuner program.

1 Like

While i’m updating the tuner, Is there anything i should do while i have stable wifi?

I now see what you meant for as the temporary diagnostics lol

Question. Since i have set IDs and Names, they shouldn’t be lost as the roboRio is the one that holds that data? And unless the rio gets memory resetted, when i connect to the robot, it should show everything that I did today?

Yes, the IDs are in the motor controllers. You can replace the Rio with another one and the motor controllers will retain their IDs.

1 Like

Tagging on JimWright’s post, the controllers themselves hold that information, NOT the RIO.
So if you end up replacing an SPX - you’ll have to tell the new SPX its CANID.

Yes, it will.

1 Like

Just got word that we will be having a very short meeting tomorrow.

Good thing i can show up.
Bad thing I’m not sure i know what to do next.

Was just going through WPILib and came across

It is not recommended to install the Visual Studio IntelliCode plugin with the FRC installation of VS Code as it is known to break IntelliSense in odd ways.

I have this:


Should i disable/uninstall this?