6.4. Setting up analog control

This section explains how to set up the Jrk G2 to read an analog control input and calculate its “Target” variable from that. Please note that this is different from setting up analog feedback, which is documented in Section 5.2.

If you have not done so already, you should follow the instructions in Section 4.3 to configure and test your motor, and follow the instructions in the appropriate part of Section 5 to set up your desired feedback method.

The Jrk can read the analog voltage on its SDA/AN pin and set its “Input” variable to a value reflecting the voltage, where 0 corresponds to GND (0 V) and 4092 roughly corresponds to 5 V.

If you are using a potentiometer to make the analog control signal, you should connect the potentiometer’s wiper to SDA/AN and connect the other two ends to GND and SCL. In analog input mode, the SCL line is driven high (5 V) to power the potentiometer. Note that the SCL pin is protected by a 220 Ω series resistor, so it will not be damaged by accidental shorts to ground.

Connecting an analog voltage control input to the Jrk G2.

If you are using something other than a potentiometer to generate the analog control signal, make sure that the ground node of that device is connected to a GND pin of the Jrk, and that the signal from that device is connected to the SDA/AN pin. The Jrk can only accept signals between 0 V and 5 V with respect to GND; signals outside of this range could damage the Jrk.

Now connect the Jrk to your computer via USB. In the Jrk G2 Configuration Utility software, go to the “Input” tab and set the “Input mode” to “Analog voltage”. If you are powering an input potentiometer from the SCL pin, you should also check the “Detect disconnect with power pin (SCL)” checkbox. This causes the Jrk to drive SCL low periodically to help detect whether the input potentiometer has been disconnected. You should also go to the “Errors” tab and set the “Input invalid” and “Input disconnect” errors to enabled and latched, regardless of what kind of input you are using. Click “Apply settings”.

In “Scaling” box of the “Input” tab, click “Learn…”. This starts the “Input setup wizard”, which will help you measure the neutral, maximum, and minimum positions of your analog signal. When the wizard is finished, it will set seven of the input scaling parameters (input error maximum, input maximum, input neutral maximum, input neutral minimum, input minimum, input error minimum, and invert input direction) appropriately so that neutral analog signals get mapped to the target neutral value, the maximum analog value gets mapped to the target maximum, and the minimum analog value gets mapped to the target minimum.

The input setup wizard does not set the target maximum, target neutral, and target minimum values, so you will need to set them yourself:

  • If you are using open-loop speed control (“Feedback mode” is “None”), you should probably set those values to 2648, 2048, and 1448, so that you can use the full range of your analog input. This assumes you also you want to drive your motor at full speed in both directions. If that is not the case, you can move the target maximum and/or target minimum values closer to 2048 to reduce the speed and use more of the range of your analog input.
  • If you are using analog feedback, the default values of 4095, 2048, and 0, will generally be pretty good.
  • If you are using frequency feedback (speed control), you will probably want to set those values to 2048 + F, 2048, and 2048 − F, where F corresponds to the maximum frequency (speed) you want to command the Jrk to obtain (see Section 5.3).

Click “Apply settings” to save these settings to the Jrk.

Now turn on motor power and click “Run motor” to start your system. As you move your input from end to the other, you should see your system moving through its full range of speeds or positions.

Finally, check the “Scaling degree” parameter. The default is “1 – Linear”. If you want finer control near the neutral point of your input and coarser control near the ends, you can change it to one of the higher settings.

For details about how the input scaling works, see Section 7.3.

Related Products

Jrk G2 18v19 USB Motor Controller with Feedback
Jrk G2 24v13 USB Motor Controller with Feedback
Jrk G2 18v27 USB Motor Controller with Feedback
Jrk G2 24v21 USB Motor Controller with Feedback
Jrk G2 21v3 USB Motor Controller with Feedback
Jrk G2 21v3 USB Motor Controller with Feedback (Connectors Soldered)
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors