bitsy-ai / rpi-object-tracking

Object tracking tutorial using TensorFlow / TensorFlow Lite, Raspberry Pi, Pi Camera, and a Pimoroni Pan-Tilt Hat.
https://medium.com/@grepLeigh/real-time-object-tracking-with-tensorflow-raspberry-pi-and-pan-tilt-hat-2aeaef47e134
MIT License
178 stars 70 forks source link

Realtime tracking by using FOC driven BLDC motor #56

Open Martin2kid opened 3 years ago

Martin2kid commented 3 years ago

I'm using FOC controlled BLDC motor for Pan & Tilt position control with rpi-deep-pantilt & I'd like to share my setup with those who are looking for heavier payload setup, fluid like motion and absolute silence movement.

Video link is here; https://youtu.be/lWcEgcILRG8

Facial recognition, tracking & handling of occlusion seems extremely well handled by Leigh's rpi-deep-pantilt as it shows on this video, considering it's only driven by Pi4 & Coral USB @slow motor speed setting in motor controller and I'm really happy with this result so far.

However, as some of you aware #48 issue is still remaining that when the face goes out of FOV and soon after, it breaks pan & tilt tracking loop & does not resume tracking when the face is back in FOV and I could not figure this solution yet & sadly this appears beyond my capability for sure.

Additionally; PWM output control signal limits-- that it's maximum defined control angle is limited to 180 degree pan rotation; I'm hoping to see continuous 360 degree pan rotation angle, perhaps using SPI communication between Pi & magnetic sensor with SPI port--- understand PID reset comment or sugestion during cycle loop but I'm thinking it's only going to add more random jitter trouble.

Pi-cam & similar likes are appear to be very sensitive on background lighting changes and this contribute heavily on occlusion & produce random jitters and I'm hoping USB Webcam support is available for purpose of supporting auto exposure that is readily available for most of USB-Cams (Leigh covered this USB-Cam issue on speed but not on auto exposure consideration and I'm with her as to numerous product out there).

Usage of both software & hardware PID control method seems to be worked at the best as it doesn't oscillate nor jerky and it clearly shows on this video (I've tried with none PID control loop, Software only and Hardware only with Caffe model)

Hardware; Pi4 8 GB with 8-20-2020 OS release, clean install of rpi-deep-pantilt only over OS, Coral USB-3, 22 pole BLDC Gimbal-Motor GM5208-24, Simplebgc32 extended Gimbal motor controller with 2.7 firmware, AS5048A sensor with PWM connection, Arducam 5 MP Auto Focus camera in manual focus mode, DC 12 volt 10 amp power supply for motor controller, DC 5.5Volt 5 amp step down converter for Pi4 power supply, wireless QI charging cradle for cell-phone, cooling fan for Pi, 360 rotating slip-ring for pan axe.

Note; this motor & controller combination can handle typical DSLR camera & most of small to medium sized tablet PCs on the market and also provide up to 3 axis self-stabilization really well. Yet, IMU sensor's gyro drift issue still exist for static application such as desktop use. This combination is more useful to use with drones, vehicle or on boat moving application like with available GPS correction heading signal compensating gyro drift --main reason I'm moving over to ODrive implementation in my next experiment & waiting for my order arrival.

leigh-johnson commented 3 years ago

Hey @Martin2kid, I apologize for taking many months to get back to you on this! I scoped and experimented with automated calibration for this project, and the time exceeds what I'd be willing to donate to a free project.

I'd be open to consulting on this work with you though - please shoot me an email if you'd like to chat more. I think the work you're doing sounds interesting, and I'd love hear more about it. leigh@bitsy.ai