130 likes | 228 Views
Programming a Wheel System. By Joshua Shaw. From the last Power Points. We have previously added a While Loop We are now going to use it for programming the robot We have also added two motor programs An analog program A digital program We have also added two servo programs as well
E N D
Programming a Wheel System By Joshua Shaw
From the last Power Points • We have previously added a While Loop • We are now going to use it for programming the robot • We have also added two motor programs • An analog program • A digital program • We have also added two servo programs as well • An analog program • A digital program
Creating a Program for Wheels • One of the most commonly used wheel configurations is a wheel on each side of the robot • To avoid spinning in circles, the motors need to spin in opposite directions • The wheels need to work in unison, as well as being independent of each other • This can be achieved in an Arcade Program
Arcade Programming-Channels • Go back to Joystick under the Functions Blocks • Click and drag the Arcade - 2 motor anywhere on the vertical line of the While Loop • Click the down arrow on the Forward\Reverse Channelto choose the channel that will operate the forward and backwards motion of the robot (select “3” for this program) • Do this for the Rotate Channel (select “4”)
Arcade Programming-Motors • Click the down arrow on theLeft Motor and select a motor to operate the wheels • For this example select “6” • Do this for the Right Motor except with a different motor • For this example select “8”
Arcade Programming - Invert Direction of Motors • To operate the wheels properly we will need to invert the direction of one of the motors • We will Invert Direction for Left Motor “6” by clicking the down arrow of Invert Direction and selecting “1” • If the robot goes backwards than we will return Invert Direction of Left Motor “6” to “0” and select “1” under Invert Direction for Right Motor “8” • Finally click OK
Completed Arcade Program • This is what the program for the Arcade – 2 motor will look like
Using the Joystick Controller – Channel 3 and 4 • You will use the Channels 3 & 4on the Joystick Controller • Move the left Joystick in any direction to control the two motors • Both motors will run simultaneously
Tank programs • Another type of wheel system is the tank • Uses two independent wheel systems • Drag and Drop Tank – 2 motor into the While Loop • As you can see it looks similar to the Arcade – 2 motor
Tank programs –v- Arcade program • The primary difference between the Arcade program and the Tank • Arcade runs of one joystick • Tank runs of two joysticks • Each has an advantage • Arcade acts more like a computer game and is usually easier to operate • Tank allows for more variation in turning capability and precision of turns • You can only use one or the other • For this tutorial we will only use the Arcade program for the wheels
Noise Pollution • As you have probably notice, the motors of your robot give off a high pitch whining sound • This is due to the slight push on the joysticks from any number of forces • Slight breeze • Gravity • Slight push from the fingers • It is able to be fixed fairly easily
Reducing Noise for Channel 3 and Channel 4 Motors • You need one for each of the analog channels that where used • In this example we used Channels 3 and 4 • Drag and drop the Joystick Analog Deadbandbetween the Variable box and the While box • Since we have a motor that is controlled by Channel 3 set the Analog Channel to “3” • Set both the Positive and Negative Deadband to “20” • Click OK • Drag and drop the Joystick Analog Deadbandbetween the Variable box and the While box • Since we have a motor that is controlled by Channel 4 set the Analog Channel to “4” • Set both the Positive and Negative Deadbandsto “20” • Click OK
Next PowerPoint • The next PowerPoint is Downloading and Testing the Program