VDC2450 joystick control with motor using absolute potentiometer feedback

9 years 1 month ago #29529098 by jonshepley
I'm just thinking in general, the way I want to use it is effectively trick the system into thinking that the joystick is in that position. The system is an absolute control system, so the motor follows the position of the joystick (which self-centres) so when you return to the centre position, so does the motor. (I.e. the joystick gives 2500mv in the centre position, the motor moves until the feedback matches this so the feedback comes back as 2500mv and the motor stops).

I'm not even sure it’s going to be possible with the system but I really need to find a way of working round it, the motors are positioning a very large load, if this is done in open loop the load can move from where you position it dues to wind and other factors, when in closed loop position mode the position is maintained by the system and the motors fight any external forces. Given that can you think of any way to making it work? The only thing i can think of is to move under open loop when any input from the joystick is detected then when it returns to centre position it switches to closed loop position mode but that would require reading the current feedback position and tricking it into thinking that is the current joystick position. Does that make any sense to you? Would it help if I sent you my XML setup file? And a diagram of my system?

Thanks,

Jon

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

9 years 1 month ago #29529099 by Griffin Baker
Then I suppose you utilize a digital input. One that says if this switch goes high, then set the analog command value to be set to 3.5V and then set the converted analog output motor command to the motor. If the switch goes low, then go back to the loop of the script where the joystick takes control again.

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

9 years 1 month ago #29529100 by jonshepley
What is the command you would use to tell the motor to achieve a feedback of 3500mv? I presume you mean you would have a button on the digial input which would be either open loop or closed loop forced to 3500mv feedback? this wouldn't work for me in this application. The setup if effectivly a pan/tilt camera system so you want to be able to pan and tilt on the joystick to get a shot and when you let go the pan/tilt is fixed in position by the closed loop feedback. Is there a command which looks for the joystick in the deadband? (in my case 5% +/- from 2500mv)

Thanks,

Jon

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

9 years 1 month ago #29529101 by Griffin Baker
You might have to write a separate script to figure this out. You can query an analog input after conversion using ?AIC, or in scripting it is getvalue(_aic, # ) where # refers to analog channel. Another option is to use the run tab and query the motor command. The joystick analog input will take a voltage and it will converted into a motor command. You can find out what that motor command from there.

So whatever the motor command equals, that is what you send.

So if feedback voltage is 3.5V and the Roborun determines that as motor command +750, then you would send setcommand(_g, 1, 750).

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

9 years 1 month ago #29529102 by jonshepley
Hmm interesting, so you would remove the joystick from being directly in control of the motor and do it through the script? That makes sense.

But is there a command like: setcomman(gotoposition, 3500) which in closed loop would make set the motor to rotate to match 3500mv on the feedback?

One other thing as well, in closed loop positioning mode using a potentiometer as feedback do the speed and acceleration configurations have any effect or are they only used by the closed loop speed mode? i ask because i can't see how it's working out RPM without an encoder? but it does seem to effect the speed, not nessesarily predictable

Lastly would i make my life a lot easier if i added an encoder as well and the potentiometer? I realise the encoder could do both jobs but I cannot have it do a initialisation to find its limits every time it is turned on hence the need for an absolute feedback method, but i presume things like speed and acceleration only work if you have an encoder in the system? Then I could just use my potentiometers as analogy inputs for the script so it knows its position.

Thanks,

Jon

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

9 years 1 month ago #29529133 by jonshepley

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

9 years 1 month ago #29529134 by Griffin Baker
The analog feedback is looking at a voltage to reference the min and max of the position set by your configuration. The encoder is looking at counts. 1 pulse = 4 counts. The higher the resolution of the encoder, the more accuracy it will have. Your choice how you want to do this.

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

9 years 1 month ago #29529135 by jonshepley
But is there a command like: setcommand(gotoposition, 3500) which in closed loop would make set the motor to rotate to match 3500mv on the feedback?

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

9 years 1 month ago #29529136 by Griffin Baker
It was in a previous post.

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

9 years 1 month ago #29529137 by Griffin Baker

Griffin Baker wrote: You might have to write a separate script to figure this out. You can query an analog input after conversion using ?AIC, or in scripting it is getvalue(_aic, # ) where # refers to analog channel. Another option is to use the run tab and query the motor command. The joystick analog input will take a voltage and it will converted into a motor command. You can find out what that motor command from there.

So whatever the motor command equals, that is what you send.

So if feedback voltage is 3.5V and the Roborun determines that as motor command +750, then you would send setcommand(_g, 1, 750).

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

Moderators: tonysantoni
Time to create page: 0.115 seconds