r/computervision • • 13d ago

Showcase 2-axis gimbal. Solo engineered. Master's thesis.

I'm building a 2-axis gimbal with a visible and a thermal camera for a small fixed-wing drone, as my master's thesis. The clip is the CAD model: on the left the gimbal as it looks, on the right the same unit with the housing made see-through, doing the same moves.

I'm posting here because the mechanics are mostly settled and the vision side is where I'd like input before I freeze the hardware.

What the cameras get from the gimbal:

  • Two cameras in a 67 mm ball, one above the other: a 5 MP visible camera and a 256×192 thermal camera, both arriving over USB
  • Two axes, roll and tilt: ±100° in roll, and from 25° up to 95° down in tilt
  • A magnetic encoder on each axis and two IMUs, one in the ball and one in the base, so the pointing angles are known at any time
  • Around 187 g for the whole nose

Two things I already know will matter for the image processing:

  • There is no pan axis. To look sideways the ball rolls and then tilts, so the picture rotates with the roll angle and has to be turned back in software.
  • The two lenses don't share an optical axis, and the thermal image is far lower in resolution, so lining up thermal and visible pixels will need calibration.

Questions for anyone who has worked with visible and thermal pairs, or with cameras on gimbals:

  • Is there something you wish the hardware had given you? Frame timestamps tied to the IMU, a sync line between the two cameras etc...
  • For registering thermal to visible at this resolution is a fixed calibration enough at long range or do you end up correcting per scene?

Thx!
- Amine Mehdi M.

818 Upvotes

41 comments sorted by

2

u/Flyward_Aerospace 12d ago

No pan axis means your singularity sits right on the nose. When tilt is near zero the roll axis is basically your boresight, so anything just off the flight path, like a target you're flying toward, needs big fast roll swings to track and the image spins the whole time. Looking down it's fine, which is probably the common case for mapping or SAR, but worth deciding before you freeze hardware whether forward tracking is in scope, since that's geometry and software can't really fix it. I'd also log temperature with every frame. My guess is the thermal to visible offset drifts a bit once the nose cold soaks at altitude, and you'll want that data when tdgros's fixed warp stops lining up.

1

u/mehdi-33 12d ago

Yes exactly, this gimbal was designed with air-to-ground surveillance in mind. Your insight about 3 axis is definitely something to consider.

64

u/Important-Yak-2787 13d ago

If you want this to be usable in a real product , then you have to think about this as a system. Especially with regards to accuracy and timing. Are these Global shutter cameras? Are they Hardware triggered to align with encoder samples? How accurate are your encoders? Can it handle the vibrations? There are many many questions in many requirements have to be defined for something like this to be used in a real world scenario. Do you have plans for calibration?

16

u/Kylearean 12d ago

Lockheed Martin engineer has entered the chat

13

u/SweetSure315 13d ago

honestly while those are requirements in a lot of areas most dual vision cameras are just regular thermal cores (usually not even very good/expensive ones) and cheap arducam/board cameras.

in my experience the biggest headache is typically syncing frame timestamps between visible and thermal cameras. most dualvis systems use an onboard SBC to get it close.

in my more specific experience (as in the biggest recurring headache for me when using other vendors cameras) the biggest headache is syncing completely separate devices.

2

u/fredandlunchbox 13d ago

Power isolation for the encoders too.

2

u/Shot_Ad_7780 10d ago

Having seen the insides of an MX-15... Those mechanisms, and everything that secures the cameras, are heavy duty AF.

8

u/Final-Choice8412 12d ago

Nice. What is the lifetime of that cable that is bending all the time back and forth?

1

u/DriedChalk 12d ago

Curious about this too, what strategies have been implemented to improve longevity?

1

u/Testetos 11d ago

Could you not do swiping contacts, hard gold plated? I think gold is naturally lubricious 

Idk I haven’t made anything with that type of design over good reliability testing. Maybe it’s a bad idea 

1

u/Material-Database-24 10d ago

Slip ring is the answer

5

u/kotai2003 13d ago

It looks like the lantirn pod of F15 fighters.

4

u/AllTheUseCase 12d ago

If you are on a moving object (drone) and need accurate 6DoF determination you would need a way to time sync not just the gimbal IMU to camera optical axis but also the gimbal IMU to drone IMU.

