We are trying to use external mode to set servo angles more efficiently. We have watched the videos repeatedly and think we have everything set up correctly. The program runs on the robot without problems. It runs in simulation mode without problem, showing the angle changes in the display box. It says it has loaded in external mode and is controlling the cortex, however nothing moves when we toggle the buttons. We have the cortex on and a battery connected.
Here are the steps we are following.
Switch to external mode
connect USB,
Push play,
wait for successful build and note that it is running on the cortex
Turn on cortex,
toggle simulation input block,
curse repeatedly when it doesn't work.
A screen shot is attached

We would like to skip the last step.
Any thoughts would be appreciated.
Thank you
Quote 0 0
Have been out sick for a while, so couldn't address your frustration earlier! 

This steps that you are following seem reasonably correct to me. A few things that might be worth checking- 

1) The joystick button and motor blocks are configured correctly to reflect the right mapping.
2) Does the regular download of the model work correctly?
3) In your steps, one thing I would try differently is to keep the robot turned on before hitting the play/run button in Simulink. This does make a difference.
4) Try external mode with a very simple model like constant value (100) to a motor and see if that works. 

Let me know what results you obtain.

Quote 0 0
I tried all the steps but still the same problem.
One thing I noticed was that the displays are not giving the correct values or changing with toggle while in the external mode. The displays do show the correct values and change with the toggle while in normal mode. THe program works flawlessly on the robot, just cannot control it from the computer in external mode.
Quote 0 0
Are you able to share your Simulink file with me at shiremat@mathworks.com so that i can test it at my end?

Quote 0 0

Based on the screenshot of the model that you sent, the use of ‘Gamepad’ blocks for the external mode simulation is causing the problem.


During external mode, you cannot have gamepad joystick or gamepad button blocks connected to your motors and then use the Toggle blocks connected to these gamepad blocks to control the motors. What you must be doing is replacing the gamepad blocks directly with a Constant or Toggle block to provide input to the motor during external mode. You can see in my training video for External mode (link) at around 3:15 the model that I use to demo external mode workflow. Notice how I don’t have gamepad blocks in that model. The reason for this is, as Anusha mentioned, the VEX gamepad is not connected to the robot (over USB cable or wirelessly) during external mode, thus the gamepad blocks in the model during external mode will NOT work. The toggle blocks that you currently have connected to the gamepad button blocks in your model are for NORMAL SIMULATION purposes only. They will not work during external mode to provide input to the servos/motors.


So, an example model for external mode, in your case, would look like the image below. You will have to modify your entire model to follow this design for external mode.

  ExtMode1.png (Notice, how unlike your model below, I don’t have a Gamepad Button block connected to the Switch input port.)

 Running this model in external mode should now let you use the Toggle block to change the input to the Servo and thus you should now be able to control the servo angle on the robot.


For downloading to the robot….

Once you are done with the External mode test, you must change your Simulink model to INCLUDE the gamepad button block in the model before deploying the FINAL ready program to the robot. So, when it is downloaded, you should be able to connect the VEX gamepad to the VEX cortex (wirelessly or using USB cable) and control it using the buttons on the gamepad. The model for downloading should look like this:




Try out the suggestions above and let me know what you find. Hopefully this will resolve the confusion that you are having. 


Quote 0 0