Акселерометр может стать ценным дополнением к проекту робототехники. В этой статье мы покажем вам один подход к генерации и анализу данных ускорения.
Вспомогательная информация
Разработка пользовательского микропроцессора для программирования и тестирования
Пользовательский дизайн печатной платы с микроконтроллером EFM8
Создайте контрольную панель для шасси Romi Robot
Акселерометр
В предыдущей статье я представил корпус роботов Romi от Pololu и специально разработанную печатную плату Romi-control. Вы можете использовать следующую ссылку, чтобы загрузить полную схему и спецификацию.
Схема и спецификация
Эта печатная плата включает, помимо прочего, акселерометр. Часть, которую я выбрал, - это ADXL326 от Analog Devices. Это трехосевое устройство с аналоговым выходом и, с точки зрения пользователя, это совсем не сложно. Как вы можете видеть, требуется несколько внешних компонентов:
Image
Единственная реальная проектная работа заключается в выборе значения трех выходных конденсаторов (C22, C23 и C24). Каждая из этих шапок образует фильтр нижних частот с внутренним резистором ~ 32 кОм; таким образом, выбирая соответствующее значение емкости, вы можете ограничить пропускную способность аналоговых выходов в соответствии с потребностями вашего приложения.
Image
Таблица взята из таблицы ADXL326
Мои колпачки (номинально) 0, 022 мкФ, поэтому на основе таблицы выше моя пропускная способность будет немного выше 200 Гц.
Следующая диаграмма передает направления x, y и z ADXL326.
Image
Диаграмма взята из таблицы ADXL326
Контрольная печатная плата Romi имеет акселерометр, ориентированный следующим образом:
Image
Если мы объединим эту ориентацию с диаграммой данных и направлениями движения робота, как определено здесь, мы можем определить, что
прямое направление робота соответствует отрицательному ускорению по оси Х,
обратное направление соответствует положительному ускорению по оси Х,
направление вправо соответствует положительному ускорению по оси Y,
а направление влево соответствует отрицательному ускорению по оси Y.
АЦП
Мы будем использовать аналого-цифровой преобразователь EFM8 для оцифровки трех аналоговых сигналов ускорения, генерируемых ADXL326. Мы будем использовать полное 14-битное разрешение и внутренне сгенерированную ссылку на 2, 4 В. Вы можете обратиться к файлу конфигурации оборудования и исходному файлу ADC.c для деталей конфигурации АЦП; эти, вместе со всеми другими файлами источника и проекта, можно загрузить, нажав следующую ссылку:
Файлы источника и проекта
Если вы посмотрите на полную схему, вы заметите, что выходные сигналы акселерометра подключаются непосредственно к входам АЦП. Фильтр сглаживания не требуется, потому что ограничение полосы пропускания выполняется с помощью фильтра нижних частот, рассмотренного выше, и я уверен, что нам не нужен последователь напряжения, потому что модуль АЦП имеет модуль с возможностью выбора затухания, который предположительно включает некоторые что приводит к низкому выходному импедансу.
Мы будем использовать функции автозапуска ADC для сбора 2400 байтов данных АЦП. Каждый образец требует двух байтов, и у нас есть три канала (для трех осей), и, следовательно, мы имеем (2400/2) / 3 = 400 выборок на ось.
Передача данных
Нам нужно получить данные ускорения на ПК для визуализации и анализа. Раньше я использовал микроконтроллер с поддержкой USB в сочетании с пользовательским скриптом Scilab (см. Эту статью, включая ссылки в разделе «Поддержка информации»). Тем не менее, я решил перейти к более простой и универсальной системе. Предыдущий подход, безусловно, имеет свои преимущества, но он ограничительный (потому что вам нужно использовать микроконтроллер с USB-интерфейсом) и сложный (из-за дополнительной прошивки USB и всей разработки Scilab).
Новый метод основан на программе YAT («Еще один терминал») и Excel. Я предполагаю, что можно использовать другое программное обеспечение для работы с электронными таблицами, но инструкции здесь относятся к Excel.
Я ценю простоту связи UART, но у компьютеров больше нет последовательных портов. Простейшим средством для этой ситуации является конвертер USB-to-UART; Я использую это из Pololu. Это, по сути, плата для CP2104 от Silicon Labs; Я мог бы разработать свой собственный, но если Pololu продаст их за $ 5, 95, зачем беспокоиться. Эта удобная небольшая доска позволяет мне писать прошивку, как будто USB не существует, просто отправьте байт, получите байт, как в старые добрые времена RS-232. На следующей фотографии показана плата управления Romi, подключенная к адаптеру C2 правую сторону и конвертер USB-to-UART слева.
Image
Примечание. Если вы используете питание от USB, вы должны убедиться, что ваш код не позволяет включить двигатели. USB-порты не предназначены для такого уровня тока. Я рекомендую физически отключать двигатели, просто чтобы быть уверенным.
Когда ADC закончил 1200 выборок (400 на ось), мы просто записываем каждый байты из последовательного порта следующим образом:
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.
void Transfer_ADCBuffer(unsigned int num_bytes) { unsigned int n; SFRPAGE = UART0_PAGE; SCON0_TI = 0; //make sure that the transmit interrupt flag is cleared for(n=0; n
The ADC is configured to sequentially sample from P1.5, then P1.6, then P1.7, back to P1.5, and so forth.
Image
As you can see from the schematic, this results in data that is arranged in memory as follows: z-axis, y-axis, x-axis, z-axis, y-axis, x-axis, and so forth. The ADC is configured for big endian, which means that each sample will begin with the high byte. Thus, our memory looks like this:
Image
YAT If everything is working correctly, the ADC data will appear in the YAT window. Here is what you need to do to make it very easy to inspect this data and work with it in Excel: Go to Terminal->Settings and select "Binary" for "Terminal Type." In the same window, click "Binary Settings"; check the box for "Separate settings for Tx and Rx" then enter "6" for "Break lines after" in the "Rx" section.
Image
Back in the main window, click on the "10" button so that the data appears as decimal
Image
Now when you transfer the data, it will appear as follows:
Image
This is the format we want: each row consists of one data point, ie, one two-byte sample for each acceleration axis. Excel First, save the YAT data to a file:
Image
Now you can import this space-separated data into Excel using the "From Text" button in the "Data" ribbon. Note that this block of data will remain "connected" to the data file, so to bring in new data you simply use the "refresh" functionality (see the video below for a demonstration). Once you have the raw data in Excel, you can convert it to ADC counts and to volts (or millivolts). I have my worksheet set up like this:
Image
Click to enlarge On a separate sheet, I have a plot that pulls data from the "millivolts" columns. If you want to use my Excel file, feel free: Excel File
Here is a plot of "self-test" output signals (you can read about the self-test functionality in the ADXL326 datasheet).
Image
(The initial rising edge is a result of the accelerometer's startup delay.) Self-test causes the analog outputs to assume a predetermined value; if the measured voltages correspond to the expected voltages, you know that the accelerometer is functional. And because the predetermined value is different for each axis, self-test allows you to confirm that you are associating the samples with the correct axis. Here are plots for two more data sets. In the first, the PCB is not moving; in the second, I am using my hand to jiggle the robot chassis.
ImageImage
The following video helps to clarify the overall procedure:
Summary We discussed the hardware implementation of a three-axis, analog-output accelerometer, and I presented a straightforward method of getting stored accelerometer data from the robot's microcontroller to a PC. We then moved the data into Excel and plotted the results.