![]() ![]() The pins used are 2 (orange), 3 (yellow) and 18 (green), and their channel assignment is set in the first lines of the config.h file: Arduino The fact that three hardware interrupt pins are needed is the reason why HoverBot uses an Arduino Mega rather than a smaller and cheaper Uno or Nano (see ). The receiver is powered by 5V (red) and GND (blue) from the breadboard and each of the PWM signal outputs (three for the HoverBot) are connected to one of the Arduino's inputs that are capable of hardware interrupts. ![]() The IMU only requires two wires for 5V power (red) and GND (black) from the breadboard and two wires for the I2C connection to the Arduino, connecting the IMU's and the Arduino's SDA (white) and SCL (left green). The UART pins are GPIO 1 (yellow) and GPIO 2 (white), as explained here (GPIO 1 connects to the Arduino's RX, GPIO 2 to the Arduino's TX): The ODrive communicates with the Arduino via the serial port, or UART. The ODrive powers the 5V power supply of all other components, so its GND (black cable on the J3 connector) and 5V (red cable on the J2 connector) are connected to a breadboard that acts as power distribution. Note that it might be necessary (depending on the version of the ODrive) to add some a 22nF capacitor between each of the three signals and ground for signal integrity (insulated with hot glue), as is mentioned here: The three signal lines are connected to inputs A, B and Z where the order again does not matter. A motor's hall sensors are connected using extension cables to the corresponding sensor inputs (M0 and M1) on the ODrive's J4 connector. ![]() Each hall sensor has five wires: Two for power (5V, usually red and GND, usually black) and three for signal (often blue, yellow and green). Hall sensorsĮach hoverboard motor comes with hall sensors that tell the ODrive when to power which of the three phases. If the batteries have a PMS (such as the ones usually found in a hoverboard), using the auxiliary resistor might prevent overvoltage errors. If HoverBot is powered from batteries without built-in battery management system (PMS), no auxiliary breaking resistor is required (the ODrive dumps recuperated energy into the battery). The order in which the motor wires are connected does not matter, the ODrive figures this out by itself during calibration. ![]() The ODrive is powered from the battery via its DC clamps (thick black and red cables on the left), and each motor's three phases (A, B, C, blue, yellow and green) are connected to one of its motor output clamps (M0 and M1). The wiring of the ODrive is explained on the ODrive website (that has very nice docs overall!): The wiring connects the wheel motors and their hall sensors with the ODrive, the ODrive to the Arduino and the Arduino to the IMU (sitting on a breadboard) and to the RC receiver. Note that the wiring is Highly Experimental and just a Proof-of-Concept. The following diagram roughly explains the data flow and types of electrical connections. The human at the sticks therefore needs to make sure that the velocity is kept sufficiently slow. If the vehicle goes too fast, the balance controller cannot compensate a forward fall anymore, and it will fall over eventually. The controller is tuned with five parameters listed in the config.h file.Ī problem of this control scheme is that the onboard controller does not get velocity feedback. The current is computed by the Arduino from the pitch and pitching velocity to control balancing, from the throttle command to control the forward and backward velocity, and from the steering command and the yaw velocity to control the steering. The ODrive is operated in current control mode. Very affordable, powerful and easy-to-use motors. Two hoverboard hub motors (easy to source from ebay).Enables very smooth current control for the two motors. Gives ready-to-use tilt angle estimation as well as gyro and accelerometer raw readings. Using the Mega because the project needs three hardware interrupt pins to decode the RC receiver's PWM signals. Rugged radio-controlled self-balancing robot using hoverboard hub motors. This project now lives here (as of March 2022): HoverBot ![]()
0 Comments
Leave a Reply. |