Programming resources for Fauxbot exercises
The goal of the Forklift exercise is to introduce students to writing code for a mechanism using inputs from the driver to control motors and pneumatics.
Programming: 1 Robotics: 1
We’ll now cover the basics that will need to be understood for implementing the ForkliftMechanism. More specific instructions exist in the Robot Code Instructions
The left DriveTrain motor controls movement on the left side of the DriveTrain. You can assume that the positive direction moves forward and negative moves backwards. The motor is connected to the RoboRIO’s PWM channel 0.
The right DriveTrain motor controls movement on the right side of the DriveTrain. You can assume that the positive direction moves forward and negative moves backwards. The motor is connected to the RoboRIO’s PWM channel 1.
The lifter for our purposes is a pneumatic piston which controls the movement of the forks. You can assume that the “forward” direction moves the lifter up and “reverse” direction moves the lifter down. The forward direction is connected to PCM channel 7, and reverse direction is connected to PCM channel 8.
There are no sensors required for this exercise.
The left side of our DriveTrain is controlled with an analog operation that can be used as the value provied to the motor. If the Analog operation is 0.5 (50%), then we should provide 0.5 (50% power) to the left DriveTrain motor.
The right side of our DriveTrain is controlled with an analog operation that can be used as the value provied to the motor. If the Analog operation is 0.7 (70%), then we should provide 0.7 (70% power) to the right DriveTrain motor.
Our forklift is very simple and only supports being up or down, not halfway in between. When the ForkliftUp operation is true, we want to move the lifter into the up position.
When the ForkliftDown operation is true, we want to move the lifter into the down position.