Aliens Motion tracker with video, sound and RADAR

The tracker body is the other worlds model that is floating around on the webs. The only thing I have done to it so far is make my own display housing, but there are some changes I would like to make to it when I have some time.

Either way, I'd still like to see everything together. Hopefully you'll post your finished replica here when you're all done.
 
Either way, I'd still like to see everything together. Hopefully you'll post your finished replica here when you're all done.

Will do, I got kind of sidetracked on the display and the body is not 100% done yet. There are some changes I think I will be making to the body so it will need a reprint anyway and there are some dodads that go on the tracker display body that are not on there right now - it is just a rectangle and it should have the detail stuff - I was thinking about redoing the top display body that should have the Vivitar Zoom Thyristor 2500 flash unit detail - printing (as in color laser printing) that scale thing as a transparency and putting a white led pointed upwards towards it from inside to backlight it, because - why not?
 
Great project! Love the way some of our members are pushing the bar for some of the props around here (y) (y) (y)
 
I just wanted to say thank you to all the people who left kind comments and suggestions, I really do appreciate it. I had no I idea what kind of reaction I would get to my project and all the kind words and enthusiasm has encouraged me to contiune to improve it and push it forward. Thank you!
 
Tracker hardware V2 - Alien Boogaloo

aliens_tracker_electronics_v2.jpg


1) Replaced the MEGA32U4 with a Teensy 4
2) Added MPU-9250 9-axis
3) Replaced low pass filter with MCP4725 DAC

Going from a 16MHz 8bit AVR to a 600 MHz 32bit Cortex-M7 makes a big difference in what you can do. The Teensy 4 has rip-your-face-off (Hah!) performance and enough memory for multiple frame buffers so the animation options just opened up a lot. It can never look exactly like the movie because it is a completely different technology but lots better than the old AVR. The only downside is increased current consumption - 100ma vs 40ma for the AVR but it is within the total power consumption range I originally had planned on and it should still run for at least an hour. The MPU and DAC are working so the easy part (the hardware) is over (for now) and it is all about software.
 
First tests of animation speed look good. The demo clip has jerkiness and a double image because I am running a weird frame rate (28hz) and it is not syncronized with the camera shutter. It is smooth as silk in real life.


Drawing the compass background takes about 1.2 milliseconds for 800 frames per second so I should be able to do the kind of animations I want. The limiting factor is the SPI bus speed and I think I can increase that and even if I can't, 25+ hz will be enough.
 
+1 on the Teens 4!


SOOO Much faster than the normal Arduino product lines right now
My previous projects were not very demanding, and the Arduino was always able to do the job very well. But it seems that I really should have a look at the Teensy 4...
 
First tests of animation speed look good. The demo clip has jerkiness and a double image because I am running a weird frame rate (28hz) and it is not syncronized with the camera shutter. It is smooth as silk in real life.


Drawing the compass background takes about 1.2 milliseconds for 800 frames per second so I should be able to do the kind of animations I want. The limiting factor is the SPI bus speed and I think I can increase that and even if I can't, 25+ hz will be enough.
This looks fantastic. What a difference. It's the first time thwt I see an Arduino-type project where the Arduino is clearly not good enough. Gotta get me one of those Teensy 4!
 
Arduino = 8/16 MHz (8bit)

Teensy4 = 600MHz (32bit)

HUGE difference is terms of microprocessors. :)

Pretty slick (open source?) lightsaber project based on the Teensy as well..
 
Animation issues on micros – the limitations and issues you can run into, or why is my display so slow?

Example hardware: ILI9341 (240x320) SPI display. This is a common display but the principles apply to other displays.

For every pixel we draw on the screen, it takes 2 bytes + overhead (more below on this). The data gets sent across SPI so the first question is what is our SPI bus speed? There is no set speed on SPI – it can be anything. What is the default SPI speed on “Arduino”? It depends on that particular micro-controller and what clock divider the spi library uses. On the ATMega series of chips the SPI clock is generated by dividing the system clock by 2, 4, 8, 16, etc. By default it uses the 4 divider so the SPI bus on a 16mhz mega is running at 4mhz unless you tell it otherwise. The maximum SPI bus speed on Mega is 8mhz (16mhz/2).

So, a 240x320 screen x16 bits is 1,228,800 bits – divide 8mhz by that and you get 6.51 full screen frames per second, except that you will not get that because there is overhead in the spi protocol and in the display driver so if you are really lucky that will only be about a 10% penalty and you will be limited to about 6 frames per second (with very little cpu time left to do much else).

