Registration Notice

Due to increased spam, forum registration must be manually approved by a moderator! Please see this post for instructions.

*

Offline LukeZ

  • 1026
    • View Profile
  • Kansas
Re: Standalone Tank IR
« Reply #15 on: November 14, 2020, 12:05:19 PM »
I’m wondering if there may have been changes made to the Arduino IDE which somehow altered the manner in which the code compiles.  It may be hard to see in the screenshot- I am using version 1.8.13 of the Arduino IDE.
I started thinking the same thing after I posted earlier. Since you haven't changed anything else, the only difference must be the IDE. I am using 1.8.5 which is actually prior to 1.8.13.

I've posted below a compiled version of the code from my IDE which only uses 71% of dynamic memory, and I changed the IR type to IR_TAMIYA_35. Can you give this one a test and see if it works? You can flash a hex file to your UNO using OP Config, on the Firmware tab select "Generic ATmega328" and then click the "Use your own Hex" button to select this file, then the "Flash" button to write it to your Arduino.
*
TankIR_Tamiya1-35.hex
(66.73 kB ~ Downloads: 4)
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline CodeWarrior

  • 15
    • View Profile
  • Detroit suburb, Michigan, USA
Re: Standalone Tank IR
« Reply #16 on: November 16, 2020, 08:45:39 AM »
Luke- Success!  Using your code, without my Arduino IDE compiler in between, did the job!  I was able to both transmit and receive IR shells to and from my 1/35 Panther.  The flash effect for the hit LED was very nice.  Well done!  BTW- I checked for a reply yesterday from you but did not realize that our thread had reached a second page.  My bad.  I must report that I was not successful in using OP Config to upload the .hex code (screen snip attached).  Maybe that's the subject for another post once I thoroughly worked through OP Config to see what I might have done wrong.   Apparently I have bad luck everywhere with these things.  I used the process which was described here https://forum.arduino.cc/index.php?topic=410618.0 with success (one exception: ensure the file path has no blank characters in it.)
     I have downloaded Arduino IDE 1.8.5 and will try it to see how things work with it.  I will report back with the results.  IDE 1.8.5 is many generations before 1.8.13, sequential numbering being the way that it is.  I'm just curious why you do not use the latest releases, other than the fact that it apparently breaks good, working code?
CodeWarrior_OPConfig-03.jpg
Standalone Tank IR CodeWarrior_OPConfig-03.jpg
Views: 50
There are 10 kinds of people:  Those who understand binary and those who don't.

*

Offline CodeWarrior

  • 15
    • View Profile
  • Detroit suburb, Michigan, USA
