Description of Components - RobotCasserole1736/RoboSim GitHub Wiki
High Level
RoboSim consists of both Hardware and Software. The Hardware component is designed to read electrical signals generated by an FRC Electrical board (ie, from motors or solenoids), and generate feedback signals for the board (ie, from sensors). Additionally, the hardware must communicate with a host PC.
The hardware consists of an IO board, a PWM Filter board, and an Arduino Uno.
The IO Board is a set of four eight-bit shift registers. 16 bits control analog outputs, and 8 bits control digital outputs. The final 8 bits are controlled by 0-12V digital inputs (from solenoids or on/off motor controllers). Multiple boards can be ganged together in series. This allows the Arduino to address many inputs and outputs with only four pins (Data in, data out, clock, and sync).
The PWM filter board scales, offsets, and filters PWM signals generated by motor controllers from the +/- 12V PWM power provided to motors, down to a 0-5V DC signal range readable by an Arduino's analog inputs.
The Arduino is an AVR Processor plus peripherals which is programmed to collect data from the outside world (via the IO and PWM filter boards), send that info to the Host PC. Additionally, it receives commands from the Host PC and sets outputs accordingly. These outputs include the 8 digital outputs on the IO board, the 2 analog outputs on the IO board, and four quadrature encoder frequency outputs.
The software associated with RoboSim is divided into two large pieces. The Arduino has some software running on it, which acquires data from the IO card and analog pins on the Arduino. It also performs serial communication with the Host PC, sets digital and analog outputs as instructed, and performs precise timing operations to generate the quadrature encoder PWM outputs.
The second part of the RoboSim software runs on the host PC. This software is run under the host program Octave, a scientific computing software suite which interprets .m code files (very similar to Matlab). There are multiple .m code files which can be run. These include:
- a simple test GUI, which provides the ability to test RoboSim's outputs and inputs.
- a plant model, which models a robot's behavior based on inputs from RoboSim. It also generates feedback to the robot's control board.