Smart Motor Controllers

The difference between Rotor, Mechanism, and Measurement

  • Rotor is the motor output shaft.

  • Mechanism is the gearbox AND sprocket output shaft.

  • Measurement is the distance that the Mechanism travelled via its Mechanism Circumference.

Cascading elevator Mechanism gearings should be divided by the stages in the Elevator!

An easy way to do this with YAMS is by using GearBox.fromReductionStagesand Sprocket.fromStages!

Power optimization is crucial to prevent brownouts

Power optimization can be done with supply, and stator current limits, ramp rates, and adequately geared gearboxes and motors.

Tuning our closed loop controllers

All SmartMotorControllers in YAMS support motion profiled PID's and feedforwards so you should have no limitation on your ability to tune your mechanism! Keep in mind that you can set separate PID and Feedforward values for simulation only since simulation will never exactly match real life.

You can learn how to tune PID and feedforwards from WPILib here!

External encoders

At the moment YAMS will only accept external encoders of the same vendor as this is the only vendor-supported way of using them. It is possible for external encoders to not have the same gearing as the rotor to the mechanism or not be a 1:1 to the mechanism so we do provide an external encoder gearing configuration option!

Follower motors

Follower motors are not always the same inversion as your main motor so we help by using Pairs which have the motor and the inversion relative to the master.

You don't have to rely on YAMS to configure your SMC

YAMS is not the only way to configure your SmartMotorController! You can always fetch the config object, if available, from SmartMotorController like shown below

Some Mechanism config options modify SMC configs

Mechanism options like .withSoftLimit often will call the SmartMotorControllerConfig.withSoftLimit and do nothing else. This is to provide a seamless configuration for relevant areas in different configs.

Simulation without a mechanism

SmartMotorControllers require SmartMotorController.simIterate to be called in simulationPeriodic of your subsystem to provide simulation IF your motor controller is not used by a mechanism. It also proper to include the SmartMotorController.updateTelemetry as well.

Last updated