Open-Source Robotics And Proces Control Cookbook Edwards L 242P Newnes Elsevier 2005 Part 6

Tham khảo tài liệu 'open-source robotics and proces control cookbook edwards l 242p newnes elsevier 2005 part 6', kỹ thuật - công nghệ, cơ khí - chế tạo máy phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 3 SEL line is HIGH. Disable USI and switch PB1 to input to take us off-bus usi_disable disable USI start and overflow interrupts cbi USICR USISIE cbi USICR USIOIE Disable output driver on PB1 DO cbi DDRB PORTB_DO set PB1 to input iopin_done out SREG r3 reti Some averaging or filtering is advisable on the PC end of this equation. Here s a simple program that takes out continuous readings and prints them to a single line on the console you ll find the sourcecode and makefile for this program in the accel directory of the sample source archive Demonstration applet for E2BUS stepper interface code From Open-Source Robotics and Process Control Cookbook Lewin . Edwards sysadm@ include include int main int _argc char _argv unsigned char pkt 6 int i 0 j Open port if E2B_Acquire printf Error opening E2BUS. n return -1 88 Some Example Sensor Actuator and Control Applications and Circuits Hard Tasks E2B_Reset printf Reset complete pausing. n sleep 1 printf XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX while 1 usleep 750000 pkt 0 ACL_CMD_READ_STATUS E2B_Tx_Bytes pkt 1 0 0 E2B_Rx_Bytes pkt 6 0 1 for j 0 j 37 j printf b printf Sample status i pkt 0 pkt 1 pkt 2 pkt 3 pkt 4 pkt 5 fflush stdout i return 0 If you run this program you ll see that even if the accelerometer is stationary there s a certain amount of jitter in the output values. This is partly due to the irritatingly analog nature of the Universe partly due to vibration of the accelerometer and partly due to the fact that serial interrupts can slightly skew the time measurement task. For example here is a sequence of three consecutive readings from my prototype 6821 2C0A 3AD6 67D7 2BFC 3AF0 67E9 2C46 3A2C Because this phenomenon is unavoidable some averaging or filtering is desirable before working with the sensor output. Simple averaging is acceptable but a Kalman filter is better for more information on this topic I recommend the .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.