Presentation is loading. Please wait.

Presentation is loading. Please wait.

Get your software working before putting it on the robot! Example Explanation.

Similar presentations


Presentation on theme: "Get your software working before putting it on the robot! Example Explanation."— Presentation transcript:

1 Get your software working before putting it on the robot! Example Explanation

2  How to use the examples  Elevator simulation example  Arm simulation example  Integrating your software into your robot cRIO project

3 1. Create a new folder on your hard drive 2. Save SimulationExamples.zip to the folder you created in step 1 and unzip 3. Simulation examples (ArmSim.vi and ElevatorSim.vi) as well as control software examples will be in the folder you created. 4. Helpful simulation tools will be in \tools. 5. Example cRIO project will be in \robotSoftware

4  The elevator simulation example is contained in ElevatorSim.vi  The block diagram shows a simple elevator model, as well as some example elevator control software in ElevatorSoftware.vi  ElevatorSoftware.vi controls the elevator to 4 pre-set positions.  Positions are selected via X-box controller buttons.  Elevator position is controlled with a PID controller

5 1. Open ElevatorSim.vi 2. From the front panel, press the Run button on the toolbar (upper left) 3. Press any of the simulated X-box buttons on the front panel 4. You can see how each button sets the desired elevator height, and how the PID controller sets the motor command and controls the elevator height. 5. From the block diagram you can open ElevatorSoftware.vi 6. Feel free to make software changes, or change the PID gains to see how the elevator reacts

6  The arm simulation example is contained in ArmSim.vi  The block diagram shows a simple arm model, as well as some example arm control software in ArmSoftware.vi  ArmSoftware.vi uses the left stick of an X-box controller to set the desired arm position, and a PID controller to control the arm position  A better method would be to use a potentiometer wired to the Cypress IO board to control the desired position – you can create a mini-arm for the driver. The driver sets the arm position and the robot follows!

7 1. Open ArmSim.vi 2. From the front panel, press the Run button on the toolbar (upper left) 3. Drag the needle of the ArmDesired dial to set the desired arm position 4. You can see how the PID controller sets the motor command and controls the arm to match the desired position 5. From the block diagram you can open ArmSoftware.vi 6. Feel free to make software changes, or change the PID gains to see how the arm reacts

8  An example cRIO project was created an is in /robotSoftware  The example project is called exampleRobotCode.lvproj  Encoders and motors are opened in Begin.vi  The X-box controller is read in Teleop.vi and the stick and buttons are stored in global variables  ElevatorSoftware.vi and ArmSoftware.vi are hooked up to the encoders and motors in PeriodicTasks.vi (icon: “Timed Tasks”)  ElevatorSoftware.vi and ArmSoftware.vi are the EXACT SAME vi’s that are used in the simulation

9  Note: I did not test the cRIO project, so it may contain a bug or two.  IMPORTANT: Before running on the real robot, check that 1) motors go in expected direction, 2) sensor polarity is correct.  What happens if a sensor or motor goes in the opposite direction of what you expect? (Answer: it will go in the opposite direction at full power, most likely breaking something!)


Download ppt "Get your software working before putting it on the robot! Example Explanation."

Similar presentations


Ads by Google