Skip to content
Snippets Groups Projects
Commit 5312f6e4 authored by James Talbert's avatar James Talbert
Browse files

PCB wuad working in manual mode, about to add output override command

parent dc346df3
No related branches found
No related tags found
No related merge requests found
Showing
with 45 additions and 34 deletions
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
int quad_main(int (*setup_hardware)(hardware_t *hardware_struct)) int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
{ {
// Structures to be used throughout // Structures to be used throughout
modular_structs_t structs = { }; modular_structs_t structs = { };
// Wire up hardware // Wire up hardware
setup_hardware(&structs.hardware_struct); setup_hardware(&structs.hardware_struct);
......
...@@ -29,26 +29,27 @@ ...@@ -29,26 +29,27 @@
#define QUAD_NUM 1 #define QUAD_NUM 1
#if QUAD_NUM==0 #if QUAD_NUM==0
#define IMU_ACCX_SIGN 1 #define IMU_ACCX_SIGN -1
#define IMU_ACCY_SIGN 1 #define IMU_ACCY_SIGN 1
#define IMU_ACCZ_SIGN 1 #define IMU_ACCZ_SIGN 1
#define IMU_GYRX_SIGN 1 #define IMU_GYRX_SIGN -1
#define IMU_GYRY_SIGN 1 #define IMU_GYRY_SIGN 1
#define IMU_GYRZ_SIGN 1 #define IMU_GYRZ_SIGN 1
#define MOTOR_FRONTLEFT_BASEADDR XPAR_PWM_SIGNAL_OUT_3_S_AXI_BASEADDR
#define MOTOR_FRONTRIGHT_BASEADDR XPAR_PWM_SIGNAL_OUT_1_S_AXI_BASEADDR
#define MOTOR_BACKLEFT_BASEADDR XPAR_PWM_SIGNAL_OUT_2_S_AXI_BASEADDR
#define MOTOR_BACKRIGHT_BASEADDR XPAR_PWM_SIGNAL_OUT_0_S_AXI_BASEADDR
#define ACCEL_X_BIAS 0.023f #define MOTOR_FRONTLEFT_BASEADDR XPAR_PWM_SIGNAL_OUT_3_S_AXI_BASEADDR
#define ACCEL_Y_BIAS 0.009f #define MOTOR_FRONTRIGHT_BASEADDR XPAR_PWM_SIGNAL_OUT_1_S_AXI_BASEADDR
#define ACCEL_Z_BIAS 0.0686f #define MOTOR_BACKLEFT_BASEADDR XPAR_PWM_SIGNAL_OUT_2_S_AXI_BASEADDR
#define MOTOR_BACKRIGHT_BASEADDR XPAR_PWM_SIGNAL_OUT_0_S_AXI_BASEADDR
#define ACCEL_X_BIAS 0.08f
#define ACCEL_Y_BIAS -0.057f
#define ACCEL_Z_BIAS 0.0f
#define GYRO_X_BIAS 0.005f #define GYRO_X_BIAS -0.006f
#define GYRO_Y_BIAS -0.014f #define GYRO_Y_BIAS 0.0545f
#define GYRO_Z_BIAS 0.0534//0.0541f #define GYRO_Z_BIAS 0.005//0.0541f
#endif #endif
...@@ -68,13 +69,13 @@ ...@@ -68,13 +69,13 @@
#define MOTOR_BACKLEFT_BASEADDR XPAR_PWM_SIGNAL_OUT_2_S_AXI_BASEADDR #define MOTOR_BACKLEFT_BASEADDR XPAR_PWM_SIGNAL_OUT_2_S_AXI_BASEADDR
#define MOTOR_BACKRIGHT_BASEADDR XPAR_PWM_SIGNAL_OUT_0_S_AXI_BASEADDR #define MOTOR_BACKRIGHT_BASEADDR XPAR_PWM_SIGNAL_OUT_0_S_AXI_BASEADDR
#define ACCEL_X_BIAS -0.005f #define ACCEL_X_BIAS -0.01f
#define ACCEL_Y_BIAS 0.03f #define ACCEL_Y_BIAS 0.041f
#define ACCEL_Z_BIAS 0.0f #define ACCEL_Z_BIAS 0.0f
#define GYRO_X_BIAS -0.001f #define GYRO_X_BIAS -0.024f
#define GYRO_Y_BIAS -0.0135f #define GYRO_Y_BIAS -0.013f
#define GYRO_Z_BIAS 0.035//0.0541f #define GYRO_Z_BIAS 0.02//0.0541f
#endif #endif
......
...@@ -144,6 +144,9 @@ int zybo_imu_read(struct IMUDriver *self, gam_t *gam) { ...@@ -144,6 +144,9 @@ int zybo_imu_read(struct IMUDriver *self, gam_t *gam) {
raw_accel_x = sensor_raw_accel_y; raw_accel_x = sensor_raw_accel_y;
raw_accel_y = -sensor_raw_accel_x; raw_accel_y = -sensor_raw_accel_x;
raw_accel_z = sensor_raw_accel_z; raw_accel_z = sensor_raw_accel_z;
// raw_accel_x = sensor_raw_accel_y;
// raw_accel_y = sensor_raw_accel_x;
// raw_accel_z = sensor_raw_accel_z;
// put in G's // put in G's
gam->accel_x = IMU_ACCX_SIGN * (raw_accel_x / 4096.0) + ACCEL_X_BIAS; // 4,096 is the gain per LSB of the measurement reading based on a configuration range of +-8g gam->accel_x = IMU_ACCX_SIGN * (raw_accel_x / 4096.0) + ACCEL_X_BIAS; // 4,096 is the gain per LSB of the measurement reading based on a configuration range of +-8g
...@@ -159,6 +162,9 @@ int zybo_imu_read(struct IMUDriver *self, gam_t *gam) { ...@@ -159,6 +162,9 @@ int zybo_imu_read(struct IMUDriver *self, gam_t *gam) {
gyro_x = sensor_gyro_y; gyro_x = sensor_gyro_y;
gyro_y = -sensor_gyro_x; gyro_y = -sensor_gyro_x;
gyro_z = sensor_gyro_z; gyro_z = sensor_gyro_z;
// gyro_x = sensor_gyro_y;
// gyro_y = sensor_gyro_x;
// gyro_z = sensor_gyro_z;
//Get the number of degrees //Get the number of degrees
//javey: converted to radians to following SI units //javey: converted to radians to following SI units
......
...@@ -18,7 +18,7 @@ int zybo_lidar_reset(struct LidarDriver *self, lidar_t *lidar) { ...@@ -18,7 +18,7 @@ int zybo_lidar_reset(struct LidarDriver *self, lidar_t *lidar) {
int error = 0; int error = 0;
//Device wakeup if asleep. //Device wakeup if asleep.
lidarlite_write(i2c, 0x00, 0x00); lidarlite_write(i2c, 0x00, 0x00);
usleep(15000);
// Device Reset & Wake up with default settings // Device Reset & Wake up with default settings
error = lidarlite_write(i2c, 0x00, 0x00); error = lidarlite_write(i2c, 0x00, 0x00);
if (error) return error; if (error) return error;
......
...@@ -49,6 +49,7 @@ int main() ...@@ -49,6 +49,7 @@ int main()
//test_zybo_mio7_led_and_system(); //test_zybo_mio7_led_and_system();
//!test_zybo_i2c(); //!test_zybo_i2c();
//!test_zybo_i2c_imu(); //!test_zybo_i2c_imu();
zybo_i2c_imu_self_test();
//!test_zybo_i2c_px4flow(); //!test_zybo_i2c_px4flow();
//!test_zybo_i2c_lidar(); //!test_zybo_i2c_lidar();
//!test_zybo_i2c_all(); //!test_zybo_i2c_all();
...@@ -59,7 +60,6 @@ int main() ...@@ -59,7 +60,6 @@ int main()
return 0; return 0;
#endif #endif
usleep(2*1000000);
// Run the main quad application // Run the main quad application
quad_main(setup_hardware); quad_main(setup_hardware);
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings"> <storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="org.eclipse.cdt.core.default.config.1532584570"> <cconfiguration id="org.eclipse.cdt.core.default.config.1229250672">
<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.1532584570" moduleId="org.eclipse.cdt.core.settings" name="Configuration"> <storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.1229250672" moduleId="org.eclipse.cdt.core.settings" name="Configuration">
<externalSettings/> <externalSettings/>
<extensions/> <extensions/>
</storageModule> </storageModule>
...@@ -10,10 +10,4 @@ ...@@ -10,10 +10,4 @@
</cconfiguration> </cconfiguration>
</storageModule> </storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="scannerConfiguration"/>
<storageModule moduleId="org.eclipse.cdt.core.pathentry">
<pathentry kind="src" path=""/>
<pathentry kind="out" path=""/>
</storageModule>
</cproject> </cproject>
...@@ -24,10 +24,6 @@ ...@@ -24,10 +24,6 @@
<key>org.eclipse.cdt.make.core.build.command</key> <key>org.eclipse.cdt.make.core.build.command</key>
<value>make</value> <value>make</value>
</dictionary> </dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.location</key>
<value></value>
</dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.build.target.auto</key> <key>org.eclipse.cdt.make.core.build.target.auto</key>
<value>all</value> <value>all</value>
......
THIRPARTY=false THIRPARTY=false
HW_PROJECT_REFERENCE=design_1_wrapper_hw_platform_0
PROCESSOR=ps7_cortexa9_0 PROCESSOR=ps7_cortexa9_0
HW_PROJECT_REFERENCE=design_1_wrapper_hw_platform_1
MSS_FILE=system.mss MSS_FILE=system.mss
...@@ -622,4 +622,11 @@ ...@@ -622,4 +622,11 @@
/******************************************************************/ /******************************************************************/
/* Xilinx FAT File System Library (XilFFs) User Settings */
#define FILE_SYSTEM_INTERFACE_SD
#define FILE_SYSTEM_USE_MKFS
#define FILE_SYSTEM_NUM_LOGIC_VOL 2
#define FILE_SYSTEM_USE_STRFUNC 0
#define FILE_SYSTEM_SET_FS_RPATH 0
#define FILE_SYSTEM_WORD_ACCESS
#endif /* end of protection macro */ #endif /* end of protection macro */
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Version: * Version:
* DO NOT EDIT. * DO NOT EDIT.
* *
* Copyright (C) 2010-2018 Xilinx, Inc. All Rights Reserved.* * Copyright (C) 2010-2019 Xilinx, Inc. All Rights Reserved.*
*Permission is hereby granted, free of charge, to any person obtaining a copy *Permission is hereby granted, free of charge, to any person obtaining a copy
*of this software and associated documentation files (the Software), to deal *of this software and associated documentation files (the Software), to deal
*in the Software without restriction, including without limitation the rights *in the Software without restriction, including without limitation the rights
......
...@@ -325,3 +325,10 @@ BEGIN DRIVER ...@@ -325,3 +325,10 @@ BEGIN DRIVER
END END
BEGIN LIBRARY
PARAMETER LIBRARY_NAME = xilffs
PARAMETER LIBRARY_VER = 3.9
PARAMETER PROC_INSTANCE = ps7_cortexa9_0
END
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment