anseljh / robomagellan-anseljh

Work toward RoboMagellan!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

robomagellan-anseljh

This repo has notes, code, and other stuff related to my work toward competing in a Robo-Magellan contest. I plan to do at least the TableBot challenge first, but I've started planning and collecting parts for Robo-Magellan. I hope to be ready to compete in spring/summer 2024, but that may be overly ambitious. 2025 for sure!

Robo-Magellan

Robo-Magellan is a robotics competition emphasizing autonomous navigation and obstacle avoidance over varied, outdoor terrain. Robots have three opportunities to navigate from a starting point to an ending point and are scored on time required to complete the course with opportunities to lower the score based on contacting intermediate points.

Design Considerations

  • Size: The robot will need to be able to overcome some terrain obstacles, so it shouldn't be too small or underpowered.
  • Sensors:
    • GPS (navigation)
    • Compass (navigation; don't want to rely on GPS just to get heading)
    • Camera (to detect cones)
    • Distance sensors of some kind (collision avoidance)
    • Lidar (to detect cones; collision avoidance; also just cool)
    • Tactile sensors (to detect contact with cones)
  • Compute:
    • Something powerful enough to process images from the camera and identify orange cones. I have a Raspberry Pi Model 3 A+ which I'll try out. It may be underpowered (only 512 GB RAM).
    • Planning to base the rest around an RP2040 board, probably one of my Raspberry Pi Picos. Could I just use the more powerful Raspberry Pi computer? Probably, but, among other considerations, I think it's more funny to make the computer be a peripheral for the microcontroller.
  • Dead man's switch: The Robo-Magellan rules require the operator be able to stop a robot immediately by letting go of a switch. I have a few ideas about this, but nothing definitive. I might use the RFM69HCW packet radios that I've used before and have a remote send a heartbeat to the robot while a button is pressed, and if that signal doesn't come, a relay cuts off power to the motors. I want to research how other people are doing this and maybe not reinvent the wheel. There's a Sparkfun tutorial called How to Build a Remote Kill Switch that is very similar to my concept.
  • Logging: I'll want to log data for later analysis. I got an SD card breakout board for this that I haven't tried out yet. On the other hand, I might want to use that for quickly delivering GPS coordinates to the bot. Might need to get a second one in that case.

Intermediate Milestones

  1. Do a working TableBot. Work on fundamentals in a small form factor. Complete a project of some complexity with CircuitPython. Fun!
  2. Make the remote. Decide on the dead-man's switch mechanism. Design the PCB for the remote. Get it fabricated. Add panel-mount holes to an enclosure, including a port for the Wii Nunchuck. Attach all the things! Test it with the TableBot.
  3. Get the big DC motors running. This entails working out all the power management for the motors, and hooking up the motor driver.
  4. Test remote motor power cut-off. Need to verify this works before getting too far along with everything else.
  5. Figure out how to mount wheels to the big DC motors. I'm even more of a rookie when it comes to mechanical engineering. Lots to learn here.
  6. Build a chassis. Figure out how big & what kind of chassis to build. Build it.
  7. Do a working FloorBot. This is another good intermediate goal. I can use the same chassis, motors, remote, etc., but not have to worry about GPS, terrain, and recognizing orange cones yet.

Parts Selection

Motors

I got four chunky motors at a Homebrew Robotics Club meeting in early 2023. It's been a bit challenging to pin down precisely what they are, but I think they are RAE M1500 permanent magnet DC motors with G211 right-angle gearmotors. Here are the basic specifications. I think they'll do the job.

  • Voltage: 18V
  • Current: 2A
  • Speed: 200 rpm
  • Torque: 6 in.-lb.
  • Weight: Unknown. Need to weight them. Heavy!

Battery & Power Distribution

Those motors will need a good amount of power. So far, I think I'll use a small-ish SLA battery. You can get one for about $20. I'll then need to step up the power from 12V to 18V, so I got a Pololu 4.5-20V Fine-Adjust Step-Up Voltage Regulator U3V70A.

Chassis

I haven't thought about the chassis much yet. It needs to be able to hold these heavy motors and the SLA battery, which itself is 4.5 pounds.

Motor Driver

The little motor drivers I've used before won't cut it for driving multiple 18V 2A motors, so I needed to get a beefier driver. I settled on the Cytron 10A 5-30V Dual Channel DC Motor Driver. I considered the very cool RoboClaw as shown in Camp Peavy's book HomeBrewed Robots!, but it's expensive and a bit more complex than I need. (I think.)

Wheels, et cetera

I need to figure out how to mount wheels to the motor shafts, which are 1/4" diameter. I don't know much about this part. It seems to be hard to find wheel hubs for 1/4" diameter shafts, but there's probably stuff I'm missing.

GPS

Thanks to a thread on the Homebrew Robotics Club mailing list, I scored a GPS module for $9. It's the HiLetgo GY-NEO6MV2. It's not the best thing ever, but it works, and did I mention that it was $9? It uses a Ublox NEO-6M GPS module. It's 3V compatible and you just communicate to it over a UART. There's a CircuitPython GPS library that works great. It takes several minutes to warm up (or whatever it's doing) but once that's done, it works fine.

Lidar

I have a getSurreal XV Lidar Sensor Mount Package, which uses the lidar sensor from a Neato XV robotic vacuum.

The controller is the getSurreal Lidar Controller v2.0.

I had to get a replacement drive belt for the motor that spins the laser around. ($9.95)

Distance sensors

In addition to the lidar, I'm planning to add a few other distance sensors around the bot for further collision avoidance redundancy, in case something goes wrong with the lidar. I'm not sure yet how many distance sensors I want, or what type to use.

I have a trusty HC-SR04 ultrasonic sensor which uses 5V, as well as a 3.3V equivalent RCWL-1601. These will probably work OK, but I'll need to test. I may need to get more depending on what kind of coverage I want.

My TableBot is using some little infrared sensors for detecting the edge of the table, but I doubt they'll be good for this application.

Compute

I'd like to primarily use a Raspberry Pi Pico. The Pico is a cool little board based on the RP2040 microcontroller chip. I've been programming these in CircuitPython, and it is tons of fun.

There are two tasks that will require more compute power than the little Pico can muster, so I'm planning to use a beefier single-board computer for those tasks, and send their outputs to the Pico. So far I intend to use a Raspberry Pi Model 3 A+. It will process camera images to find the target cones, and send its conclusions to the Pico.

Logging

I'll log telemetry to a micro SD card. I have a breakout board for that.

Should there be a realtime clock? Might not need one because we can get time from the GPS.

Bills of Materials

Control Board

Motors and Drive System

Power Systems

Camera/Lidar System

Remote & Dead-Man's Switch

For the safety stop mechanism, I'm envisioning a small handheld device that will double as a remote control when moving the robot manually.

  • Custom PCB
  • Raspberry Pi Pico - $4
  • RFM69HCW packet radio - $14
  • Antenna - $1
  • SMA antenna connector
  • Adafruit Wii Nunchuck Breakout Adapter - $2.95
  • Wii Nunchuck
  • Big button for dead-man's switch
  • Toggle switch for power
  • Enclosure (I have a few that might work)
  • Green LED for connection indicator
  • Red LED for heartbeat blink
  • Another LED for mode indicator?

Pins Required

Control Pico

  • 2 for UART to Pi 3
  • 2 for UART to GPS module
  • SPI (4) + 1 = 5 for radio
  • SPI (3 reused + 1 CS) + 2 = 3 for magnetometer
  • SPI (reuse 3 + 1 CS) + 1 = 2 for Adafruit Micro SD SPI or SDIO Card Breakout
  • SPI (reuse 3 + 1 CS) + 1 = 2 for second SD card breakout
  • 2x2 = 4 for optical encoders
  • 1 for mode selection switch
  • 1 for mode selection LED
  • 1 for speaker
  • 1 for bump switch
  • 1 for motor power relay
  • 4 for motor driver

Total: 29

Uh-oh; there are only 26 usable GPIO pins on the Pico. We'll have to offload some of this to an IO expander. I have both an MCP23008 and an MCP23017 for that (I2C to 8 or 16 GPIO, respectively).

Raspberry Pi 3

  • 2 for UART to Pico

Total: 2

Remote Pico

  • 1 for dead-man's switch
  • 5 for radio
  • 2 for I2C to Nunchuck breakout board
  • 3 for indicator LEDs

Total: 11

Block Diagram

Diagram of systems and components

Rendered with GraphViz from docs/diagram.dot with:

dot -Tpng docs/diagram.dot > docs/diagram.png

About

Work toward RoboMagellan!

License:MIT License


Languages

Language:Python 100.0%