Re: Standalone Tank IR
« Reply #17 on: November 16, 2020, 03:41:59 PM »
     I tried compiling the code using the Arduino 1.8.5 IDE, not installed using windows installer but just as a desktop client on my main laptop (I'll call it laptop A).  This yielded the same results as compiling with 1.8.13- TankIR is not able to register hits from the Panther.  The compiler output stated:

"Sketch uses 25014 bytes (77%) of program storage space. Maximum is 32256 bytes.
Global variables use 1864 bytes (91%) of dynamic memory, leaving 184 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur."

     The only remaining differences that I can think of are the files which are included as part of the compile process which are not directly provided by GitHub.  There are only two of these:

#include <Arduino.h>
#include <avr/interrupt.h>

    Of these I suspect that it may be the interrupt.h file which is causing me the problem.  I went ahead and did a Windows installation on another machine (laptop B) after having deleted the existing 1.8.13 installation and all folders related to the Arduino IDE.  I used another machine as I didn't want to disrupt the other Arduino work I had going on laptop A- although not currently working on.  No joy.  It is clear to me that there is something wrong with my IDE, or at the very least different, between my Arduino IDE installation and yours.  Let me know if you have any thoughts as I would really like to be able to tailor the TankIR code to suit my needs.  On the other hand I fully understand if time does not permit you to offer much more help.  You’ve helped me immensely already.  I suspect that others have tried TankIR with more success than I.  Can you tell me if you know of other users which have had success with it?
There are 10 kinds of people:  Those who understand binary and those who don't.

*

Offline LukeZ

  • 1026
    • View Profile
  • Kansas
Re: Standalone Tank IR
« Reply #18 on: November 18, 2020, 11:33:24 AM »
Hi CodeWarrior - thanks for reporting back, it seems you have pinpointed where the problem must lie, and that is something to do with a difference between my IDE and yours.

You asked why I didn't use the most recent IDE for development, but probably several years ago when I posted the TankIR project 1.8.5 was about the most recent. But they release new versions all the time, and quite frequently code that worked on one version won't even compile on a later version, or have other issues as you have discovered, so if I get something working I rarely have much of an incentive to go back and break it.

But the strange thing this time is that you've tried IDE 1.8.5 and it doesn't seem to have made a difference as to how much memory the sketch takes when compiled (for you at least). I would be curious to see a file from your computer, it is called "platform.txt" and should be located here:
YourArduinoInstallDirectory\hardware\arduino\avr\platform.txt

If you could post that text file here I will take a look at it, and see if it matches mine in terms of Link Time Optimization (LTO) settings.

You asked if anyone else had used this project - WibblyWobbly at RC Tank Warfare is the one who has had the most experience with it, he has a thread here which you may have already seen.

I can also do some testing on my end and try to install the latest IDE and tinker around and see what I can discover. Ideally we would like to get this to compile in a functional manner with the latest version, now we know there is a problem.

Unfortunately at the present moment I am in the midst of moving across the globe and I won't be to my new place until next week, but then there is Thanksgiving, so I can't promise I'll have time to look at this in more depth until after the holiday.

However I haven't forgotten about this and I would like to get it sorted just for my own peace of mind, so I will definitely return to this topic when the dust has cleared.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline CodeWarrior

  • 15
    • View Profile
  • Detroit suburb, Michigan, USA
Re: Standalone Tank IR
« Reply #19 on: November 18, 2020, 12:26:21 PM »
Luke-   I have attached the platform.txt files for both my 1.8.13 and 1.8.5 IDE's.  Your logic on staying with the proven IDE is sound. 
     You are correct in thinking that I had seen WibblyWobbly’s comments on RC Tank Warfare.  I am known as CodeWarrior there as well.  I seem to recall some discussion about the type of sound card being used.  I tend to like  the Adafruit ‘board- it’s simple and convenient if not a bit more expensive than some of the other offerings.   I will write in to the RC Tank Warfare forum to determine how ‘Wibbly went about with his implementation.  I have had this feeling that there are only a handful of people interested in making a standalone battle unit and your input somewhat confirms these suspicions.  To my way of thinking it’s entirely logical that a solo battle unit might be a reasonable alternative when one can’t get a group of RC tankers together.  Ultimately I would like to cooperatively design a challenging solo battle system- but I’m not sure there is sufficient interest in this.
     It sounds like you're going to be rather busy for the next few weeks.  Moving is never any fun.  I wish you the best of luck with that extremely disruptive event.  Hopefully there will be some RC tankers in your new location. 
    I appreciate any input you can give me.  I’ll be looking forward to hearing from you later and will post any insights I may get here in the meanwhile.
platform-1-8-13.txt
(7.53 kB ~ Downloads: 5)
platform-1-8-5.txt
(7.43 kB ~ Downloads: 5)
There are 10 kinds of people:  Those who understand binary and those who don't.

*

Offline CodeWarrior

  • 15
    • View Profile
  • Detroit suburb, Michigan, USA
Re: Standalone Tank IR
« Reply #20 on: November 23, 2020, 12:34:15 PM »
Luke-  I hope all is going well with your move. 
      I am happy to inform you that I am now able to compile the TankIR sketch with it working on both sending and receiving IR shells (screenshot attached to unnecessarily provide proof).  I went ahead and uninstalled the Arduino IDE on my other laptop (laptop B) and reinstalled it letting it choose the install directory and use all default settings.  The compiler reported:

“Sketch uses 24284 bytes (75%) of program storage space. Maximum is 32256 bytes.
Global variables use 1462 bytes (71%) of dynamic memory, leaving 586 bytes for local variables. Maximum is 2048 bytes.”

     The net result of all of this is:  TankIR needs to compile on Arduino IDE 1.8.5 with the installation being done using all default settings.  I'm thinking that there were enough changes made to the compiler between 1.8.5 and 1.8.13 that the memory usage became much greater and the resulting low memory disallows properly registering a (Tamiya 1/35th) IR shell hit.

     My next step is to get a complete system working with the Adafruit FX in place and move it to a hand wired protoboard.  Assuming all goes well I will consider making a home-etched, or possibly a fabbed,  PCB to fit the Arduino form factor.  I’m thinking that others may take more of an interest in having a stand-alone battle unit if something were available off the shelf.  Even then, if something was available off the shelf I’m guessing there would not be a huge demand.  Let me know your thoughts once you’ve settled in from your move.  In the meanwhile I’ll contact ‘Wibbly to see if he, or anyone else, has used the stand-alone unit. 
      Once again thank you so much for your kindness, help and patience in getting me set up on TankIR.  Looking forward to hearing from you.
CodeWarrior_TankIR_success-01.png
Standalone Tank IR CodeWarrior_TankIR_success-01.png
Views: 28
There are 10 kinds of people:  Those who understand binary and those who don't.

*

Offline JPS99

  • 35
    • View Profile
  • Beautiful Erie, PA
Re: Standalone Tank IR
« Reply #21 on: November 25, 2020, 06:38:44 AM »
Hello, new bloke here!

I designed my own Arduino powered tank battle system a while back, great to see this project!    I did a cut down version like this specific part to run a Panzerturm...  This runs a servo for a random time, fires the cannon then rests for a reload period and starts again.   Adds an interesting feature to the battleground!    I have also designed my own tank sound system which works pretty well.

Here's a video of the Panzerturm during dev....

https://www.youtube.com/watch?v=LaTYOzBSGUo

Drew.

Sounds like you've done some interesting work. I'm always interested in seeing other people's projects and how they do things. There are so many different ways to solve a problem these days with Arduino! 

I'm building a T-35a which has a lot of turrets. I had thought of doing something to randomize motion on some of the turrets. With five to play with, it would be cool to see them all in action.

If you would care to share more photos or videos of what you have done, I'm always interested in viewing!
Cheers,
Joe
RETIRED!
Don't Want To
Don't Need To
Can't Make Me!!!

*

Offline CodeWarrior

  • 15
    • View Profile
  • Detroit suburb, Michigan, USA
Re: Standalone Tank IR
« Reply #22 on: November 26, 2020, 08:38:14 AM »
Joe-   I’ll start out by apologizing for the length of this post but it’s nice to relate to others with similar interests.
      Yes, I’ve been following your progress on the T-35.  It’s a very impressive effort.  I have also done a Panther PanzerTurm design from probably 10 years ago or so. 
     I have included several pictures of my past efforts.  I really enjoy designing things of all kinds- both electrical and mechanical.  My work on IR tank designs started about 20 years ago but tapered off significantly about 10 years ago.  We all know the story here: Very little time for fun when the time demands of the job became significantly greater.  Arduino was not generally known then and my designs were based on the Microchip PIC parts.  Since discovering Arduinos, and the huge amount of open-source designs out there, things have become much more easily done.  3D printers have also been a boon to us experimenters.  I have included pictures of my earlier designs, except for the PanzerTurm as I’ll have to dig that out.  They include:
  • A 1/35 tank platform with dual motors and collision detection.  PCB was acid etched and is dated from November of 2002.
  • 3D printed leaf spring system experiment
  • A hand held IR receiver/transmitter which my tanker buddies found useful for verifying that their tanks were transmitting and receiving IR shells.  It would also send out 10 IR shells quickly to kill a tank, effectively resetting it for the next battle (Tamiya 1/16 system only).  This board was machined using a CNC machine set up to fab PCB’s.
    I’ve also have about a half-dozen motorized platforms, including a DF Robot Devastator , a Zumo 32u4 Robot and several hand-built ones I don’t have pictures of right now.
    I’m currently working on designing an IR battle system for solo (or multi-person) battles.  Luke’s TankIR is an extremely nice piece of work but I’m also nearly done with a design which will transmit and receive Tamiya 1/35 IR shells based on an ATTiny85, about the size of a grown man's thumbnail.  Idea is to use several of these to try and sense where an incoming IR round came from and move towards it, with an autonomous platform,  or at least aim at that area with a static platform.  Of course, I’ve been working this for nearly 20 years now, so we’ll see how it goes.
      If I were to get something which worked I would like to make it available to others.  I doubt there’s any money to be made at it, and I’m not looking to do that.   I’m just looking to have fun making a design that others may find useful. It would also be nice to potentially further the interest in IR tanks.
     I’m always looking for any others who may be interested in collaborating on such a design.
     As an aside- I also worked on a system for measuring RC car lap-timing based on IR signals as I occasionally run some RC cars.
     Please continue to keep us updated on your T-35 build- it looks to be a truly great effort and I admire your tenacity and vision to see it through to completion.
IMG_1825.JPG
Standalone Tank IR IMG_1825.JPG
Views: 39
IMG_1830.JPG
Standalone Tank IR IMG_1830.JPG
Views: 38
IMG_1649.JPG
Standalone Tank IR IMG_1649.JPG
Views: 38
IMG_1841-Adj.jpg
Standalone Tank IR IMG_1841-Adj.jpg
Views: 3
« Last Edit: November 26, 2020, 09:11:14 AM by CodeWarrior »
There are 10 kinds of people:  Those who understand binary and those who don't.

*

Offline JPS99

  • 35
    • View Profile
  • Beautiful Erie, PA
Re: Standalone Tank IR
« Reply #23 on: November 27, 2020, 09:57:38 AM »
Hi CodeWarrior, thanks for the response.  I see you live outside of Detroit. Funny, we just moved from Ann Arbor to Erie, PA two years ago to retire.  I bought my Ender 5 at that time and learned 3D printing. My first big project was my 1/10 scale Tatra 815. You might have seen it on my Youtube channel.  Before I was even finished with it I became enthralled with Lubos Hort's  Is-1 tank which I came across on Thingiverse, and began printing it.  Both models were 1/10 scale and radio controlled. I also built TheDIYGuy999's ESP32 sound/light/motion control board for those models, as well as his 2.4ghz transmitter and micro receiver.  I really like the ESP32 boards and will also incorporate one into the 1/14 scale King Hauler I am building now.  (I know, too many projects, but Hey, I'm retired!) 

I dabble in electronics projects, but am not a designer.  There are so many great projects on the net that I'd be silly to try to design my own at this age. My focus is weakening, perhaps because I have so many projects going.  My wife bought me a keyboard for Christmas, so now I am learning to play the piano as well.  Retirement is tiring!

You mentioned PIC projects.. I recall working with Microchip's Basic Stamp. That was fun.. I was able to code in Basic, but never got into other languages unfortunately.  The only project that I've thought of lately, since I've gotten into RC modelling, is some kind of 'Convoy System'.  I will have two tanks and my Tatra and thought it would be cool if I could somehow be able to make one vehicle follow another and mimic its movements. This would open the way to some interesting video opportunities.  I have to do everything alone, so it is tough to get a nice action shot of my tank in motion, let alone two of them.  I see some interesting projects on Youtube, etc where guys have build ' RC travel cams' that ride along on a suspended cable and take video while moving along beside the subject of the video.  That looked like a fun way to capture shots.   I also have a nice little camera drone that I plan to use to capture video as well.  I also set up my iS-1 tank control system with a 'cruise control' so that I can set a speed and then set the transmitter down so I can take video. Looks like we're running out of weather for this year's outdoor fun though.

Anyway, enough foolishness from me.
Have a great Thanksgiving!
regards,
Joe
RETIRED!
Don't Want To
Don't Need To
Can't Make Me!!!

*

Offline CodeWarrior

  • 15
    • View Profile
  • Detroit suburb, Michigan, USA
Re: Standalone Tank IR
« Reply #24 on: November 27, 2020, 02:12:12 PM »
Joe-  Your 1/10th scale Tatra is an impressive build.  It sounds like you enjoy the creative process, both from the electrical and mechanical standpoints.  I’d be curious to know your impressions Ender 5-  I have a SeeMeCNC's Rostock MAX which has fallen into disuse as the computer which I had attached to it crashed.  That would likely be a topic for another forum somewhere else. 
       I’ll have to check out DIYGuy999’s projects- I appreciate your mentioning it.  I like the ESP’s: They are very powerful ‘boards, in a small size at an excellent price. 
    I fight with having too many projects going on at once.  I’m striving to see things all the way to completion.  I too am retired and find that, since my life doesn’t revolve around work, I have much more time to get things done which I enjoy.
     Your convoy idea is intriguing and I believe it could be doable with the proper implementation.  I don’t know that the following tank could exactly mimic the lead tanks movement so much as follow it, at least with the way I could imagine designing the electronics.  I’m thinking that a photovore system, or perhaps IR-based system might work.
     From my side I got what is probably the more difficult part of the ATTiny85 battle system working.  It is now able to successfully fire an IR round at my Tamiya 1/35th Panther and have it cause damage.  I've included a .zip file of the video I shot of the circuit in action and also included some pictures of the breadboarded circuit.  I cannot say “Thanks” enough to Luke for his help.  Although the code for the ATTiny85 doesn’t include any code from the TankIR implementation it was Lukes sharing his knowledge of the Tamiya 1/35th IR protocol which made it possible. 
      I’m still a relative newb as far as forum etiquette goes.  I’m thinking this ATTiny project should perhaps be moved to it’s own topic, if it even belongs on OpenPanzer at all as it’s not an OpenPanzer offering.  I’d welcome a  response from anyone reading this who may provide some enlightenment to me.

Eric
IMG_0965.JPG
Standalone Tank IR IMG_0965.JPG
Views: 4
*
Video_of_ATtiny85_In_action.zip
(8542.71 kB ~ Downloads: 2)
« Last Edit: November 29, 2020, 06:33:56 AM by CodeWarrior »
There are 10 kinds of people:  Those who understand binary and those who don't.

*

Offline LukeZ

  • 1026
    • View Profile
  • Kansas
Re: Standalone Tank IR
« Reply #25 on: November 30, 2020, 12:28:48 PM »
Luke-   I have attached the platform.txt files for both my 1.8.13 and 1.8.5 IDE's.
Hi Eric, I'm back but still in the process of digging out from the backlog of emails and stuff at my job, so I have not gotten much work done but I can at least respond to your posts! I checked out the two platform files you posted and I really don't see any differences in the relevant sections, but it was worth the check.

I am happy to inform you that I am now able to compile the TankIR sketch with it working on both sending and receiving IR shells (screenshot attached to unnecessarily provide proof).  I went ahead and uninstalled the Arduino IDE on my other laptop (laptop B) and reinstalled it letting it choose the install directory and use all default settings.  The compiler reported:

“Sketch uses 24284 bytes (75%) of program storage space. Maximum is 32256 bytes.
Global variables use 1462 bytes (71%) of dynamic memory, leaving 586 bytes for local variables. Maximum is 2048 bytes.”

The net result of all of this is:  TankIR needs to compile on Arduino IDE 1.8.5 with the installation being done using all default settings.  I'm thinking that there were enough changes made to the compiler between 1.8.5 and 1.8.13 that the memory usage became much greater and the resulting low memory disallows properly registering a (Tamiya 1/35th) IR shell hit.
This is good news and thanks for being persistent. However there definitely is something weird going on because the same code should really compile to roughly the same size and in this case the difference between IDEs is not even close. I will need to do some more research and probably post a help request over at the Arduino forums, but I really would like to get to the bottom of this. Whenever I do, I will report back here what I find.

From my side I got what is probably the more difficult part of the ATTiny85 battle system working.  It is now able to successfully fire an IR round at my Tamiya 1/35th Panther and have it cause damage.  I've included a .zip file of the video I shot of the circuit in action and also included some pictures of the breadboarded circuit.  I cannot say “Thanks” enough to Luke for his help.  Although the code for the ATTiny85 doesn’t include any code from the TankIR implementation it was Lukes sharing his knowledge of the Tamiya 1/35th IR protocol which made it possible. 

I’m still a relative newb as far as forum etiquette goes.  I’m thinking this ATTiny project should perhaps be moved to it’s own topic, if it even belongs on OpenPanzer at all as it’s not an OpenPanzer offering.  I’d welcome a  response from anyone reading this who may provide some enlightenment to me.
Your ATtiny85 project is very interesting and I'm happy for you to talk about it here. This forum section we're in right now is called "Other Open Source Projects" and that was exactly the intention, to give a place for people to talk about their own creations. If you want to share more details about it then I agree a dedicated thread in this same subforum would be a good idea, since no one will think to look for it in this thread. But you are not breaking any etiquette rules and I welcome your contribution!
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline CodeWarrior

  • 15
    • View Profile
  • Detroit suburb, Michigan, USA
Re: Standalone Tank IR
« Reply #26 on: November 30, 2020, 02:31:12 PM »
Hi Eric, I'm back but still in the process of digging out from the backlog of emails and stuff at my job, so I have not gotten much work done but I can at least respond to your posts! I checked out the two platform files you posted and I really don't see any differences in the relevant sections, but it was worth the check.
Luke-  Glad to hear that your move is complete, I suppose that now the settling will begin.  Thanks for taking the time to check out the files.

...there definitely is something weird going on because the same code should really compile to roughly the same size and in this case the difference between IDEs is not even close. I will need to do some more research and probably post a help request over at the Arduino forums, but I really would like to get to the bottom of this. Whenever I do, I will report back here what I find.
I appreciate your checking into the issue.  I would like to understand what's happening as well.  It would be most convenient to be able to use just one IDE on one machine.

...then I agree a dedicated thread in this same subforum would be a good idea, ...
Very good.  Once I make more progress on the ATtiny85 project, and have something more meaningful to report, I'll start a separate thread for it. 

     I must admit, having the public scrutiny (from all of the perhaps three people who may be reading these posts) forces me a bit to deliver on my ideas.  This could be a good thing.



There are 10 kinds of people:  Those who understand binary and those who don't.

*

Offline JPS99

  • 35
    • View Profile
  • Beautiful Erie, PA
Re: Standalone Tank IR
« Reply #27 on: November 30, 2020, 07:39:18 PM »
Joe-  Your 1/10th scale Tatra is an impressive build.  It sounds like you enjoy the creative process, both from the electrical and mechanical standpoints.  I’d be curious to know your impressions Ender 5- 
Eric

Eric, Thanks, the Tatra was my first big project, probably took 400+ print hours. it is mechanically cool, but it's really fragile. I started my IS-1 tank because it looked a lot more robust (it is) but in preparation for building it I bought a second Creality Ender 5 because I had such reliable results with my first one.

As for TheDIYGuy999, he really supports his projects, he's up to version 5.6 on his ESP32 Sound/Light/Motion control board and just introduced and SMD version (minus the ESP32 module) which saves space. He designed it for his Tamiya King Hauler but has expanded and upgraded it and made it useful for almost anything that moves now including tanks, balancing robots, etc.  The inertia models he's built into the motion control are really impressive and the motor sound is quite configurable for a wide range of vehicle sounds. He even incorporated one I captured for my IS-1!    I also built his 2.4ghz transmitter and micro receiver because it looked fun and got me into SMD soldering. They are pretty cool and the receiver even incorporates a low power motor driver which he's used on some small scale model cars.

As for my convoy idea, my thinking is that the vehicle(s) following would maintain a set distance behind the leader and would make turns with  a time delay commensurate with the following distance and speed so that they would follow the same path (within reason) although I have no idea how to accomplish this.

I watched your video, that is very cool. The Tiny85 is a neat little device. I have a little scope something like yours.. they are pretty handy for rc troubleshooting!

Yes, Luke is super helpful, the board runs on his shoulders.  From what I've seen he is always helpful and is a pretty savvy guy when it comes to electronics and tank control systems.

So what part of Detroit are you in?  I lived in Milan, just outside of AA until Christmas 2018.

Take care,
Joe
RETIRED!
Don't Want To
Don't Need To
Can't Make Me!!!

 

bomber-explosion