How does TalonSRX's configsoftlimit() work in reality?

The question is derived from a turret. If l use mTalon.configForwardSoftLimitThreshold(value) and mTalon.configReverseSoftLimitThreshold(value) and enable both of them. Then, does it mean the value l send to the talon will be automatically be clamped in this range. Or it means if l send a value out of the range, and the talonsrx won’t set itself to the value? Besides, when in reality, if l rotate the mechanism manually, will the softlimit prevent my rotating the motor? If not, does a hardlimit exist? Or l should give the motor a fancy feedback control (like PID) to make it impossible for any external force to make it rotate? Can any experienced share how this works? Thanks!

Motor controller behavior for soft limits and hard limits are the same: when the direction limit is triggered, voltage in that direction will be set to 0V. eg when the forward limit is triggered, voltage is capped to 0V (negative voltages are fine); when the reverse limit is triggered, voltage is at least 0V (positive voltages are fine).

It is not a brake. Use closed-loop control if you want the motor to resist external forces.


Thanks! Will the motor still rotate little due to the inertance? If l set the motor to brake mode, will this also happen?

All the Limits do is stop output to the motor in that direction when engaged. Beyond that the motor will act as it normally would when set to a neutral output.

Limits in this context are generally not meant to “hold” position, but to stop the active driving of the system in that direction. Take for instance a turret with a 100 degree safe rotation, you’d put the limits near the 0 and 100 degree point (hopefully a bit before) which will stop you “driving” the turrent further than those points, but you should make use of mechanical systems to make sure the turrent won’t tear itself apart if the mechanism then “passively” tries to exceed the limits. This is where you use things (often accompanied by Brake Mode) like physical end-stops, High Gearing, Counterweights/springs, disk brakes, etc. to do the actual stopping of the mechanism. So for instance if you have physical end-stops on your turrent, they should be such that it shouldn’t be a big deal if the turrent were to coast into them after hitting the limit and the motor output becoming neutral. If it does, then you need to add additional, preferably mechanical, countermeasures.

Of course you can also supplement with software measures like closed-loop control via PIDF to hold position, but these systems too also heavily benefit from proper mechanical assistance in maintaining a position once reached.


This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.