Commit bb1c9f22 authored by James Talbert's avatar James Talbert

This is the working version of the master branch from before the merge with...

This is the working version of the master branch from before the merge with the working groundstation.
parent 2071613e

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

# Zybo PCB Shield
The creation of the custom PCB shield was inspired by a fateful crash during one of MicroCART's demos for the 2018 ECpE Scholar's Fair. Multiple connectors were disconnected by the impact of the crash and the MicroCART team (who had just begun the project and were not familiar with the hardware setup) needed to find the issue quickly and resume demos. The creation of the PCB is intended to spare future groups from this particular set of hardware problems.
The PCB is meant to act as a custom shield for the Zybo boards mounted on the quads. It serves 3 main functions:
1. Simplify quad hardware assmebly and secure connections to external devices (sensors, wifi bridge, motors, etc) using latching connectors.
2. Provide multiple test points where the user can probe for signals even when the quad is in operation.
3. Incorporate a voltage regulator to step the battery voltage down while also saving power and maintaining consistent output voltages.
The layout and schematic of the board can be seen below. It has 4 different layers, each represented by a different color. These images are screenshots taken in MultiSim and UltiBoard - the software we used to design the PCB.
![image](/quad/doc/images/PCB_r2_layout.PNG)
![image](/quad/doc/images/PCB_r2_schematic.PNG)
# Future PCB Revisions
Because it's possible that future teams may wish to change the hardware used on the quad, we have included the MultiBoard and UltiSim design files and the Bill of Materials used for creating and assembling the PCB in Shield_PCB.zip in this folder.
For more information on how to design and build PCBs, check out the useful tutorials below from EE 333 (taught by Dr. Tuttle). They walk you through the basics of using MultiSim and UltiBoard, as well as provide some information about PCB components and design.
* [Tutorial 1 - Circuit Design, Schematic Creation with MultiSim, Component Footprints](/quad/doc/pcb_layout_tutorial_1.pdf)
* [Tutorial 2 - Transferring Board Schematic to Layout in UltiBoard, Arranging and Connecting Parts](/quad/doc/pcb_layout_tutorial_2.pdf)
* [Tutorial 3 - Design Rule Check, Exporting Gerber Files for the Manufacturer](/quad/doc/pcb_layout_tutorial_3.pdf)
# Errata/Easy Mistakes
## Version 2
- UART0 lines (to WiFi) are flipped, can be fixed in constraints file.
- RC controller PWM lines are reconfigurable in software and constraints,
and depend on how the RC receiver is wired, so double check that you get good results if you change those.
- Motor PWM lines are reconfigurable in software, and have to match the controller, so be careful with those as well.
- The IMU has to be mounted with the label text down (the lables for the pins) and the mounting holes facing towards the PMOD test points
\ No newline at end of file
......@@ -43,7 +43,7 @@ come with the
tools already installed. However, the following steps need to be taken in
order to launch the
program
- In a terminal, enter `source /remote/Xilinx/2018.3/Vivado/2018.3/settings64.sh`
- In a terminal, enter `source /opt/Xilinx/2018.2/Vivado/2018.2/settings64.sh`
- In terminal type `xsdk &`
1. ISU Remote Linux Servers (linux-X, research-x.ece.iastate.edu)
- `source Xilinx_Tools/setup_scripts/remote_servers/setup.sh`
......
......@@ -40,7 +40,7 @@ int cb_packetlog(struct modular_structs* structs, struct metadata *meta, u8 *dat
n_msg_received += 1;
total_payload_received += length;
int len = sprintf(buf, "Packets received: %d", n_msg_received);
send_data(structs->hardware_struct.comm.uart, PACKETLOG_ID, 0, buf, len);
send_data(structs->hardware_struct.comm.uart, PACKETLOG_ID, 0, (u8*)buf, len);
return 0;
}
......@@ -54,7 +54,7 @@ int cb_getpacketlogs(struct modular_structs* structs, struct metadata *meta, u8
// Message logging number of messages received and size of payload received
int len = snprintf((char*)buf, sizeof buf, "%d,%lu", n_msg_received, total_payload_received);
send_data(structs->hardware_struct.comm.uart, LOG_ID, 0, buf, len >= sizeof(buf) ? 255 : len + 1);
send_data(structs->hardware_struct.comm.uart, LOG_ID, 0, (u8*)buf, len >= sizeof(buf) ? 255 : len + 1);
return 0;
}
......@@ -448,6 +448,7 @@ int cb_overrideoutput(struct modular_structs *structs, struct metadata *meta, un
float f = build_float(&data[1+i*4]);
override_info->values[i] = f;
}
return 0;
}
int cb_sendrtdata(struct modular_structs *structs, struct metadata *meta, unsigned char *data, unsigned short length) {
......@@ -456,32 +457,32 @@ int cb_sendrtdata(struct modular_structs *structs, struct metadata *meta, unsign
return -1;
int size = 0;
u32 configData = (data[2] << 24) | (data[3] << 16) | (data[4] << 8) | (data[5]);
structs->flags_struct.lidarflags->quadHeight = read_bit(configData, 31); size += read_bit(configData, 31);
structs->flags_struct.lidarflags.quadHeight = read_bit(configData, 31); size += read_bit(configData, 31);
/*BEGIN DOUBLE-TYPE FLAGS. If these are enabled, actual size of data sent is 2*read_bit due to
* length of data. This needs to be compensated for in methods where total length of payload packet
* needs to be known ahead of time. */
structs->flags_struct.optflowflags->x_flow = read_bit(configData, 30); size += read_bit(configData, 30);
structs->flags_struct.optflowflags->y_flow = read_bit(configData, 29); size += read_bit(configData, 29);
structs->flags_struct.optflowflags->x_filter = read_bit(configData, 28); size += read_bit(configData, 28);
structs->flags_struct.optflowflags->y_filter = read_bit(configData, 27); size += read_bit(configData, 27);
structs->flags_struct.optflowflags->x_velocity = read_bit(configData, 26); size += read_bit(configData, 26);
structs->flags_struct.optflowflags->y_velocity = read_bit(configData, 25); size += read_bit(configData, 25);
structs->flags_struct.optflowflags.x_flow = read_bit(configData, 30); size += read_bit(configData, 30);
structs->flags_struct.optflowflags.y_flow = read_bit(configData, 29); size += read_bit(configData, 29);
structs->flags_struct.optflowflags.x_filter = read_bit(configData, 28); size += read_bit(configData, 28);
structs->flags_struct.optflowflags.y_filter = read_bit(configData, 27); size += read_bit(configData, 27);
structs->flags_struct.optflowflags.x_velocity = read_bit(configData, 26); size += read_bit(configData, 26);
structs->flags_struct.optflowflags.y_velocity = read_bit(configData, 25); size += read_bit(configData, 25);
//END DOUBLE TYPE FLAGS.
structs->flags_struct.imuflags->gyro_x = read_bit(configData, 24); size += read_bit(configData, 24);
structs->flags_struct.imuflags->gyro_y = read_bit(configData, 23); size += read_bit(configData, 23);
structs->flags_struct.imuflags->gyro_z = read_bit(configData, 22); size += read_bit(configData, 22);
structs->flags_struct.imuflags->acc_x = read_bit(configData, 21); size += read_bit(configData, 21);
structs->flags_struct.imuflags->acc_y = read_bit(configData, 20); size += read_bit(configData, 20);
structs->flags_struct.imuflags->acc_z = read_bit(configData, 19); size += read_bit(configData, 19);
structs->flags_struct.imuflags->mag_x = read_bit(configData, 18); size += read_bit(configData, 18);
structs->flags_struct.imuflags->mag_y = read_bit(configData, 17); size += read_bit(configData, 17);
structs->flags_struct.imuflags->mag_z = read_bit(configData, 16); size += read_bit(configData, 16);
structs->flags_struct.errorflags->lidar = read_bit(configData, 15); size += read_bit(configData, 15);
structs->flags_struct.errorflags->consec_lidar = read_bit(configData, 14); size += read_bit(configData, 14);
structs->flags_struct.errorflags->optFlow = read_bit(configData, 13); size += read_bit(configData, 13);
structs->flags_struct.errorflags->consec_optFlow = read_bit(configData, 12); size += read_bit(configData, 12);
structs->flags_struct.errorflags->imu = read_bit(configData, 11); size += read_bit(configData, 11);
structs->flags_struct.errorflags->consec_imu = read_bit(configData, 10); size += read_bit(configData, 10);