Skip to content

11 Monaco Control System

Björn Giesler edited this page Nov 17, 2024 · 4 revisions

Stealthy Dual 15-axis Remotes

The Monaco Control System (the Bavarian Builders' Remotes) form a full RC system for controlling many droids. Both remotes have 15 "axes" each (in RC speak), made up by the following:

  • 2 analog joystick axes at 10 bit resolution
  • 3 orientation axes from the internal IMU (pitch, heading, roll) at 10 bit resolution
  • 3 acceleration axes from the internal IMU (X, Y, Z) at 8 bit resolution
  • 4 buttons on the periphery of the remote (left, right, index, pinky)
  • 1 clickable joystick button
  • Right remote: 2 analog potentiometers at 8 bit resolution
  • Left remote: 1 endless analog potentiometer, 1 parameter axis in the menu at 8 bit resolution.

As an added bonus the right remote has three extra buttons on top. On the left remote these buttons are used for controlling the menu system, but can be switched to be reported as regular remote buttons on long-press of the "Confirm" button.

Each remote has two RGB LEDs for status, and the left remote has a 160x80 pixel OLED display for status and menu-based parametrization.

The remotes emit either XBee or ESPnow (coming soon), the protocol is explained here and the necessary code definitions are here. Internally the remotes work at 100Hz cycle frequency for IMU and button updates, while control packets are emitted at 25Hz.

Both remotes can be used together or separately, with the controlled droid being the judge of what to do with the control signals coming from the left and right remote respectively. The left remote is needed for pairing, parameter setting, loading / storing configurations etc. because the display is required to do this, but once set up, the right remote can be used on its own.

Left Remote Right Remote

Usage

IMU Coordinate System

The remotes employ a right-hand coordinate system, with X pointing to the right, Y to the front, and Z up. Angles are represented in Euler angles in Pitch, Roll, Heading order, i.e. rotation about X, then about Y, then about Z. Pitch is positive when the remote is tilted downward at the front, roll is positive when the remote is tilted downward at the left, and heading is positive when the remote is tilted counterclockwise. We try to constantly use the wording of Heading instead of Yaw because its abbreviation, H, cannot be confused with the axis Y.

Visualizations

Status LED Coding

The Status LED (left on the left remote, right on the right remote) show the individual remote's status:

  • White during startup.
  • Green if all required subsystems are started and all necessary inputs are available.
  • Yellow if something failed, but some basic performance can still be guaranteed (this is not clearly defined but e.g. you can probably rely on the joystick and pots working, and the failed component might be the IMU).
  • Red if a necessary system component is not working as expected and not even degraded performance can be guaranteed.
  • Blue in calibration mode.

Comm LED Coding

The Inner LEDs are the right LED on the left remote, and the left LED on the right remote. These visualize communication - because they "point at each other" if you have the remotes next to each other, they show what's going on between the remotes, and towards the droid. Blinking follows a pattern of three, each followed by a short "off" period:

Left Remote:

  1. Status of communication to droid: green if droid is known and packet was sent, blue if droid is not known.
  2. Status of communication from right remote: cyan if packet received from right remote, blank if no packet received in this cycle, magenta if problem in recent reception (e.g. out of sequence, packet drop).
  3. Status of communication from droid: white if packet received from droid, blank if no packet received in this cycle, red if problem in a recent reception (e.g. out of sequence, packet drop).

Right Remote:

  1. Status of communication to droid: green if droid is known and packet was sent, blue if droid is not known.
  2. Status of communication to left remote: cyan if left remote is known and packet was sent, magenta if problem in recent reception (e.g. out of sequence, packet drop)
  3. Status of communication from droid: blank (the droid doesn't send to the right remote).

So in a fully paired 2-remote-and-droid threesome with no problems you should see the right LED on the left remote cycle green-cyan-white and the left LED on the right remote cycle green-cyan-blank. Watch out for reds, those mean that there is some interference somewhere.

Menu System

Pairing

Joystick Calibration

Calibration of the two analog joysticks can be either triggered using the menu system (Settings -> Calib Joy -> Left / Right) or by holding down the joystick button while powering up any remote. On the left remote, the display and the RGB LEDs will guide you through the calibration process, while on the right remote the RGB LEDs will do the same. Here is the procedure:

  1. Both LEDs blue: Release the joystick and don't touch or move it until the LEDs blink twice
  2. Left LED off, right LED purple: Move the joystick to the rightmost position and hold it until the right LED blinks twice
  3. Left LED purple, right LED off: Move the joystick to the leftmost position and hold it until the left LED blinks twice
  4. Both LEDs purple: Move the joystick to the topmost position and hold it until both LEDs blink twice
  5. Both LEDs blue: Move the joystick to the bottom-most position and hold it until right LED blink twice in green.
  6. Calibration is done!

If at any point both LEDs blink red, there was an error calibrating. Please restart the procedure by turning the remote off and on again holding the joystick button.

You can check the status of the calibration in the joystick view in the display, which outputs both a graphical view and absolute numbers. These should be (0, 0) at the center and +1.0 or -1.0 at the extremes. If they are not, please recalibrate.

Storing / Using Multiple Configurations

XBee vs ESPnow Protocol

Flashing / Software Update

Flashing the Remote

What you need

  • Bottom board from the remote
  • USB-C cable
  • esptool for uploading, or PlatformIO for building and uploading

Flashing procedure

  1. Plug the USB-C cable into your computer but not into the ESP32 yet.
  2. Press and hold the tiny button labeled B on the ESP32, it's to the right of the USB-C connector. While holding B, connect the USB-C cable to the board.
  3. As soon as the cable is connected, you can let go of B. We're in Boot / Flash mode now.
  4. Upload the software.
  5. Press and release the tiny button labeled R on the ESP32, it's to the left of the USB-C connector.

Flashing the Display

What you need

  • Top board from the remote, disconnected and separate
  • USB to Serial converter with +5V, GND, TX, and RX connectors
  • Pin header compatible cable
  • esptool for uploading, or PlatformIO for building and uploading

WARNING: NEVER EVER EVER EVER EVER TRY TO FLASH THE DISPLAY WHEN CONNECTED TO THE MAIN REMOTE BOARD!!!

The Remote runs at 3.3V, supplied by the battery / charging circuit in the ESP32 processor. This is in spec for the LiPo battery used (which goes up to some 4.xV when fully charged) and for all components except the Display, which nominally needs 5V to run. With the stabilized 3.3V from the Remote main board, the display runs fine even though it's out of spec. However we have found that flashing it with a 3.3V USB to serial converter does not work reliably or not at all, you need a 5V capable converter. If you plug this in while the top board is connected to the main board of the remote, it will fry both the ESP32 and the XBee board. So always disconnect! (Note - putting a protection diode in was discussed, but diodes drop voltage and the display wouldn't get the 3.3V it needs to run, so that is not an option unfortunately.)

Flashing Procedure

  1. If you haven't soldered a pin header onto your top board, do so now. Use a 90° angled 4-pin header, and solder it on so it sticks out on the underside of the board, i.e. the one facing the bottom board.
  2. Connect the pins from your USB to Serial converter to the 4 pins on your top board. 5V and GND go in directly; RX/TX need to be reversed - i.e. connect your converter's RX to the board's TX and vice versa.
  3. Connect your USB to Serial converter to your computer. The display should light up with the logo. If it doesn't, disconnect immediately!
  4. Open a Serial Monitor of your choice (e.g. Arduino's), set it to 921600bps, and send a newline. The logo should disappear, you should get a black screen, and the Serial Monitor should show OK. If the display does not blank, disconnect from your computer, reverse RX/TX connections, and try again. If the display does go blank but you don't get an OK message (but instead get nothing or some garbled output), please double check the bps rate of your terminal.
  5. Now tell your Arduino IDE to upload. At some point towards the end, you should see a message saying Connecting...
  6. Press and hold the button labeled BT on the underside of the board, then press and release the button labeled RST. This should cause the flashing process to begin. You can release BT now.