More power

I've moved on to a multi-ratio gearbox which consists of 2 plastic L-Shape brackets with some appropriately spaced holes in them. It comes with a motor, but I've replaced it with an MM28, which has several times the torque and power. This means using a configuration not really anything like the manufacturer intended. I'm not sure the plastic is quite up to the job, and the geometry leaves me with a few problems. I'm already considering building my own brackets out of aluminium. That would be a good use of my drill press, finally.

Anyway, I think I should figure out a prototype using the off the shelf parts for now, so plastic will do.

I've wired all this together, and adjusted the software, because the board is oriented differently. The result is erratic, to say the least. So I've updated my software, so that it aggregates statistics from the balancer loop, and writes them to a serial port. I've connected a serial bluetooth adapter to that, so I can have remote telemetry. The user button now enables and disables the motors, too.

I've written a script which works out the baud rate of a hc-06 attached to a serial adapter, and then configures it for this project, setting a name, PIN, and baud rate, and found in the process that I can go up to much higher data rates than I realised. The other script finds the bluetooth device using the name, and pretty prints the telemetry.

I discovered that in the meantime, I've accidentally used one of the pins for the SPI port that connects to the gyro, so the gyro had stopped working. That certainly explains it being erratic. Leant a bit more about the gyro, which is documented in the code, so I guess not a complete waste of time.

There's a general problem with the timing: I don't really know how much bandwidth the PWM of the motor has. As it's set up now, I only want to change the value at most every 10ms, but the gyro gives a result every 1.3ms, and that's when I'm updating the output. I need to decouple from this timing.

The gyroscope has a 32 sample fifo, which can easily bridge that gap: I could read all the new values every 10ms, with plenty of time to spare.

Popular posts from this blog

3D Printer ramblings

Balance Bot V2

FLSUN Q5