스터디 로그/Embedded system

Mobile Robot 만들기 (1)

2024. 2. 22. 12:26

Design of Microprocessor 수업 파이널 프로젝트로 모바일 로봇을 만들어보려고 한다.

프로젝트 요건은 realtime, multitasking, 그리고 GUI(교수님이 사랑하는 LabVIEW를 사용할 예정)이다.

 

1) Robot state estimation

방향과 위치를 파악하기 위해 로봇은 wheel encoder와 IMU를 sampling 할 예정

 

2) Wireless communication for the LabVIEW GUI and the robot

wifi를 사용하기엔 bandwidth의 문제가 있을 것 같아서 우선 ESP-now를 살펴보기로 함

 

3) Actuator control

로봇의 wheel velocity를 컨트롤하기 위해 closed loop controller를 구현할 예정

 


XIAO-ESP32-C3

IoT mini development board (5v, 3.3v)

https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/

SDA (Serial Data): the line for the master and slave to send and receive data

SCL (Serial Clock): the line that carries the clock signal


 

ELEGOO NANO

breadboard, operating voltage: 5v

https://www.elegoo.com/products/elegoo-nano-v3-0?gad_source=1&gclid=CjwKCAiAlcyuBhBnEiwAOGZ2S3tV-f1jS7RIzHknqcvbhGgqOKmr0jeS9mokrnJbkmEyoW8d0v11nBoCjgUQAvD_BwE

 


 

Sparkfun 6DoF IMU 

https://www.sparkfun.com/products/21325

https://www.sparkfun.com/qwiic#resources

Qwiic wire convention: black: GND, red: 3.3V, blue: SDA, yellow: SCL

*Qwiic: standardized, plug-and-play connectivity system developed by SparkFun Electronics, enabling to quickly and easily connect various sensors, displays, and other components using I2C protocol w/o the need for soldering or wiring

*I2C protocol: a serial communication protocol, data is transferred bit by bit along a single wire (the SDA line), with best features of SPI and UARTs (can connect multiple slaves to a single master like SPI, and can have multiple masters controlling single/multiple slaves)

https://www.circuitbasics.com/basics-of-the-i2c-communication-protocol/

solder 납땜하다

 

*How to get angular velocity from this sensor?

*How to get quaternion from this sensor?

 

Quaternion이란?

https://roytravel.tistory.com/402

 

Arduino에서 IMU visualization

https://github.com/mattzzw/Arduino-mpu6050

 


 

HC-SR04 Ultrasonic Distance sensor

https://lastminuteengineers.com/arduino-sr04-ultrasonic-sensor-tutorial/

 

 

Operating voltage DC 5V

Operating frequency 40KHz

Trig: trigger ultrasonic sound pulses (by setting this pin to HIGH for 10 microsecond, the sensor initiates an ultrasonic burst)

Echo: (this pin goes HIGH when the burst is transmitted and remains HIGH until the sensor receives the echo)  

using speed of sound, 343m/s = 34300 cm/s = 0.034 cm/microsecond

distance = ((time * 0.034)/2를 이용해서 거리 계산

2cm~400cm 정도까지의 거리 예측 가능

 

 

 

 

Operating voltage가 5V이고, 우리가 사용할 esp32-c3의 regulated input/output은 3.3V이기 때문에 voltage divider를 사용해해서 5V -> 2.5V 해야 함

https://www.youtube.com/watch?v=fmSC0NoaG_I&list=PLYS_1w0FFIANdG78JyJu3tsumsXVIcXUB&index=12

https://forums.raspberrypi.com/viewtopic.php?t=233429

 


 

etc.

microcontroller (embedded) vs. microprocessor (brain of computer e.g., CPU)

 

breadboard: an easier alternative to soldering

How to use breadboard: https://www.youtube.com/watch?v=fq6U5Y14oM4

 

VCC (Voltage Common Collector): supplies power to the sensor

Serial communication: the process of sending data one bit at a time, sequentially, over a communication channel or computer bus

Baud rate: a measure of the speed of data transmission in bits per second (bps)