OpenMV H7 - Inverted Pendulum + ESP32s transmission + CRC

OpenMV related project discussion.
MatthewJBailey
Posts: 1
Joined: Sun Nov 10, 2019 3:49 am

OpenMV H7 - Inverted Pendulum + ESP32s transmission + CRC

Postby MatthewJBailey » Sun Nov 10, 2019 3:59 am

First of all, this is an awesome company and I'm glad I heard about it. Can't wait to try many cool and interesting projects with my new camera.

I'm trying to build an embedded controls system that stabilizes an Inverted Pendulum. At first I was considering using an IMU (which I have) and a couple rotary encoders; however, the encoders won't fit on my design so I've stumbled across a MV solution product that you guys have made.

There are 4 state variables in the inverted pendulum Equations of Motion. The x position, x velocity, theta deviation from vertical, and theta velocity (angular velocity).

I'm trying to decide the best way to use your H7 camera to provide accurate data to my cortex-M4 device that also satisfies the Nyquist Sampling rate. I believe 10 Hz of response is good enough, but I'd like to shoot for at least 20 Hz.

Would adding a saturated color section to the top of the pendulum and bottom be enough to determine the angle and x positioning? How far away should I place my camera for my system? The pendulum itself is maybe an inch wide and 8 inches tall (+- an inch). Without any knowledge of Kalman filters (for the time being), I can only rely on the raw data to actuate my system.

Would it be better to do gray scale color tracking and add an IR beacon on the top of the pendulum? I'm unsure how I could add an IR beacon to my wheel since it will be spinning, however.

Best regards.

Edit: So I'm thinking about using two ESP32s modules to transmit from the camera to my microcontroller. The modules I'm purchasing are found here (https://www.amazon.com/MELIFE-Developme ... 163&sr=8-3). It appears as though it has both SPI and UART integration. I've downloaded the three datasheets for the H7 camera and I can't find anything on peripheral control registers. I'd like to plan out how I'm going to integrate my communication protocol prior to receiving my module, do you have anywhere you can point me for this information? Furthermore, with this data transmission scheme, I'd like to generate part of my frame such that it has CRC (Cyclic Redundancy Check), is there any peripheral I can use to calculate this information on your microcontroller prior to sending my packet? I realize there is the underlying ARM processor and uC, and I am sure it has CRC. I would greatly appreciate any information you can point me towards for figuring these things out. Thanks again!
User avatar
kwagyeman
Posts: 3448
Joined: Sun May 24, 2015 2:10 pm

Re: OpenMV H7 - Inverted Pendulum + ESP32s transmission + CRC

Postby kwagyeman » Sun Nov 10, 2019 10:49 am

Hi, thanks for the kind words.

For placement, you have to buy the system and decide yourself. I can't tell you that.

For color, just use a saturated color patch. That will do what you need. Green is the best to key off of.

For sending data. The board control is in python. See our documentation and the PYB module. You can easily send UART or SPI bus data.

The board is fully programmable in python, so, for the crc you just write it by hand and operate on byte data. There is a crc calculation register in hardware but you'd have to be sending data at the MB/s data rate for that to make any sense to use.

To send byte structs you just use the ustruct module and you pack structs with data. For an example, when you download the IDE see our MAVLINK examples.
Nyamekye,

Return to “Project Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests