BEST Robotics Forum
Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment   Page 1 of 2      1   2   Next
Skjohnson

Junior Member
Registered:
Posts: 2
Reply with quote  #1 
We are having problems with the arcade module in Simulink not functioning correctly. Forward and reverse will work correctly, but steering acts up every time. If forward and reverse on your joystick is the y-axis and left and right is the x-axis, steering works in the right direction while pressing forward slightly keeping the stick above the x axis, but as soon as you go even with or below the x axis it immediately goes the opposite direction. Steering while going backwards works in reverse, so pushing left turns right as long as it is below the x axis and vice versa. If you press directly along the x axis left or right, it is about 50/50 on which direction it will decide to go. We were wondering if anyone is experiencing a similar issue and if anyone knows what a fix may be.
0
jgraber

Moderator
Registered:
Posts: 155
Reply with quote  #2 
Hypothesis 1:  You have the left and right motor ports swapped, and the rest of your description is fuzzy or incorrect.
Test for H1: swap motor ports in hardware, or in code, and see if it behaves differently.
  In fact, there are 8 possible combinations of R/L motor, R/L port,  +/- plug (red-red, vs red-black) MC29 to motor connection.
  If you make a table of all these combinations, and all the results values for H3, it would look very good for programming section of Notebook,
  If you report the table with simulation reported values, it would look very good in the Simulation portion of the Notebook.

Hypothesis 2: Your description is correct, and the Simulink built in Arcade module does not match behavior of EasyC or RobotC Arcade behavior.
 Your description sounds kind of like the implementation does 'forward/backward' definition inversion when driving backwards.  Almost.
 Test for H2:  Other Simulink users could report data that confirm or non-confirm this Hypothesis. 

Hypothesis 3: Your description of robot behavior is correct, but you have some programming issue or feature engaged.
 Test for H3:  post a snapshot of your code.   So much the better if you have simulation feature installed, and can display, or at least report, the motor port outputs for these 6 joystick positions;  top left corner, top center, top right corner, bottom right corner, bottom center,  bottom left corner.
For each of these positions, report the left motor value on scale of (-127..+127), and report right motor value on scale of (-127 .. +127).
0
shiremath

Moderator
Registered:
Posts: 78
Reply with quote  #3 
There was a bug in the Arcade Module block that was fixed in September.

What version of VEX Companion App do you have? Update to the latest one and that has the Arcade module block fix. 

http://www.mathworks.com/matlabcentral/fileexchange/47903-vex-support-package-companion

Go to the above link and download the Zip file. Extract the mlappinstall file and double-click to run it. It will automatically update the App. After this update, you SImulink model should now be referencing to the updated block (no need to change anything in you model).

If this doesn't work for you for some reason, download the attached .txt file, rename the extension to .slx (because BEST Forum doesnt allow me to attach Simulink files!) and then use the Arcade module model as shown here. Note that the Gain block of -1 lets you invert the right motor speed since the motors are aligned to face each other on the robot. 

-SH

 
Attached Files
txt vexarmcortex_arcaderobot.txt (29.61 KB, 11 views)

0
pthompson21

Junior Member
Registered:
Posts: 1
Reply with quote  #4 
Sandeep, neither of the things you suggested worked. I tried updating and went as far as uninstalling and reinstalling the package completely along with trying the example in the attached file, but it still behaves the same. I will try to upload a picture of my code along with the simulated motor outputs of the joystick in different positions.
0
shiremath

Moderator
Registered:
Posts: 78
Reply with quote  #5 
I have tested the previously attached Simulink example model with a robot in office and arcade mode just works fine. Can someone else try it out and confirm this? 

pthompson21, provide a screenshot so that I can look at exactly what you have in your Simulink model and help you accordingly.
0
Skjohnson

Junior Member
Registered:
Posts: 2
Reply with quote  #6 
Pthompson resolved our problem. One of the values was -1 instead of 1 in the default block. We have it corrected now.
0
jgraber

Moderator
Registered:
Posts: 155
Reply with quote  #7 
Sounds like a variation of Hypothesis 3 then.
0
dcgrotberg

Junior Member
Registered:
Posts: 2
Reply with quote  #8 
We are having the same problem as originally stated. When we drop below the X axis the direction changes. This makes is very hard to drive. In EasyC arcade mode this does not happen. Is there a way to make Simulink's arcade mode work as it does in EasyC? 
0
shiremath

Moderator
Registered:
Posts: 78
Reply with quote  #9 
Let me take a look at the Arcade module block and get back to you.

Thanks
Sandeep
0
shiremath

Moderator
Registered:
Posts: 78
Reply with quote  #10 
There seems to be an issue with the Arcade Module block which I thought was fixed in the library last year.

In any case, attached is the corrected version of the Arcade module block. Please note how there is an 'ArcadeModule_fixed' block in this model that you would want to use in your Simulink models. This block will be different from an Arcade block that you would drag and drop from the VEX library. So, use a copy of the 'fixed' block in your model instead of the library block. Also, note the use of the -1 'Gain' block to invert the right motor value. So, you must use the fixed Arcade module block and the Gain block together to achieve the corrected behavior. 

Try this corrected module and provide your feedback.


SH
shiremat@mathworks.com 

 
Attached Files
zip vexarmcortex_arcaderobot_fixed.zip (29.08 KB, 6 views)

0
dannyk

Junior Member
Registered:
Posts: 21
Reply with quote  #11 
We tried the new arcade file and the robot seems to switch randomly between turning to the correct side and turning to the opposite side. SOmetimes it starts left and then quickly switches to right without a change in the joystick direction. It is impossible to maneuver due to changing directions randomly. I'm not sure if we did everything correctly.
0
shiremath

Moderator
Registered:
Posts: 78
Reply with quote  #12 
Dannyk,

I have re-tested the fixed Simulink model on a robot (and also in simulation mode using the Field Simulator block) and it does give me the expected correct behavior. 

Not sure what could be different in your case. Some things to check- 
-Make sure you used the Gain block as shown in the attached fixed Simulink file. Maybe missing out on that is causing an issue? 
- Also, make sure you have configured the Motor blocks appropriately as right and left. Swapping these by mistake could give erratic results. 

Is anyone else able to download the fixed version of the arcade robot model and let us know if you notice the same behavior as dannyk or not? 

-Sandeep
0
dannyk

Junior Member
Registered:
Posts: 21
Reply with quote  #13 
Thank you for your reply. We did not make any changes in the program from the "fixed" file.
We have an alternative tank program that works without incident with the same wiring.
There don't seem to be errors when going forward and backwards, but we are still getting the random switches from left to right when certain (so far unpredictable) y axis changes are made to the joystick.
Thank you
Danny
0
dannyk

Junior Member
Registered:
Posts: 21
Reply with quote  #14 
Upon further testing, we think this may be working it just has a very quick transition point along the y axis and it does not feel like it is always in the same place. Probably mostly operator error. The question we have is whether this transition point could be lessened (made less abrupt) with a deadband?
0
shiremath

Moderator
Registered:
Posts: 78
Reply with quote  #15 
Dannyk,

You are right about the abrupt change along the Y-axis due to change of the sign.
Yes, you can lessen the effect using a deadband block! Below is a screenshot of the model with the deadband block.

In my case, I have set the deadband range to -10 to 10, which means that for all vertical axis values on the joystick between -10 and 10, they will be made 0. This way, the sensitivity of the joystick around the horizontal axis is reduced and you wont see the abrupt changes anymore when holding the joystick along the horizontal axis (when trying pure left or right turns).

Hope this explanation helps and thanks for spending time on looking into it.

Sandeep

Deadband_Arcade.JPG 


0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.