What does it mean to set the can coders to CCW+?
inverting (or not) the encoder such that the encoder count/position increases in the Counter ClockWise direction.
By numbers do you mean the CAN IDs?
I haven’t actually used CANcoders directly, so my answer is not specific to the CANcoder, as configuring an encoder in software such that it is read CCW+ (Counter Clockwise Positive) is something you can do for any encoder. Has nothing to do with CAN specifically, though I imagine you can set a CANcoder to inverted over the CAN Bus. You are trying to make sure that the encoder’s returned value increases as the shaft the encoder is reading is rotated counter clockwise.
When they are talking about making sure CCW+ it means making sure when the magnet rotates counter clockwise, that the degrees rotated increases.
See the documentation here: Bring Up: CANCoder — Phoenix documentation
Make sure you have already set the CAN ID in Phoenix Tuner, and it matches what you are calling in code.
Well said and to complete a very basic introduction for the OP notice that rotational direction appears reversed if looking from the back instead of the front of a shaft. You do have to know what is front and back.
If there are multiple axles (gears/belts/chain) you have to follow the train of movement. Picture is typical of a motor with the encoder on the shaft.
This trips up a lot of people which is why everyone first starts a robot up on blocks and verifies that everything is moving in the expected direction including the shafts and the values read from the encoders.
You have to add to this the complication of which way does the motor turn with a “+” voltage and of course the reverse with a “-” voltage.
Ok thanks, the diagram was really helpful. So CCW + just means when u apply positive voltage, the motor turns counter clockwise right?
Your original question dealt with encoders and in that context the correct answer is from @ExploitSage. CCW+ might be a default value for an encoder or it might be a changeable parameter under your control. Add to this changeable parameters like -180 to +180 or 0 to 360, etc.
In the context of a motor controller say the SparkMax with a Neo or a TalonFX with a Falcon 500, your statement is true. Generally the motors take a “+” voltage to go forward or CCW, if you face the shaft end of the motor toward you, or green lights with their internal encoders increasingly positive in that direction. Usually you can change that behavior of the motor with the “inverted” parameters and the encoders similarly with parameters such as phase.
Sorry this is complicated and I don’t know of a summary chart with all these possibilities but you can tease out all this and make a chart if you wish. I’m an experimentalist and tend to plug stuff in and see how they move. That’s what I just did to verify I was correct about motor directions.
Then there’s the axes’ directions of the joysticks and add field-orientation with the gyro which also has similar potentially confusing various nomenclatures as to which way is left/right forward/backward up/down or backwards.
I don’t mean to pile on but these all have to work together so things move right.