Potentiometer limits

Page 34-36 of the manual give more detailed instructions on how to get your motor working:

Can you give these a try and say at what step you are having problems? Also, can you upload some clear pictures of your setup so we can see all your connections?

The knob pot has three wires: a wiper and the two extremities of the internal resistor. For the RB-Ite-06, these are labelled S, and +/- respectively. One of the extremities (+) needs to be connected to a 5V pin and the other (-) to GND. The wiper then needs to be connected to the “FB” feedback input pin.

Similarly, the actuator’s internal pot has the same three wires.
Actuator_Potentiometer_Wire_Schematic.jpg
Based on this image for the RB-Sct-206, these are blue and white/yellow. The white needs to be connected to GND, the yellow to 5V, and the blue to the “RX” control input.

Finally, the DC motor (black and red wires) of the actuator needs to be connected to the A/B motor outputs. To determine the direction, you need to make the connections and do a test. If the motor moves in the wrong direction, you can swap the black and red wires, or you can also just use the “Invert motor direction” feature on the Motor tab in the configuration utility.

After attaching the actuator to your structure, you should be able to simply put 12V on the black and red wires to get the actuator to move full speed and measure the current.

Yes, the JRK can do all this. See pages 13-19 of the manual for more information:

The 12A version of the JRK does not have an assembled version. Unfortunately it is only offered for the 3A version.

You can pre-program the JRK to have a limit on the duty cycle (a.k.a. speed), acceleration, current, and many other attributes. See page 18 for more information. If you want to be able to change the configurations on the fly, you will in fact need an additional microcontroller. We would recommend one of the Arduino boards:

The board does have reverse polarity protection and current sensing and limiting features (see limits above).

The configuration utility is only needed to configure the parameters of the JRK and isn’t needed when the JRK is being used. The utility works well on Windows 8, and should work fine on Windows 8.1.

In this case, the manual is talking about the PWM signal’s duty cycle, which is basically the speed used to control the motor. It is not the same thing as the operation duty cycle, which is the average time the motor can in operation. You need to adjust parameters such as deadband to ensure that the motor will have time to shut off and cool down, instead of working continuously.

Exactly, these boards don’t support feedback from the actuator, so they will put you in the same situation you are currently in with your T’Rex board.

Yes, if the pot goes beyond the range it will generate the Input disconnect error which you can use to stop the motor. See page 19 of the manual for more information.

In this setup, you wouldn’t have any control of the actuator: it’ll be permanently powered which will make it move to one of the ends until a limit switch turns everything off. It’s the JRK that controls the power that’s applied to the motor, and the potentiometer is just a feedback signal to let you know the position of the actuator.

Thanks for bringing the old link to our attention: we will be updating shortly.

In the utility, when it is asking for a value between 0-4095, it is usually referring to its analog-to-digital values. The JRK has a 12-bit analog to digital converter (ADC), so a value of 0 means 0 volts, and a value of 4095 is 5 volts.

At first, you should adjust the Input and Feedback tabs and then do some testing to see if the actuator is working like you want.

For more information about the meaning of all the different attributes, the manual does a good job at explaining this in pages 13-20:

The JRK is often used with a microcontroller, but based on your needs that we’ve discussed so far, you should be able to accomplish everything using the board by itself in the analog input mode with calibration. The JRK is rated for 12A continuous and up to 30A peak, which is pretty comparable to the T’Rex.

Have you tried testing your actuator in your planned setup to see up to how much current is required? I’d recommend trying that to see exactly how much current the motor controller needs to handle.

I think the JRK would be the best solution solution since it keeps everything much simpler, including not needing to do any coding. Occam’s razor: the simplest solution is the best!

We received a response from our supplier:

If you’re not willing to modify your board like this, you can instead use an external analog-to-digital converter such as the following one that can attach to the T’Rex through the I2C interface:

Another possibility would be to ditch the T’Rex and instead use the JRK module:

It is a pretty advanced module, has an analog input and will do all the remapping and PID stuff for you. You would have to use it’s utility for calibrating the ranges, but you wouldn’t need to program anything.

Once you have everything connected, you should be able to do this:

  1. Adjust the input upper and lower limits by putting your knob potentiometer in both end positions and seeing their values.
  2. Do the same for the feedback upper and lower limits by moving your motor to both end positions. You can either move the motor with the JRK, or manually with a DC power source.

Once this is done, test your system to see if it works like you like.

Do you have your input mode selected as Analog? That should be the right place to configure the input wiper.

The actuator goes under both tabs: the internal potentiometer is considered the Feedback, and the DC motor is consider the Motor.

It’s hard to answer this question without knowing to what the pot will be connected. Will you be connecting it to a microcontroller like an Arduino? To a motor controller with analogue input, like a Sabertooth? Or to some other circuit?

If it’s a microcontroller, it would be easy to implement this behaviour in software. Otherwise, it might be a bit more difficult. We’d need more information to be sure.

In this case, you will be able to implement the behaviour in the Arduino code, something like this:

int startAngleADC = 200; // the ADC value of the potentiometer at the 'start' angle, needs calibration
int endAngleADC = 541; // the ADC value of the potentiometer at the 'end' angle, 100 degrees later, needs calibration

int potentiometerADC = analogRead(potentiometerPin); // range of 0-1023 for 300 degrees
int potentiometerAngle = constrain(map(potentiometerADC, startAngleADC, endAngleADC, 0, 100), 0, 100);

