VDC2450 joystick control with motor using absolute potentiometer feedback

6 years 4 months ago #29528763 by jonshepley
Hi All,

I am after a bit of help setting up my system, I have a VDC2450 controller which has an analog joystick (0-5V in each axis), this controlls 2 motors which are geared but have potentiometers on the axis for positioning. I'm trying to work out the best way to control it, I need to know the positon of each axis so I can set some limits but i can't see an option that allows me to use them for feedback. When I try to enable it (in several different modes) it wants to "follow" the position of the joystick so when you return the joystick to the center position the motors do the same.

Does anyone know which configuration I should be using to use the joystick to control the motors as they would in an open loop fashon but maintain its position once there are no joystick inputs?

I know this is a real noob question but i'm on a very fast turn around on my project and need some help getting it working quickly.

Many thanks in advance,

Jon

Please Log in or Create an account to join the conversation.

6 years 4 months ago #29528764 by Griffin Baker
The joystick needs to be set for motor command. Upon selecting the joystick as motor command, you and then set each of the pots as feedback for their respective motors.

Input use: feedback, then select box 1 for motor 1 or box 2 for motor 2.

The feedback will work in the closed mode. So for position you will need to tune your PID. Mostly proportional gain over the Integral gain.

You can use a channel in the lower right hand area of the "Run" tab to query data. For position, you'll want to use the track 1 and track 2 to see the motor movement as it tracks it to the desired position.

If your analog inputs have high fluctuations caused by noise, you may want to install a capacitor between the ground pin and the analog input pin.

Please Log in or Create an account to join the conversation.

6 years 4 months ago #29528765 by jonshepley
Hi Griffin,

Thanks for your quick response, I have the joystick setup as you mentioned, and both motors work fine in open loop, the feedback pot's are also assigned to feedback1 and 2 respectivly. I think it is the PID settings as you say, i'm trying to get my head around PID as we speak the page on wikipedia seems quite good and straight forward. Your right about the analog inputs, especially from the feedback, i'm seeing quite large spikes when the motors are "ON" i will add some capacitors at the controller end.

The trouble i have with the PID tuning is that the motors are controlling a rather large arm so its a bit scary plugging figues in a seeing what happens, do you have a good "safe" starting point that i could try and then fiddle from there? its all at defaults at the moment.

Also one of the axis can rotate more than 360 degrees, the potentiometer is a servo type so im presuming when it gets to its maximum it will drop strait down to the minimum. This will presumably be seen as a massive error by the PID and the motor will be given full power to try and correct. Is there any way to gard agains this?

Sorry for all the questions,

Thanks,

Jon

Please Log in or Create an account to join the conversation.

6 years 4 months ago #29528766 by Griffin Baker
A 1uF capacitor should be fine.

You can adjust your potentiometers range values min and max values so that they work as the outer limits of how far the motor can rotate from end to end 0 to 5000mV. This is also dependent upon where you set your center point value as well (Home position).

You can utilize the loop error detection as a safety guard for the massive error. There are a few selectable ones built in at the bottom of your closed loop parameter option menu.

In terms of values to use, you can go with P = 2, I= 0, D = 0

You will want to add more P gain as needed. If the P gain provides a smooth transition will minimal to no oscillations, but doesn't get directly to the desired position, then you will want to add the Integral gain (I gain).
The differential gain will provide a boost upon command change if needed; though may result in overshooting the target position and then retract. Best not to use too much; for if your motor goes out of control, this may damage your motor.

No problems with asking questions as we want to help our customers achieve their project goals with our products.

If you get oscillations from adding the I gain, you can reduce the integrator limit as that will work as your error reset. The integrator is on from the start of the command change and then gradually help to reduce the overshoot/undershoot.

The maximum value for each of the PID parameters is 20. You can use decimal values as needed. These are not rounded up. So if you put in a gain value of 3.4, the value is neither rounded down to 3 or 3.5.

*Note* for closed loop speed, leave the integrator at 100%.

Please Log in or Create an account to join the conversation.

6 years 4 months ago #29528767 by jonshepley
Thats incredably helpfull thank you, I love the motor controller by the way!

Given my system, which closed loop mode do you think I should be in then? Like i say, at the moment the feedback is forcing the motor to "follow" the joystick and goes back to its home position i.e. in an "absolute mode", were as i need to to act in a "relative mode" so it move proportionally to the joystick but when the joystick returns to "home" (2.5v in each axis) the motors do nothing and stay where they are.

Thanks,

Jon

Please Log in or Create an account to join the conversation.

6 years 4 months ago #29528768 by Griffin Baker
The relative tracking mode allows you to control position and speed acceleration/deceleration values. In the tracking mode, the motor command will tell the motor to go to the desired position as fast as it can and hold. Again, the PID needs to be fine tuned with each mode.

The absolute capture type takes in the absolute value provided 0 to +5V that will be translated into a motor or feedback command. The relative mode capture type takes what is measured at the 5V output. So if the measured 5V isn't exact, the controller will compensate for the difference.

Try changing the loop error detection. Not sure if this maybe what is causing it to not return home.
Quick question. Are you using 2 separate feedback for each motor or is the feedback for the 2 motors the same (using 1 pot to provide feedback for both motors).

Please Log in or Create an account to join the conversation.

6 years 4 months ago #29528769 by Griffin Baker
You may want to check out this video demo we have on our website.

www.youtube.com/embed/xptBWoCq6Rc?wmode=...toplay=1&fs=1&start=

Please Log in or Create an account to join the conversation.

6 years 4 months ago #29528770 by jonshepley
I've had a look at the video, thank you.

my system is effectivly a pan/tilt system, so each axis has its own feeback pot.

The problem is not that is isn't going to the "home" position, its the fact that is is, as shown in the video when the command is say 500, the motor goes to the target of 500. the problem with this is that the joystick center position is 2500, say i take it to full deflection, 5000, the motor will go to 5000 from the feeback but then as you release the joystick back to it's home position it is going back to 2500, I want it to stay at 5000.

I want it to respond to the joystick by speed alone, not position. i.e. at 25% deflection it travels at 25% speed and 100% deflection it runs the motor at full speed, but one the joystick goes back to center it should hold it's position using the potentiometer feedback.

Does that make sense?

Thanks,

Jon

Please Log in or Create an account to join the conversation.

6 years 4 months ago #29528771 by Griffin Baker
I think the only real solution for something like that is through a microbasic script. But even then, that would require some thought.

Please Log in or Create an account to join the conversation.

6 years 4 months ago #29528772 by jonshepley
Ok, would i be better off adding encoders on the axis's for the feedback and then using the pots in a script to do the positional limiting?

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.155 seconds