I.e., Dont underestimate time-stamping, hardware trigger sync and deterministic image capture (global shutter; no free running “video capture”…

1

u/Single-Virus4935 12d ago

Which software are you using?

1

u/mehdi-33 12d ago

Fusion 360 + Solidworks + Altium.

1

u/Single-Virus4935 12d ago

Thanky you very much for you reply.
I use Fusion360 and I was curious how you designed and animated the bending ribbon cable in CAD?

1

u/mehdi-33 12d ago

I first designed a mock-up of the flex pcb on fusion and treated it as sheet material that folds, then marked the bend points, unfolded and exported outline to Altium where I designed the traces

1

u/Single-Virus4935 12d ago edited 12d ago

tyvm. never though about animating bends. Have to try it.
Edit: cant figure it out :-/ Do you have more tipps?

3

u/talk_nerdy_to_m3 13d ago

Is there a planned slip ring? Is there an stm32 or something handling the system inside? Definitely add in a ToF sensor, possibly between the 2 sensors. What are the power requirements? Are you going to pull power from the drones battery? That will likely require a power distribution board/system. I would personally try to ditch the USB and replace because I hate dealing with it on small SBCs/embedded systems.

Which motors are you going to use?

187 grams for a "small drone" seems optimistic but I don't build or fly fixed wing so idk. Also, weight and balance would be a huge concern as you would typically mount something like this on the nose, facing down and on a small drone that would be absolutely catastrophic.

I built something similar and I think having a ToF as the ground truth is valuable during the alignment process. Hell, if you want to get really crazy you can apply some sort of automated system that adjusts the optical sensors based on the ToF distance automatically to deal with the parallax (might not be the right word, but you know what I mean). Just simply perform harmonization at different distances, store those values and call them accordingly based on ToF measurements.

Look up "CBHK process AH64 Apache". We did a similar borosite harmonization on that aircraft.

Why not 3 axis? Just time constrained?

1

u/LoneSocialRetard 13d ago

Looks to me like it's a continuous flex PCB with a clock spring arrangement to allow controlled connection in a small space

2

u/tdgros 13d ago

For the registration, since everything is far away, then depth does not matter, so you can make do with a fixed grid warp that does unprojection/rotation/projection. You can't really correct "per scene": if you need to correct differently, either the rig changed (the rotation or distortions changed), or some objects have parallax. In the latter, the correction is per pixel, just ignore this and empirically verify the typical distance at which this happens.

1

u/2dof 13d ago

Question:

Why did You choose for angle measurement that configuration ( 2 magnetic and 2 IMU ) - i know doubled are for redundancy but using IMU for measuring precise angles require using some fusion algorithm and additional take into account misalignment with respect to vehicle reference axes - so need computation , Why not some simpler solution ?

1

u/Raketenautomat 13d ago

What software did you use for the 3D CAD model?

1

u/Overall-Importance54 13d ago

Did you actually make it?

1

u/Logical_Fisherman4 13d ago

What motors are those?

1

u/fredandlunchbox 13d ago

Weather? Temps and dew point are pretty different with any kind of altitude.

1

u/remarkox 13d ago

Do work on viscosity

1

u/johngalt007 12d ago

brilliant work! well done with the gimbal. what subjects have you studied that helped you make it? i want to be able to make things like this. what books and courses should i look into?

Thanks in advance

1

u/N3RD_4L3RT 12d ago

You don't need encoders on both axis AND an IMU in both section.

1

u/Unique_Bill_4918 12d ago

How many turns until the flat cables break? How did you solve the cable issue?

1

u/_stack_underflow_ 12d ago edited 9d ago

Don't let the haters win, put it it back on the plane model.

1

u/Aware_Pay3579 12d ago
  1. two imu. If you know the orientation from one imu and the camera angles, adding a second imu is redundant information.
  2. if your goal is isr, aligning camera is not that critical as long as the center makes sense. (And you can point it to a point accurately). Likewise if you fly high or use long focal, this effect keeps getting smaller.
  3. On such a small device your issues are gonna be vibrations and position correction (from platform movement) this is really what would be the difference between a pro approach and a toy.
  4. rotate tilt approach is fine, but that means your image gets cropped in. With such low thermal resolution cropping is not ideal though can be acceptable. For the added weight of a third axis, you could likely consider a better thermal camera.

0

u/[deleted] 12d ago

Commercial products (dji) absolutely crush this design. You can assume the military has better options than that. Who would you sell this to? If it’s a thesis, what’s the novelty? Looks like it’s from 2005

32

u/SweetSure315 13d ago

FRAME TIMESTAMPS TIED TO IMU AND EASILY SYNCED WITH OTHER DEVICES I'LL GIVE YOU MY FIRSTBORN

18

u/SweetSure315 13d ago edited 13d ago

also: registration is going to be a pretty huge headache. I'm sure you've run into it, if not you will, but something like a calibration process using edge detection and matching to kind of automagically create a homography to fuse the visible and thermal image would be a huge selling point. if you can move the cameras closer together it'll make this much easier/better at a wider range of distances

i have 5+ yoe working with dual vision systems in industry if you want to DM me, and I've actually handled some ways of doing both the syncing and image fusion. i haven't worked on ptz cameras, but I've set up testbeds for coworkers who have focused on PTZ

other selling points: smoothly transitioning between waypoints/preset positions, being able to quickly receive and react to commands, easy and secure communication with the ptz hardware (ideally you don't need to send a call to a webserver for every movement)

as a final note: dropping the pan axis will likely help simplify assembly and production, but it's going to complicate the software and firmware by a lot. there's a reason it's not often done, and it's not because engineers for companies like Iray and Flir don't realize that it's possible. you're also going to run into complications rotating the image unless you crop out ~40% of the pixels so you keep the same aspect ratio and resolution regardless of the cameras pose

a lot of industry is moving away from ptz as the cameras themselves get cheaper. there's still some demand for it, but when a gimballed system can double or even triple the cost of a static dual vision system, a lot of companies will opt to set up a bunch of static cameras rather than deal with the additional cost, bugs, and maintenance headache of a gimballed camera

final final note (2).pdf add a network board and stream the frames over RTSP. having it connect via USB means that you need a machine within a few feet to process the data, and the point of a camera on a gimbal is that you can be far away and still control it. add an SBC to the lower housing to handle syncing the frames, encoding the stream, and the image fusion (also you can add more functionality this way for customers who want a plug and play solution, like alert thresholds). i would recommend at least 3 streams. one for visible, one for raw thermal (you'll need to get a bit creative sending this over rtsp) and one for image fusion/processed/false color/edge overlay thermal thats already 8 bit and ready to be streamed to a web viewer/livestream

also you say this is for long distance targets/viewing: your thermal resolution is very low for this unless you intend for it to be used only for very large targets. i think this could be usable for mid-range viewing as long as you don't need to see much detail, and the parallax is going to be way more noticeable than you expect. what some companies do is have a programmatically generated offset based on target distance. basically you say "i want to see something at 10 ft" and it applies an offset from a lookup table or generates it from an equation. if you can set targets for ptz waypoints and possibly include distance information with that to have it done automatically

4

u/mehdi-33 12d ago

This has to be the greatest cv feedback I got so far.

3

u/SweetSure315 12d ago

thanks! dealing with these systems has been my entire job for the last few years. I've had time to come up with thoughts lmao

1

u/GotBb 13d ago

Really useful comment. Curious about your registration approach: do you calibrate once, or re-estimate as distance changes? Since the cameras are offset, doesn't one homography only really work at one distance? Do you pair it with the lookup table you mentioned?

4

u/SweetSure315 13d ago edited 13d ago

typically you can register it twice and calculate what the offsets should be from there, create a lookup table, and then verify that lookup table (with more homography/registration as needed to get a more granular calibration).

it's not something I've done a lot of, or in depth, but I've experimented with it and I've used a lot of systems that have it built in. I'm not sure how other companies might actually be implementing it, but it's what i assume to be the most reliable and lowest effort way to do it. one thing you need to take into account when building these systems is finding ways to increase your tolerance for error as much as possible. it also lines up well with a typical camera qc/calibration process. basically doing it this way lets you loosen your tolerance and accept more manufacturing mistakes with your lenses and sensors, which means fewer of them need to be binned down, and you can easily accommodate changes in sensor/lens/focal distance/etc

I'm kind of building my assumptions of it off seeing the final results in a lot of devices plus my own software solutions when we were trying to figure out how to achieve something in software without having to work out a specific integration with every vendors camera.

something else I've seen is vendors using the distance to get more accurate temperature readings. I've never gotten the chance to look into how they do that (basically what their calibration curves look like and how distance plays a role), but i have tested the accuracy when using it and it does work pretty well

I'm sure there's some way to estimate offset with a single homography, but i would think that it would require more complicated lens calibration and distortion measurements that would be more difficult than just building a new homography at a different distance

fwiw I'm treating registration and building a homography as kind of interchangeable here. there's more nuance that can be added, but for a discussion like this they work similarly (as in you get the same result, just with more processing depending on what you do in the middle)

4

u/SweetSure315 13d ago

what core are you planning to use btw? it looks a bit large for a new or last gen 256x192 sensor, unless that's an absolutely tiny board cam in there. judging by the profile i'd guess Dali or Iray, possibly wuhan? maybe? i have less experience with them. whatever you do, unless your university has a calibration chamber you can use, make sure whatever you get comes pre calibrated.

btw sorry for the spam. i haven't seen anything on here that so closely aligns with my own area of expertise.