Yes, and that’s exactly what I’m doing: the ADC values is the Arduino’s way of representing voltage. An ADC value of 0 means the voltage is 0, and an ADC value of 1023 means the voltage is AREF (which in our case is 5V).

The startAngleADC and endAngleADC values are the voltages of the wiper of the pot when the pot is at each of the start and end angles that you are using.

Yes, you can combine it. The first two lines of my code are defining constants and can be put at the begging of the program, after line 2 in the example. The third line of my code is the same thing as the 10th line from the example, just with different names. The fourth line is the part that is rescaling the values so that it works with only 100 degrees instead of 300 degrees.

In the example, I assumed that you wanted your output value to be the angle of the pot in degrees, but since you will need to do scaling on the output there may be a more efficient way, such as something like this:

int actuatorTargetADC = constrain(map(potentiometerADC, startAngleADC, endAngleADC, actuatorStartPositionADC, actuatorEndPositionADC), actuatorStartPositionADC, actuatorEndPositionADC);

This calculation will give you the target ADC/voltage of the actuator’s internal pot for when it is at its start and end positions. You will need to add and calibrate to more constants at the beginning to represent these positions:

int actuatorStartPositionADC = 400; // voltage of actuator's pot when it is at the start position
int actuatorEndPositionADC = 800; // voltage of actuator's pot when it is at the end position

Once you have the target ADC value, you can compare it to the actual ADC value of the actuator’s pot and then decide if you need to extend, retract, or do nothing with the position.

Let me know if you want some help with this.

So far, the ‘positionError’ value is calculated almost instantaneously (twice per second, and this can be increased later). What will really determine the reaction time is the rest of the logic that chooses the action to do.

Like you said, adjusting a closed feedback loop can be quite tricky. For the most accurate and quickest response, you would need to make and calibrate a PID controller. Calibrating a PID controller properly can require a lot of expertise because the parameters can change a lot not only depending on what parts you use but also on if the load on the actuator changes a lot.

Fortunately, there are ways of implementing simpler feedback loops as long as you’re willing to accept sub-optimal results.

Anyways, before diving to far into feedback loops, we first have to ensure that your error calculation is working properly, and that you can control the speed of the actuator with the T’Rex.

I haven’t used the T’Rex myself, so you will need to figure this out. The approach I would recommend is start with the Knob example (found in File > Examples > Servo > Knob), change the servo output pin to be pin 3 (left motor PWM speed control) and also set pin 2 to be high and low to watch the motor change directions. Careful to not change the direction of motor while the speed is set high.

Once you got this working properly, post your code here so we can look into integrating it with the sample code above, and then we can discuss how to implement the feedback loop.

Hope this helps.

Hmm, I hadn’t examined the T’Rex very closely and assumed that it had a similar pinout as the Wild Thumper Controller that it replaced, but it seems that’s not quite the case.

On the new T’Rex, there’s a new 3-axis accelerometer that uses pins A0-2, and A3 is used to measure the battery voltage. You can use the A4 and A5 pins, as long as you are not also using the I2C interface. A4 is the pin labelled SDA and A5 is the SCL pin. You should be able to use these instead of A0 and A1 in the code.

It’s not clear how that +V1 pin works… The documentation says “The T’REX controller has an I2C interface with automatic voltage translation for logic voltages from 1.8V to 5V.” This probably means that the +V1 pin is a voltage input, the reference voltage level of the attached device.

Instead, I would recommend using another +5V pin, such as the middle pins of the encoder headers.

However, this auto-voltage might also mean that it is not be possible to use the SDA and SCL pins for analog inputs as we expected… I have contacted the manufacturer to verify and will let you know when I get a response.

ok the board is here and assembled. I downloaded the config. utility. can you walk me through the configuration?

I downloaded the config. utility, but I forgot to install it. anyway, when I try to install the “umc.inf” file (page 10 in users manual) I get an install error that says “The third-party INF does not contain digital signature information”. can you help with this? don’t forget that these instructions are for Windows XP and Vista. i’m using 8.1. I still don’t think it’s an issue, but not sure, things are different but not to bad. I downloaded the software from the robotshop’s site. it actually sounds to me that Pololu needs to do some updating to their files.

UPDATE: I went to the website they listed in the manual and it worked. the link on the robotshop website for downloading the software must need revised.

in any case, when I am under the “Input” tab I made sure the “input mode” is set to “Analog Voltage” but to the right of the screen it’s looking for me to put in the Absolute max (input), maximum (input & target), Neutral Max (input), Neutral Min (input) with (target) between the two, Minimum (input, target), Absolute Min (input) all of which are looking for a number between 0 and 4095. under the feedback tab with the “Feedback mode” set to “Analog voltage” there’s a column labeled “calibration” where you put in absolute max, maximum, minimum, absolute min… again looking for 0-4095. under the “motor” tab with the “PWM frequency” set at 20kHz there is two columns labeled “Forward” and “Reverse” under which there is “Max Duty Cycle”, “Max Acceleration” where you put in 0-600, “Brake Duration (ms)” needing 0-1275, “Max Current (A)” 0-?, “Current Calibration” 0-255 but when changed it causes the “Max Current” change but you can change it back, “Max Duty Cycle While Feedback is out of range” 0-600. also the “Reverse” column at this point cannot be modified. it stays the same as the “Forward” column.

basically none of these are looking for me to put in a voltage.

great thanks

ok thanks.