There are many reasons why it is very unlikely that you will be able to really get 6FPS on mega – every time you do a draw command – it sends that data out the spi bus and every time it has (extra) overhead. If you could send the full screen in one shot the total overhead goes down, but you can’t send the whole screen because you don’t have enough ram to compose a whole screen and then send it. A lot of the libraries are far less than 100% efficient and you could easily lose 50% in library overhead. If you are using software SPI (any you might be and not know it) that is going to crush your speed more, etc, etc, etc...

Note that there are different situations for different Arduinos (like the Due) and what is happening/what you can do is different, this was just an example of a typical “Arduino” that many people are using.

The display area for the compass is 320x180x16bits = 921,600 bits – so on MEGA at 8mhz SPI the max fps you could get with 10% overhead is 8fps. But that won’t happen – there will be way more than 10% overhead in the real world and you would be lucky to get 5fps.

So, what is different about the Teensy 4? Default SPI bus speed of 30mhz and enough memory to have a frame buffer and the t3n library uses DMA to transfer that framebuffer. It takes 27 milliseconds to send that 320x180 area across SPI and complete the transaction. You need to add in the time it takes to compose that area because if you write to the framebuffer while it is sending you get glitches and tearing. So the final max frame rate is 1000 / (27 + render time). At 13ms render time you get a 25hz frame rate. At 5ms render time you get a 31hz frame rate. It is taking 1.2ms to render the compass so as long as I can keep the aliens render time down under 10ms I should be fine and 10ms at 600mhz is 6 million clock cycles so it should not be a problem and take far less than that. Of course now I have to actually write the software for the aliens...
 
Last edited:
Thank you for going into all these details. This is really helpful!

I am glad it was useful. I was not sure if anyone would be interested in the gory details of some of the issues involved in this project. When I look at projects people do some of the most useful and interesting stuff to me is hearing what went wrong and how did they fix it. I wrote some text on doing mixed 5v and 3.3v systems because it was an issue in this project but I decided not to post it because I thought it was too obscure and technical and nobody would be interested in it.
 
I am glad it was useful. I was not sure if anyone would be interested in the gory details of some of the issues involved in this project. When I look at projects people do some of the most useful and interesting stuff to me is hearing what went wrong and how did they fix it. I wrote some text on doing mixed 5v and 3.3v systems because it was an issue in this project but I decided not to post it because I thought it was too obscure and technical and nobody would be interested in it.
Don't assume that. There is always someone who has either dealt with this issue before - or will soon face it. I love hearing about the details, becoming aware of potential trouble and reading about ways to avoid it. That's what these forums are for!
 
Technical notes on mixed voltage issues in electronic projects.

For electronics people only – if you are not interested in electronics tech stuff stop reading now or you will regret it (and you might regret it even if you are into electronics). What follows is more of a general discussion about mixed voltages in electronics projects and some of the issues to be aware of with examples from the tracker electronics, skip this if you don’t care about electronics stuff but I thought it might be helpful because it is something that you have to be very careful about or you can destroy devices and there is a lot of confusion out there on this subject by many people.

It’s a 5v and 3.3v world. The vast majority of hobbyist micro-controllers and various boards you can connect to them will run at either 5v or 3.3v. In some cases you can directly connect 5v and 3.3v devices and they will work fine by just wiring them together and in other cases just wiring a 5v device to a 3.3v device will destroy the 3.3v device at worst or it just won’t work correctly at best. So what can you do and not do in 5v/3.3v mixed systems? Down the rabbit hole we go.

GOTCHA NOTE: of the boards I mention below, there are often different versions of these boards – so the exact board you have may be different and have different rules from the boards I have – YMMV – be careful. Example: MPU-9250 – the SparkFun IMU Breakout board for this chip has no on-board regulator and is a 3.3v only part but the 9250 board (not a sparkfun board) I am using does have a 5v regulator on it.

1) On-board regulators. Many of these little boards and micro-controllers say they are 5V but what is really happening is the device on the board is a 3.3v part and there is a voltage regulator on the board that takes the 5v power input and converts it to 3.3v to run the device. Sometimes these boards have a set of pads you can short that will bypass the regulator so you can run the board with a 3.3v power input (or you can just mod the board to short out the regulator if there is no provision on the board to do this). The device then communicates on a bus (I2C or SPI or whatever) or has an output that will never go above 3.3v, regardless of the input supply voltage to the board.

On-board regulator example: RCWL-0516 Radar – this device has a wide input voltage range (4v to 28v) and there is an on-board 3.3v regulator. There is a single output wire that goes up to max 3.3v. NOTE: this board will not run with a 3.3v supply and it needs 4+v power input to function correctly. If you wanted to run this board with a 3.3v power input you would need to modify the board to short out the 3.3v regulator.

