Mechanical design
This week I was in charge of project / spiral planning, setting up the CNC shield, setting the servo motors, video storyboarding, and documentation.
Group plan
Introverted Robot
Main parts:
- eyes (Spiral 2)
- wheels / driving components
- structure / base
- body - esp32 frame (Spiral 2)
Character traits (Spiral 1):
- moves away from you (but knows when it's stuck in a corner?)
- moving into other areas?
- eyes: watches you as you approach / look around (Spiral 3)
- moves on servos
- eyes: hides when you get too close (Spiral 2)
- LEDs that convey mood (Spiral 2)
Character traits (Spiral 3):
- doesn't like sound
- shakes
- snores when being left alone
- wheels: lock when you get too close
Sensors:
- distance (microwave / tof) (Spiral 1)
- sound [Spiral 3]
- light [Spiral 3]
Output:
- servos (eyes / top closing) (Spiral 3)
- dc (wheels)
- steppers?
- LEDs (mood) (Spiral 2)
Communication:
- I2C
- esp-now
- what MCUs are we using?
Power:
???
Other:
- Sensor input communicated to eyes (3) and wheels
- Moods -- LEDs / shakes (which scenarios)
- approaching too quickly (orange)
- stuck in a corner (red)
- happy (green)
Bill of Materials:
- MCUs (what kinds)
- sensors
Spiral 1:
- decide on base size
- build base (designed to have the ESP32 body attach to it)
- build wheel system
- test sensors and get them to communicate with environment / wheels
- power (with plan for more power consumption)
- document / take videos
- consider movie ideas
- prep spiral 2 designs
Spiral 2:
- create the eyes (servos)
- eye box
- make the ESP32 body
- connected LEDs
- work on making Spiral 1 more efficient / debug
- document / take videos
- movie compiling
Roles:
Irja - wheel and base assembly / body design and compilation / eye lights
Patrick - wheel, base and eye assembly / sensor holders
Dylan - CNC shield set up / servo set up / eye box assembly
Sam - wheel programming / sensor code / protocol management / multiplexer
Sensor considerations
- Doppler
- microwave and millimeter wave radiation
- can detect through solid nonmetal surfaces
- millimeter can detect you even when you stop moving
Initially, I thought maybe I could try to design a TOF sensor, as we didn't have enough readily available. It was unsuccessful.
Microwave radar RCWL-0516
This video is from 7 years ago, but he runs useful test to understand the sensor: Radar Sensors / Switches: Comparison and Tests.
This sensor module utilizes an RCWL-9196 chip that helps repeat triggers and a 360-degree detection area with no blind spot. It can recognize motion via walls and other materials and have a susceptibility range of 7 meters.
The specifications of the sensor is as follows:
- Input Voltage – 4V to 28V
- Operating current – 3mA (max.)
- Operating frequency – 3.2GHz
- Transmission power – 30mW (max.)
- Regulated output voltage – 3.3V, max. 100mA
- Sensing distance – 5 to 7 meters
Neil's example board:
Power Supply: Connect the VIN pin to a power source between 4V and 28V, and connect the GND pin to the ground of the power source.
Output Connection: Connect the OUT pin to the digital input of a microcontroller or to the base of a transistor if you're driving a load.
Sensor Disable (Optional): The CDS pin can be connected to a photoresistor and resistor to form a voltage divider. This can disable the sensor when it is bright, saving energy during the day.
I used the code that I found in the Crikit tutorial.
// RCWL-0516 Motion Sensor Example Code
#define SENSOR_PIN D6 // Connect the OUT pin of the sensor to digital pin 2
void setup() {
pinMode(SENSOR_PIN, INPUT);
Serial.begin(9600);
}
void loop() {
int sensorValue = digitalRead(SENSOR_PIN);
if (sensorValue == HIGH) {
// Motion detected
Serial.println("Motion!");
// Add your code here to handle the motion detection event
} else {
Serial.println("All good, homie");
}
delay(100); // Delay to prevent overwhelming the serial output
}
Stepper driver
I considered making my own step stick. But that was going to be too time costly / risky. If future me does decide to go for it, here's a great resource I found from a past student: this.
When I decided to use a CNC shield, this resource was very helpful. I dubbed him the CNC Shield YouTube champion!
BOM:
- 3 x Red "Made in China" A4988 step sticks
- 1 x DRV8825 step stick
- 1 x CNC Shield
- 1 x Ardunio Uno
One of the A4988s was missing a bulk input capacitor. Located near the motor power supply (VMOT) and ground, its main purpose is to filter voltage spikes and provide stable power to the driver.
Capacitor C3 (Rep Rap has a very useful Wiki on using stepsticks):
The RepRap StepStick BOM explicitly lists the big SMD capacitor as 4.7 µF, 1206 package, 16 V.
I was able to get two wheels with two step sticks turn well, but there was trouble when I added a third.
I tested each step stick one by one. Note: The DRV8825's current limit is set differently than the other three that we used.
The current drawn by each step stick turned out to be different. The red stepsticks were around 0.2A, the DRV8825 was double that. I adjusted the current limit and that fixed the issue.
NB. You can adjust the current (and track it's amp reading) by turning the potentiometer while it's powered!
Max Current limit of the stepper motors: 1.7A
70% of max = 1.2A
Pololu DRV8825 current limit equation:
At 1.2A max:
VREF = CL/2
VREF = 1.2/2 = 0.6
Made in China A4988:
VREF = I_TripMax * 8 * Rs
VREF = 0.96 = 1.2 * 8 * 0.1
Rs (sensing resistors) = 0.1
NB. The sensing resistor value is different on the Pololu and Made in China step sticks. Rep Rap have good documentation on this.
At 1.5A current limit
DRV8825 VREF: 1.5/2 = 0.75
A4988 VREF: 1.5 * 8 * 0.1 = 1.2
NB. The A4988 stepsticks can't go higher than a 1.5 Vref.
To get the fourth stepper moving, there is a certain four pins that need bridging. Find that here.
Servos (Eyes)
DUTY RATIO (20ms Duty cycle) - the servo expects to see a pulse every 20ms and the width of that pulse determines the position.
We made some structural adjustments to the eye box and started programming the eye movement sequences.
Here's some basic code on getting the eyes to move up and down + side to side.
NB. It's important to make sure that the servos are set to their midpoints before attaching the back of the box to the rest of the unit.
Video storyboard
Story board bullet points:
- Montage of everyone grabbing a XIAO board for their project
- People saying XIAO
- News article clippings
- Dizzy editing
- XIAO needs a drink
- It needs to get from A to B (bar)
- Zoom into perspective of the Robot -- bar in the distance
- Video zoom out from XIAO on the floor at april feest - shot from the 2nd floor of Waag
- Film interaction of the XIAO trying to get to the bar
- Later that night... a bit drunk... LAUNCH IT OFF THE STAIRS