2017-03-12 20:56:19 +01:00
|
|
|
+++
|
2017-03-12 21:10:19 +01:00
|
|
|
date = 2014-11-02T00:00:00+00:00
|
2017-03-12 20:56:19 +01:00
|
|
|
title = "Citizen"
|
2017-03-12 22:04:30 +01:00
|
|
|
summary = "A balancing robot written in Go and running on ARM Linux."
|
2017-03-12 21:40:00 +01:00
|
|
|
tags = ["machines"]
|
2017-03-12 20:56:19 +01:00
|
|
|
+++
|
2017-03-12 22:04:30 +01:00
|
|
|
A balancing robot written in Go and running on ARM Linux.
|
2017-03-12 20:46:14 +01:00
|
|
|
|
2017-03-12 20:56:19 +01:00
|
|
|
## Mod list
|
|
|
|
|
2017-03-12 20:46:14 +01:00
|
|
|
Changes to make:
|
|
|
|
|
2017-03-12 20:56:19 +01:00
|
|
|
- Move the gyro down between the wheels. Reduces the acceleration seen
|
|
|
|
due to falling.
|
|
|
|
|
|
|
|
## Other robots
|
2017-03-12 20:46:14 +01:00
|
|
|
|
|
|
|
There's a ton out there.
|
|
|
|
|
2017-03-12 20:56:19 +01:00
|
|
|
- lil-bot uses the same motors (MG-6-48) but with encoders. 7xAA so
|
|
|
|
8.4 V to 10.5 V. 100 Hz control loop. MPU-6050 with 2 %
|
|
|
|
complementary filter. Has a err\*\*2 term as well.
|
2017-03-12 20:46:14 +01:00
|
|
|
|
2017-03-12 20:56:19 +01:00
|
|
|
## v1
|
2017-03-12 20:46:14 +01:00
|
|
|
|
2017-03-12 20:56:19 +01:00
|
|
|
v1 can balance but poorly. The big differences were:
|
|
|
|
|
|
|
|
- Better pitch measurement through a complementary filter. Gives the
|
|
|
|
absolutes of the accelerometers and noise rejection of the gyros.
|
|
|
|
- Integral control to respond quicker to small offsets.
|
2017-03-12 20:46:14 +01:00
|
|
|
|
|
|
|
Things I also changed:
|
|
|
|
|
2017-03-12 20:56:19 +01:00
|
|
|
- PWM rate up to 10 kHz
|
|
|
|
- Control loop up to 100 Hz
|
|
|
|
- Gyro bias removal. The gyro had a 0.34 deg/s bias.
|
2017-03-12 20:46:14 +01:00
|
|
|
|
|
|
|
Things to check:
|
|
|
|
|
2017-03-12 20:56:19 +01:00
|
|
|
- The gyro scale might be wrong and might be over reporting the angle.
|
|
|
|
- The deadband on the motors is quite bad and is probably hurting the
|
|
|
|
small tilt response. I might be able to kick the motors to start
|
|
|
|
things turning then return to the demanded speed.
|
|
|
|
- Is the gyro saturating?
|
|
|
|
- I2C speed
|
|
|
|
- Add voltage compensation?
|
|
|
|
|
|
|
|
## v0
|
2017-03-12 20:46:14 +01:00
|
|
|
|
2017-03-12 20:56:19 +01:00
|
|
|
v0 is done but doesn't really work. Issues:
|
2017-03-12 20:46:14 +01:00
|
|
|
|
2017-03-12 20:56:19 +01:00
|
|
|
- The motors have a high deadband and are too high speed.
|
|
|
|
- The pitch is based off the accelerometers only and seems very noisy.
|
|
|
|
- The motors are independant, so at low drive sometimes one will start
|
|
|
|
and the other stay still.
|
2017-03-12 20:46:14 +01:00
|
|
|
|
|
|
|
Next steps:
|
|
|
|
|
2017-03-12 20:56:19 +01:00
|
|
|
- Measure the CPU load
|
|
|
|
- Measure the pitch while standing upright and steady
|
|
|
|
- Investigate complementry filters to combine the gyro and
|
|
|
|
accelerometers
|
|
|
|
- Investigate the IMUs advanced features to see if it already gives a
|
|
|
|
good pitch
|
|
|
|
- Profile the motors to see if I can lower the deadband (dither?)
|
|
|
|
- Check I2C rate is 100 kHz or higher.
|
2017-03-12 20:46:14 +01:00
|
|
|
|
|
|
|
Notes:
|
|
|
|
|
2017-03-12 20:56:19 +01:00
|
|
|
- The 20 ms timer fires at ~16 ms and ~24 ms. HZ is 128. Turn on TCB
|
|
|
|
as a clock source, switch to low latency, switch to tickless.
|
|
|
|
|
|
|
|
- IMU has:
|
|
|
|
|
|
|
|
- DLPF, a low pass filter. Use to filter accelerometers?
|
|
|
|
|
|
|
|
- Default accelerometer range is +-2G (as the default reading is
|
|
|
|
~16000)
|
|
|
|
|
|
|
|
-
|
|
|
|
|