Distance mode - AX3500

15 years 3 months ago #4772264 by TeamRowBo
Distance mode - AX3500 was created by TeamRowBo
<P style="MARGIN: 0px">We are trying to enter the distance-mode for our AX3500 controller, but the controller does not respond correctly. After one attempt, the next time when we connect to the controller, it drives crazy..
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">The code we use (VB):
<P style="MARGIN: 0px"> <BR>MotorPort.Output = "^01 03" &amp; Chr(13) 'Enter distancemode
<P style="MARGIN: 0px">MotorPort.Output = "!Q2" &amp; Chr(13) 'Reset counters<BR>MotorPort.Output = "*97 50" &amp; Chr(13) '<BR>MotorPort.Output = "*96 26" &amp; Chr(13) '
<P style="MARGIN: 0px">MotorPort.Output = "!Q6" &amp; Chr(13) ' Set both encoders with value from register
<P style="MARGIN: 0px">MotorPort.Output = "^01 04" &amp; Chr(13) 'Back to normal mode
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">The communication with the controller works fine in normal mode, but this codes drives our robot crazy..
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">The goal of our code, is to drive a certain distance (approx 1 meter), which will be equal to about 18,000 pulses.

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

15 years 3 months ago #4772414 by cosma
Replied by cosma on topic Re:Distance mode - AX3500

When changing the operating mode to Position, the controller must be reset for this to take effect. You can send the reset command from your vb code using the string %rrrrrr
<P style="MARGIN: 0px">Note that when in position mode, you no longer can control the speed. The motor will try to move to the desired position as fast as possible.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">Unless you need to stop at 18000 counts with extreme precision, you can poll the distance from destination using the ?d query, and stop using a vb command.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">

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

15 years 3 months ago #4773621 by TeamRowBo
Replied by TeamRowBo on topic Re:Distance mode - AX3500
<P style="MARGIN: 0px">Directly after sending the 'position-mode command' (^01 03 &amp; CHR(13)), the controller responds normal (or actually, it does not do anything at all).
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">Next step we do is sending the 'back to normal mode command' (^01 04 &amp; CHR(13)). After this, one of the engines starts and stops over and over. Reset won't work, the only way to stop, is to reload the settings using RoboRun
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">I can send the profile which is read from the controller after this problem has occured, as it seems to be quiet messed-up.

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

15 years 3 months ago #4795078 by cosma
Replied by cosma on topic Re:Distance mode - AX3500
<P style="MARGIN: 0px">Sorry for the delayed answer. One thing I see wrong is that giving a command of ^01 03 will set the controller in position mode but with analog feedback. I assume that you want encoder feedback instead.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">To enable the encoders for feedback, the command is ^01 C3. This is wrongly documented in the manual.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">

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

15 years 3 months ago #4803757 by TeamRowBo
Replied by TeamRowBo on topic Re:Distance mode - AX3500
<P style="MARGIN: 0px">Thanx for this reply, but I still don't get the controller doing what I want. Should the Robot start immediately after sending the registervalue to the encoders? (!Q6 Chr(13)) I don't really know wheter this code should make our robot drive for 18000 pulses, or that something is missing.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">And then my last question; should I change the ^01 04 Code (back to normal mode) to ^01 C4, or is this original command correct?
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">MPrt.Output = "^01 C3" &amp; Chr(13) ' Enter distancemode
<P style="MARGIN: 0px">MPrt.Output = "!Q2" &amp; Chr(13) ' Reset counters<BR>MPrt.Output = "*97 50" &amp; Chr(13) ' Set first register<BR>MPrt.Output = "*96 26" &amp; Chr(13) ' Set second register
<P style="MARGIN: 0px">MPrt.Output = "!Q6" &amp; Chr(13) ' Set both encoders with value from register
<P style="MARGIN: 0px">MPrt.Output = "^01 04" &amp; Chr(13) ' Back to normal mode

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

15 years 3 months ago #4808637 by cosma
Replied by cosma on topic Re:Distance mode - AX3500
<P style="MARGIN: 0px">The motors should start moving as soon as the destination is entered.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">There are few wrong things with your commands:
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">- after entering the position mode, you should reset the controller with the %rrrrrr command for the change to take effect. Then you should wait about one second (or poll for the OK) to make sure the controller is ready to accept your command.
<P style="MARGIN: 0px">- you should wait (or check) that the motor has reached the destination before switching back to the speed mode.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">In any case, you should tackle each problem separately.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">1- First configure and keep the controller in position mode using the PC utility. Then try to make it go to the position using commands sent manually with hyperterm.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">2- Experiment changing modes using commands sent manually
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">3- Incorporate all these sequences in your software

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

Moderators: tonysantoni
Time to create page: 0.084 seconds