2) No regulator. The device only runs at 5v or only runs at 3.3v or runs at any input voltage between two different voltages – for example 2v to 6v. If the board has no regulator and is a 3.3v only part – then you need to supply it with 3.3v, if it is a 5v only part then you need to supply it with 5v. If it is a variable voltage part then you would supply it with whatever voltage was within the range that it operates at and is compatible with the rest of your electronics.

No regulator example: MCP4725 DAC – there is no on-board regulator and this device will function correctly with a supply voltage between 2.7v and 5.5v so you could run it at either 5v or 3.3v.

So what happens when you mix 3.3v and 5v stuff? It depends and what “direction” they are connected and if the 3.3v device is 5v tolerant or not and what signaling method is used. “5V Tolerant” - means the device does not run at 5v (it might be powered by 5v and have a 3.3v regulator), but it will tolerate 5v INPUT signals and not be damaged. If you have a mixed 5v/3.3v system and ALL the 3.3v stuff is 5v tolerant then you are fine and nothing really bad will happen, you will not destroy any of the 3.3v parts by doing this.

For ONE WAY communications between 3.3v and 5v devices:

ONE WAY communications Scenario A) – device has 3.3v output and you directly connect it to a 5V input – this generally works fine and you will not damage anything by doing this. Note that 5v tolerance does not apply or mean anything in this case because 5v tolerance is about 3.3v INPUTS, not outputs and our output is 3.3v. The reason it works is because for a digital input a 5v device is not looking for a 5v signal to indicate a logic high – it is looking for the voltage on the line to be above a certain threshold to be logic high and 3.3v almost always works ok. For a dive into the basement of the rabbit hole – see this explanation: Logic Levels - learn.sparkfun.com An analog 3.3v output to a 5v ADC input – will not damage anything and will work correctly – but your ADC range will be limited because the upper 1.7v of the ADC range will always be missing and you just need to be aware of this.

ONE WAY communications Scenario B) device has 5v output and you directly connect it to a 3.3V input that is NOT 5v tolerant – DESTRUCTION of the 3.3v part or if you are lucky it just won’t work but not destroy the 3.3v part. Fix: use a voltage divider on the 5v output of 1.2K ohms and 1.8k ohms – this will limit the maximum voltage of this signal to 3v and our 3.3v part will not be damaged and generally it will work fine because we don’t need 3.3v to get a logic high on a 3.3v input - 3v is enough. 1.2k and 1.8k are standard values and the resistors will have a tolerance to them and the .3v lower than 3.3v volts is there to give us a margin of safety.

TWO WAY communications - one of our devices is 3.3v and the other is 5v and they both talk and listen on the same wire and the 3.3v device is not 5v tolerant – DESTRUCTION of the 3.3v part or if you are lucky it just wont work but not destroy the 3.3v part. Fix: use a bidirectional level shifter – except that you can get away with not using a level shifter for I2C and other buses that that are “open collector” or “open drain” - see this: I2C - learn.sparkfun.com

NOTE: there are oddball parts and boards out there that don’t quite match the above – YMMV.

My tracker is a mix of 5v and 3.3v and lipo stuff and voltages are something I have to consider carefully when designing and making any changes to the design. You certainly can mix 5v and 3.3v stuff successfully and I regularly do but if you are not careful and get it wrong bad things can happen. I know this was a lot of stuff but if you read this far then I assume this info applies to you and I hope this was helpful to someone who was unclear about how to do mixed voltage systems and some of the issues you will run into. This ended up being WAY longer than I thought – I started out thinking, hey there are a few issues and I will note those things but it just grew and grew as I started filling in all the little details and exceptions.
 
Have not had much time to work on the tracker, but it is comming along slowly. Here is an example of what the Teensy 4 can do:


It took 3.7ms to render all the spheres and it looks much better IRL than it does in pics or video. The SPI bus on the t4 tops out at 38mhz so you can get 30+ fps on a 240x320 screen. Something I had not considered is that the T4 has a FPU and I do a lot of float/double trig stuff and all you have to do to use the fpu is replace your cos/sin/sqrt/atan/etc with cosf/sinf... It just works and gives a nice speedup.
 
Have not had much time to work on the tracker, but it is comming along slowly. Here is an example of what the Teensy 4 can do:

It took 3.7ms to render all the spheres and it looks much better IRL than it does in pics or video. The SPI bus on the t4 tops out at 38mhz so you can get 30+ fps on a 240x320 screen. Something I had not considered is that the T4 has a FPU and I do a lot of float/double trig stuff and all you have to do to use the fpu is replace your cos/sin/sqrt/atan/etc with cosf/sinf... It just works and gives a nice speedup.

Wow! This looks incredibly good. And I continue to be very thankful for your detailed descriptions. Some day, I will have a project that requires a Teensy 4, and I have bookmarked this thread - as a starting point.
 
Back
Top