Telescopic arm control

Hi guys how r you??

So I hope I can explain myself,

my team is designing a telescopic arm for the offseason, and we kind of based our arm off the west coast products telescopic, which works around constant force spring. So the springs are put in a way that it makes the arm be normally out, meaning that if there’s no motor output or any limit, the arm will extend itself.
Unfortunately the springs we bought are stronger than we expected, either way, I have a issue when it comes to the code, cause if there’s no motor output, the arm will go out very at a very high speed, so if additionally I give the motors any power towards taking out the arm, it’ll be faster and more dangerous.

So for example, if I want to pull inside the telescope I will use a ProfiledPIDController, which shouldn’t be much of a problem, but when taking out the arm I should give power to the motor against taking out the arm so it goes out slower, but what do I do to make this movement smoother and more fluent, I don’t know if using a PID or feedforward or what.

So hope you can understand my problem and help me, thank you in advance to all of you.

Set up your ProfiledPIDController to output voltage. Then, add a constant voltage that you always set to the motor that opposes the force of the springs.

2 Likes

This, as expected will use power at rest and could cause brown outs depending on how many motors/draw you have. I would highly recommend getting the appropriate spring to remedy it!

4 Likes

Also, set your controller for "brake mode: :wink:

So we are trying to get the adequate springs but we don’t know if they’ll get here on time, so what we are doing is put a piston that works as a hard limit on the gear box, but either wey we need a way to get the telescopic to a precise desired position and then activate the hard limit so can we use also a PID? Or what do you recommend?

Sorry, I didn’t quite understand your point, can you tell me how would you put it into code?

Definitely a feedforward argument, we have done this before with 3481, it’s easy to do on SparkMAX’s. However this comes with the side effect of less energy for other motors on your system (LIKE YOUR DRIVE TRAIN!) and more risk of Browning out.

1 Like

You can just add the feedforward voltage to the PID feedback voltage sort of like this:

motor.setVoltage(pid.calculate(encoder.getDistance(), setpoint) + feedforward);

In the simplest case, feedforward would just be a constant to overcome the pull of the constant-force springs. More complicated models could be developed to compute a feedforward voltage based on desired telescope velocity and acceleration, but I’d recommend first trying a constant that is added to the PID voltage to hold the telescope steady.

The sign of the feedforward voltage will need to be the same sign as the voltage needed to turn the motor in the direction that retracts the telescope.

You should be able to experimentally determine a reasonable static feedforward voltage by extending the telescope and then manually and slowly increasing the magnitude of the voltage to the motor with sign in the retraction direction until the telescope starts to retract. You should try to hold the telescope position at various amounts of extension by manually manipulating the voltage to see if the feedforward voltage varies much by position. Ideally, “constant force” springs should apply force such that the voltage that balances the force is not particularly dependent on the amount the spring is unwound. However, you might find that you need a little more voltage to hold the telescope in position when it is nearly fully extended compared to when it is almost completely retracted. I’d go with the highest voltage you find is needed to hold position anywhere within the range of extension.

You could also find a static feedforward voltage if you are able to get decent-enough tuning of a PID controller such that it holds telescope position, even if that position has some offset from setpoint. The PID output voltage when the telescope is holding position is the value that you’d like to put in as a feedforward that the PID controller could then work around. Note that for many people, there is probably less chance of damaging the telescope using the manual method rather than trying to quickly iterate PID gains that get close to controlling the telescope.

1 Like

How many springs are you using, if you have 2 on there maybe try removing one.

This is a safety issue. :
(1) size your springs to your task – if they’re too strong, get weaker ones.
(2) most teams use a winch to pull/release the arm – if you do this, use a gearbox that has a fair bit of reduction, just to make the entire thing harder to back-drive. Or put a brake on it that . You’re mainly trying to stop a quick release – if it slowly releases, that’s not that big of a deal.
(3) These things normally work by having a string tied to the inside part of the extending arm and then reeling it on or unreeling it. You want to have TWO STRINGS to keep your device from flying across the room if one breaks.

1 Like

Thank you very very much, now I’ll go on to try it.
thanks again

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