Potentiometer limits

is it possible to only use part of a potentiometer range? in other words… i’m looking at your electronic brick rotary pot #RB-Ite-06 which has a 300 deg. range and i’m wandering if its possible to use only say 100 deg. for actually sending position info… i’m working on a project where the pot would be connected to a lever. when the lever travels outside the 100 deg. range the pot would simply hold a “0” position. can this be done?

the pot will be connected to the TRex robot/motor controller (RB-Spa-891) which has the arduino nano w/atmega 328 and I believe has the microcontroller built into it with analog inputs.

that’s great thanks. few more questions . . .

this will be controlling the servo city linear actuator with a built in pot for position feedback (RB-Sct-206). in your code your using the degree to state the begin and points of the desired range. isn’t better to use the voltage of the pot wiper? so the range is specified by the wiper voltage at the start of the range and the wiper voltage at the end of the desired range.

also, i’m new at this…i’m not sure where in the code this would go. I’ve looked at your five minute tutorial for how to code for a potentiometer. would this code be used in conjunction with that code? if so how would I combine the two together properly?

to be quite honest i’m seriously fumbling my way through the entire programing of this entire set up. on top of only needing a certain range from the pot, I only need the actuator to travel back and forth within approximately a 4" range.

i’m setting up 4 different systems to do different things, but I need to tackle this one first. what I learn from this one will guide me through the others.

ok, need more help. I need the manual pot to work in the specified range. when the man pot is at the defined start point the actuator should be at its defined start point. as I move pot thru the defined range the actuator should move thru its defined range also. when I get the pot to the end point of its defined range the actuator should be at the end point of its defined range.

keep in remind that if I stop the pot or reverse the direction of pot anywhere within its defined range the actuator will react accordingly with almost instant response tine.

from what I gather programming actual actuator speed can be a hassle. doesn’t matter I’m fine with full speed all the time. its only going to move as fast as i move the pot, but fast response time is essential. that’s my overall goal. please help me get there? right now i’m COMPLETELY LOST!!!

incredible! thank you so much! I will post the code here as soon as I get it set up. it will be a little bit though. I recently moved and my multimeter amongst other things got damaged. in any case, i’m ordering a new one as soon as i’m done with this reply.

ok, in the code you gave me as well as the users manual there are pins referenced as A0, A1, A2, A3. on the board there are no pins labeled starting with A… if you refer to page 1 of the users manual it pictures the board with everything labeled. there are pins that start with a D… how should it be connected?

ok, do the A4 and A5 pins share the same pos. and neg.? there are four pins in the I2C area of the board labeled GND, SCL, SDA, and +V1. I’m assuming that the +V1 is the voltage needed. I thought it was the same as the wild thumper board to when I bought it.

well crap! ok, thanks for contacting the manufacturer! I look forward to their response.

ok, i’m back! been working with the manufacturer of the JRK. Not much help at all! I’ve got the actuator moving with the manual pot ranges and speed seriously need adjusted, First a more important problem. the actuator keeps “clicking” while it moves. Manufacturer believes that the actuator the clicking is the actuator overshooting it’s target. When the actuator starts clicking the JRK gets hot quickly! Manufacturer said I would have to get the coefficients under the PID tab on the configuration utility set correctly to fix this. I’ve read all the info on the PID tab I still have know idea what each coefficient does and what it will cause when I change them. HELP!!!

Calibrating a PID controller can be pretty tricky (there are many large books about it), but for a primer I would recommend the Wikipedia article:

Can you measure how much current is being consumed by the motor controller at the time you hear the clicking sound?

To try to eliminate the sound, I would try increasing the Feedback dead zone parameter on the PID Options tab, discussed on page 19 of the manual:

Increasing this setting might reduce the precision of the position, but you can try this to see if it eliminates the clicking sound. You can also try changing the Derivative coefficient to be the same as the Proportional coefficient, and then start tuning from there.

I GOT IT WORKING!!! The JRK is staying cool and the actuator is being completely controlled by the manual pot. .Now I want the actuator to be controlled between it’s fully extended and fully retracted positions while only turning the manual pot between 0 and 45 degrees. How can I get that accomplished?

That’s great to hear. Which setting did you adjust to make that happen?

To adjust the angle range of the potentiometer, you would need to adjust the Min and Max of the Input Scaling:

There’s also a Learn button that can help do this automatically. It is described in more detail on page 16:

ok… how do I get the actuator to run at top speed? also, how do I get the quickest response time?

If you’ve left the Max Duty Cycle at 600, the actuator should be more-or-less moving at its top speed.

The RB-Sct-206 linear actuator should have a top speed between 1.85 and 2.63 inches per second, depending on the size of the load.

Getting the quickest response time should be a matter of properly tuning the PID Options and Motor Options. This can require a lot of trial and error, and also depends on what you did to fix the clicking problem.

what I did to stop the clicking was increased the proportional and derivative coefficients. I also increased the “PID Period” which controls the rate that the JRK runs thru it’s calculations. According to the manual…the higher the PID Period the slower the JRK runs thru it’s calculations. I’m assuming that could obviously cause the actuator to run slower which prevents it from overshooting the target (clicking). So I guess I should try putting it back to where it was clicking and put a load onto it and see if I get the clicking. Am I thinking correctly? If I am correct…that would cause another issue…when in it’s planned structure the actuator will experience a load when it extends but not when it retracts. I don’t believe there is a way to establish a different “PID Period” when retracting opposed to extending. So, should I come up with a way to put some load to it while it’s retracting i.e. a spring?

Increasing the PID period would slow the response of the actuator, but not necessarily its speed. Since the actuator is pretty big and slow (compared to other motors), the increase response time might not actually make it responsiveness slower in any noticeable way.

PID controllers are tricky and it’s ultimately a matter of trying different settings to see which combination gives the best result for your particular application.

getting very frustrated…it doesn’t seem to matter what I set the coefficients at it doesn’t improve. I’ve actually discovered that I don’t even have true position control. to get it to stop at a given point I have to give the manual pot like a quick “snap” in the other direction to stop the actuator which cause the jrk to heat up. I had it working and saved the settings. really the only thing I did was disconnect the fb including it’s 5v and ground and reconnect them and now I’ve lost the position control. I’ve also tried different PID limits. if anything it gets worse with any changes. I still don’t have an understanding of PID so everything I’ve tried is guessing.

If you lost your position control because you disconnected and reconnected your feedback wires, the problem might be because they are connected wrong.

We would recommend to get it working again like you had it on May 28 and save the settings. Then, if you want to make other adjustments, carefully try one at a time and do an undo if the change didn’t help.

If you can post some clear pictures of your connections, we can take a look to see if we see anything.

This is an odd behaviour… We have contacted the manufacturer and asked them to see if they can tell why it’s doing that and we will get back to you.

The manufacturer recommends that you contact them directly: pololu.com/support