Open Panzer

Developer's Forum => TCB Dev => Topic started by: Heclo on July 09, 2020, 07:38:56 AM

Title: Heclo TCB Shield for Mega2560 Boards
Post by: Heclo on July 09, 2020, 07:38:56 AM
Hello everyone!

I have been following the Open Panzer project for a while and in my education as a electronics technician I made a "shield" that fit on an arduino mega 2560 R3 board, with most of the functions of the Open Panzer TCB and the Open Panzer sound card onboard, plus some extras.

Instead of the L298 motor driver as the onboard drivers I have opted for 2 x VNH5050 chips which are similar to those found on the OP Scout ESC, but in a smaller package. They can draw 30A each and therefore should be adaquete to most aplications. I have also added 2 additional H-bridges to power the turret elevation and traverse motors, they can draw 3A each.

The high-current drivers have current monitoring which I have implemented into the TCB code so that throttle commands corrosponds to engine wattage instead of a PWM setting, this makes simulating a models scale power a lot easier, resulting in realistic slow down when going uphill or through rough terrain.

All in all this makes Open Panzer a stand-alone board with all the necessary components onboard (except for a radio recaiver I suppose).

It has been tested in so far 6 different tanks with great results.
 
I have attached the schematics and a pinout rendering for those interested.

 
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Heclo on July 10, 2020, 02:42:55 AM
I could however use some help making some additions to the OP config, to implement some of the changes I have made, a little better.
In order to use 2 sets of onboard motor drivers I have had to "hi-jack" the code of one of the selectable ESC's, I chose the Sabertooth, but it would be neat to have an actual parameter that was called "Build-in driver (Motor C)" and "Build-in driver (Motor D)" or something like that.

I have also made some exspansions to the Forces of Valor IR library, defining ammo types with different armor penetration, and on the receiving end definitions of armor thickness (I'm also working on a directional IR receiver, making side and rear shots a possibility, with a higher chance to penetrate as a result). This is also something I wish to have implemented in the menues.

I know I am asking a lot, but I really wish to keep this project alive and we are a 1/16 rc tank club with about 20 members testing my creations out and the enthusiasm is high.

Best regards Kim Olsen Panzer Club Denmark.
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on July 12, 2020, 09:08:47 AM
Hello Kim! Your design is extremely impressive and interesting. Thank you for sharing! It is very educational to see the design choices you have made and the components you have chosen, I think a lot can be learned from this design. I see you have changed some of the pins in order to manage the onboard main motor drivers, it looks like you had to sacrifice PWM on the Hit Notify and Aux outputs? 

I may be willing to make some changes to OP Config on your behalf but it is something I will want to think about and I may not do it right away. Of course it would benefit you and your club but the extra options in the documentation will only confuse all the hundreds of other people who already have a TCB, so I have to weigh these things carefully.

In the meantime it would be great if you could make your project open source, including the firmware for the Arduino Mega, and board files and bill of materials for your shield. This could be hosted on GitHub. If you are able you can make a fork of the TCB firmware with your changes on your own GitHub, or if you prefer you can provide me the source code and I can fork it myself and host it on the Open Panzer GitHub page.

You may be interested to know that in fact all the functions could be simplified onto the Teensy 3.2 alone, eliminating the need for the 2560 altogether. In other words, we can combine both the sound card ability and all the rest of the TCB functions onto just the Teensy, including onboard main motor drivers as you have done, so that in the end we have a complete single board product. The 3.2 has barely just enough pins if we use some shift registers! I have started writing code for this but it is not yet complete and I don't know when I will have the time to finish it. I haven't even started on a board design. I am not spending much time in development this year due to other commitments, but if the project were to be revived someday I think that would be the way to do it. But for now it is just an idea.
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Heclo on July 14, 2020, 03:02:34 AM
Hello Kim! Your design is extremely impressive and interesting. Thank you for sharing! It is very educational to see the design choices you have made and the components you have chosen, I think a lot can be learned from this design. I see you have changed some of the pins in order to manage the onboard main motor drivers, it looks like you had to sacrifice PWM on the Hit Notify and Aux outputs? 

I may be willing to make some changes to OP Config on your behalf but it is something I will want to think about and I may not do it right away. Of course it would benefit you and your club but the extra options in the documentation will only confuse all the hundreds of other people who already have a TCB, so I have to weigh these things carefully.

In the meantime it would be great if you could make your project open source, including the firmware for the Arduino Mega, and board files and bill of materials for your shield. This could be hosted on GitHub. If you are able you can make a fork of the TCB firmware with your changes on your own GitHub, or if you prefer you can provide me the source code and I can fork it myself and host it on the Open Panzer GitHub page.

You may be interested to know that in fact all the functions could be simplified onto the Teensy 3.2 alone, eliminating the need for the 2560 altogether. In other words, we can combine both the sound card ability and all the rest of the TCB functions onto just the Teensy, including onboard main motor drivers as you have done, so that in the end we have a complete single board product. The 3.2 has barely just enough pins if we use some shift registers! I have started writing code for this but it is not yet complete and I don't know when I will have the time to finish it. I haven't even started on a board design. I am not spending much time in development this year due to other commitments, but if the project were to be revived someday I think that would be the way to do it. But for now it is just an idea.

Thank you for the praise  :) Yes I needed an extra timer for the motor C and D PWM, not really sacrificed as such, they can still be PWM controlled they are just running at a different frequency XD.

Yes this should perhaps be an entire new branch of OP, to differentiate it. I do not intent to make things harder for the rest of the OP userbase. I will work on putting my designs on GitHub and make a fork on the firmware (I should probably comment a bit more in my code "gulp") I think i prefer it to be on the Open Panzer GitHub page, I think it will reach more people this way.

Yeah in my research I also considered going with Teensy alone (4.0 specifically) but due to time constraints before my exam, I stuck to the current setup. As an after thought, I considered the teensy 4.1 because of the plethora of outputs. STM32 F4 and F7 series would also be interesting. Many posibilities, a lot of coding required :D
I would be delighted to help you with the board design if you want on that teensy branch ;)

In my Frankenstein Leopard 2 I went to exam with I used the teensy 4.0 and an external DAC for the sound card (16bit sound is awesome!) that's what the EXT_DAC port on my design is for, a PCM5102 based module (https://www.aliexpress.com/item/4000049720221.html?spm=a2g0o.productlist.0.0.19a17bb7f7qosr&algo_pvid=54a8d466-0d2c-4d1d-8361-ee18f669e5dd&algo_expid=54a8d466-0d2c-4d1d-8361-ee18f669e5dd-0&btsid=0ab6f82315947131670277434e6470&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_)

Cheers Kim
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Heclo on July 15, 2020, 08:18:46 AM
Here are the schematics for my latest build, it is drawn in KiCad (free open source)
I have attached a zip with the compiled gerber files aswell.

I will post the custom code later.

Cheers!
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on July 16, 2020, 12:06:25 PM
Thanks for the Gerbers, I took a look at them in KiCad. You have done a professional layout job, I am impressed. You said you used this project for an exam, are you an engineering student? I think you deserve a good grade, I hope you get one!

I look forward to inspecting your firmware and I will be happy to host it on the OP GitHub, it should be possible to make you a contributor so you can maintain that repository. It also should not be a problem to add an entry to OP Config Firmware tab so users can select your firmware for download/flashing.

As you say, with all the microcontroller advancements constantly being made there are now many tantalizing possibilities, but people who possess time and skill are necessary to realize them, and in so far as there is no great financial reward for doing this work, these must also be special people who have other motivations (educational achievements appears to be a good one!)

Thank you for the offer to help with board layout, I will keep it in mind and let you know if I can get the design to the layout stage.
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: JPS99 on August 14, 2020, 07:19:50 PM
Hello everyone!

I have been following the Open Panzer project for a while and in my education as a electronics technician I made a "shield" that fit on an arduino mega 2560 R3 board, with most of the functions of the Open Panzer TCB and the Open Panzer sound card onboard, plus some extras.
......
It has been tested in so far 6 different tanks with great results.
 
I have attached the schematics and a pinout rendering for those interested.

Wow, this is very interesting! I am currently building a tank and am looking for a control board. Having the control and sound integrated into one package is quite appealing.

Do you have a BOM (bill of materials) prepared that you could share?  Is there a site (perhaps Youtube or ??) where I could see some of your tanks in operation?

I'm building a T-35a and it will need a control board.Definitely interested!
Cheers,
Joe in Pennsylvania USA
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Heclo on August 17, 2020, 06:49:19 AM

Wow, this is very interesting! I am currently building a tank and am looking for a control board. Having the control and sound integrated into one package is quite appealing.

Do you have a BOM (bill of materials) prepared that you could share?  Is there a site (perhaps Youtube or ??) where I could see some of your tanks in operation?

I'm building a T-35a and it will need a control board.Definitely interested!
Cheers,
Joe in Pennsylvania USA

Thank you! Sounds interesting ;) If you download KiCad (freeware) you can open the project schematic and generate a BOM from that.
The schematic and layout will also be a great help if you decide to build it.

I am working on commenting the code alterrations/additions I have made, so that they will be comprehensible to others than myself  ::) ;D

Best regards Kim
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Heclo on August 18, 2020, 05:39:14 AM
Thanks for the Gerbers, I took a look at them in KiCad. You have done a professional layout job, I am impressed. You said you used this project for an exam, are you an engineering student? I think you deserve a good grade, I hope you get one!

I look forward to inspecting your firmware and I will be happy to host it on the OP GitHub, it should be possible to make you a contributor so you can maintain that repository. It also should not be a problem to add an entry to OP Config Firmware tab so users can select your firmware for download/flashing.

As you say, with all the microcontroller advancements constantly being made there are now many tantalizing possibilities, but people who possess time and skill are necessary to realize them, and in so far as there is no great financial reward for doing this work, these must also be special people who have other motivations (educational achievements appears to be a good one!)

Thank you for the offer to help with board layout, I will keep it in mind and let you know if I can get the design to the layout stage.


As promised: the modified code for my version of the TCB, with comments  :D

Just ask if there is something I havn't explained properly ;)

I am still learning so there might be some odd solutions in there XD

The modifications are in:

OpenPanzerTCB.ino
Objectsetup.ino
LVC.ino
OP_Driver.cpp
OP_Driver.h
OP_Motors.cpp
OP_Settings.h

and an addition in form of:

Status.ino
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: JPS99 on August 18, 2020, 04:29:31 PM
Thanks very much HECLO. Now that the code is posted I will order the PCBs.  I have two tanks that will need your board. One is built already (my IS-1) and I'm working on a second tank, a T-35.

I appreciate your efforts to design this board and software and thank you for being generous enough to share it with us on the forum!
Regards,
Joe
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Heclo on August 19, 2020, 08:11:57 AM
Thanks very much HECLO. Now that the code is posted I will order the PCBs.  I have two tanks that will need your board. One is built already (my IS-1) and I'm working on a second tank, a T-35.

I appreciate your efforts to design this board and software and thank you for being generous enough to share it with us on the forum!
Regards,
Joe

Glad to hear that you can use it! I have some notes on the BOM:

U7 The teensy controller, *this is only relevant if using an  external DAC (https://www.aliexpress.com/item/4000049720221.html?spm=a2g0s.9042311.0.0.27424c4dOxqjyI)*: if using 3.2 = remove pin 7, 20 and 21. If using 4.0 = remove pin 9, 22 and 23. The incentive to use an external DAC is to get 16bit sound instead of 12bit, which only matters if your audio files, and speaker are top notch.

U9 I use the 7805 as a placeholder in reality i use these  DC-DC converters (https://www.aliexpress.com/item/32869678893.html?spm=a2g0s.9042311.0.0.27424c4dOxqjyI) for efficiency

U10 INA181 needs to be the A3 version with a gain of 100

Q2 can be any N-Channel MOSFET in a SOT-23 package with the same pinout and a continous current of 1A or more.

Input_jmp1 if using the onboard Teensy DAC, jumper pin 2 and 3.

VNH5050A (the main motor drivers) are truly a PITA to solder. I check every solder for continuity and shorts on these chips.

I wish you the best of luck ;)

Cheers Kim


Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on August 19, 2020, 02:15:48 PM
Hi Kim, thanks for posting the firmware. I am in the middle of moving right now so I have not yet had time to look at it. Next week when I get settled into my new place I will try to set aside some time and get it posted to GitHub.
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Heclo on August 20, 2020, 01:12:37 AM
Hi Kim, thanks for posting the firmware. I am in the middle of moving right now so I have not yet had time to look at it. Next week when I get settled into my new place I will try to set aside some time and get it posted to GitHub.

No rush good sir ;) I am just glad you want to give it a look!

Cheers Kim
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: JPS99 on August 20, 2020, 08:27:50 PM
Hi Kim, I'm trying to put together a BOM spreadsheet, but when I view your Kicad schematic there appear to be holes in it. (please see attachment)

The schematic appears complete in the PDF version you uploaded, but some of the values are overwritten by other components and the values or names can not be read.

Is there a problem with the uploaded schematic you posted above, or is this a configuration setting in my installation of Kicad. Sorry, I don't know how to use that Ecad software, so maybe I just don't have it set up correctly.

Regards,
Joe
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Heclo on August 21, 2020, 06:49:32 AM
Hi Kim, I'm trying to put together a BOM spreadsheet, but when I view your Kicad schematic there appear to be holes in it. (please see attachment)

The schematic appears complete in the PDF version you uploaded, but some of the values are overwritten by other components and the values or names can not be read.

Is there a problem with the uploaded schematic you posted above, or is this a configuration setting in my installation of Kicad. Sorry, I don't know how to use that Ecad software, so maybe I just don't have it set up correctly.

Regards,
Joe


I have attached the project folder with all of the dependencies. Just unzip the entire folder and open the project file, that should solve it.  ;)

Cheers
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: JPS99 on August 21, 2020, 09:06:37 AM
Thanks Kim, that did the trick!
Have a great weekend.
Regards,
Joe
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: JPS99 on August 21, 2020, 09:57:07 PM
Kim,  I have my boards ordered so will start working on getting the components. Thanks for the updated info, it will help a lot!
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: JPS99 on August 23, 2020, 04:09:33 PM
Hi Kim, what is NT1 - Net_Tie_2 on the PCB?  I'm working on a Bill of Materials with part numbers and prices for Digikey electronics here in the USA which I can post, when complete, if there is any interest.

Cheers,
Joe
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: JPS99 on August 24, 2020, 06:55:53 PM
I received my TCB Hat boards thanks to Kim's files. Can't believe how quickly they came from JLCPCB! 
I ordered them August 19 and they arrived here on the 24th!
Now I really have to get busy with my parts order as the bare boards sitting here will slowly drive me crazy.

Thanks again to Kim (HECLO) for his work in designing these boards.
Cheers,
Joe
Title: Re: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Heclo on August 26, 2020, 01:31:28 AM
Hi Kim, what is NT1 - Net_Tie_2 on the PCB?  I'm working on a Bill of Materials with part numbers and prices for Digikey electronics here in the USA which I can post, when complete, if there is any interest.

Cheers,
Joe

Hi Joe,

The net tie is just where the different ground planes join at the board, it's not a component  ;)

JLCPCB are super fast! They are my go to PCB maker aswell  :)

Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: LukeZ on September 01, 2020, 12:46:29 PM
Hi Guys,

You will notice I have moved the posts about the Heclo shield here, to this new thread which we can dedicate to the project, keeping it separate from other discussions.

Kim, I am working on getting your files posted to GitHub and making some changes to OP Config so it will be better integrated. I will let you know when it is ready to review.

Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: LukeZ on September 03, 2020, 10:11:16 AM
Hi Kim,

I've posted your firmware and files to the Downloads page (http://www.openpanzer.org/downloads) and also created a GitHub repository: TCB-Heclo-Shield (https://github.com/OpenPanzerProject/TCB-Heclo-Shield).

I've made a few changes to your firmware:
On GitHub, I started from a clean copy of the TCB firmware version 0.93.68. I then applied your changes, and then I applied my changes. So now if you look at the commit history it is very easy to see exactly which lines have been changed at each step. 

I also gave your shield a unique device ID, this can be found near the beginning of the Arduino sketch:
Code: [Select]
// HARDWARE VERSION
    DEVICE HardwareVersion = DEVICE_HECLO_SHIELD; // This is the Heclo TCB shield for Mega2560 boards

I've updated OP Config so that it should recognize this when it connects (the device type should appear at the bottom of the OP Config window). Users can also now select your firmware in OP Config on the Firmware tab by choosing "TCB - Heclo Shield" in the Hex file drop-down box.

The new software version for everything (OP Config, old TCB, your new TCB shield) is v0.93.70 (I skipped v0.93.69).

It would be good if you could flash this new firmware to your shield using OP Config just to make sure everything still works as you expect. I didn't make many changes but you never know when a bug can be introduced accidentally!

Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: LukeZ on September 03, 2020, 10:25:26 AM
There is one other thing to think about - what happens when in the future changes are made to the existing TCB firmware or to OP Config?

I can not promise that I will have the energy to maintain your firmware too. If you create an account on GitHub I can grant you permissions to the Heclo Shield repository and you can make the updates yourself (either copying the new TCB updates, or adding new features of your own). 

But as the years and decades go by this might become very tiring (ask me how I know).

If worse comes to worst, the existing firmware will always work. But if it is not kept up to date, what will eventually happen is that some new variable will be added to OP Config that your firmware will not know about. At that point, your firmware will no longer be compatible with new versions of OP Config. However, all the prior versions of OP Config are stored on the website (OP Config prior releases (http://openpanzer.org/forum/index.php?page=prioropconfig)) so people can just continue to use v0.93.70.

Anyway, we can just see how it goes, right now the firmware is not being updated very often, but of course it is inevitable that someday it will be.

Thank you again for your great work on this project and I hope to see other people using it! I will be interested to watch Joe as he tries to assemble them, and if you have any tips for reflowing components on both the top and bottom of the board I'm sure he will be glad to hear it!

Also Joe if you do manage to create a bill of materials I will be happy to post that also on the downloads page.
Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: JPS99 on September 04, 2020, 02:57:36 PM
Wow, Luke, you've been busy!
I have the bill of materials and will post it here. I have sourced Digikey Electronics here in the US for the components and have included their part numbers and links to the parts on their site.  I hope it is helpful!

I've not made any progress in building my boards. I recently started building "THEDIYGuy999" micro receiver board and am having problems getting it working.  It is all SMD components and until I conquer it I'm not going to attempt Kim's much busier board.

 Learning to work with SMD's at the tender age of 68 is a bit of a trial. I think I can solder them pretty well now, but when things don't work it is very hard to troubleshoot.  Continuity testing is fun when you are switching between 5x magnifier and reading glasses between the board and the schematic. Likewise, it is difficult to get a scope probe on a tiny Mega328P pin! Oh well, what else are we to do during the Covid shutdown?? :D

UPDATE: Fixed an incorrect item I found on the BOM (6 pin screw terminal for motors out) and added links and pricing for an ATMega 2560 shield as well as a link to the preferred  and much more efficient Voltage converter module (in place of the LM7805, same pinout) you can find from various sources, link is to AliExpress.


Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: LukeZ on September 05, 2020, 07:56:12 AM
Thanks for doing that Joe, that is a lot of work I know! I posted the file on the downloads page. It should be easy to use the part numbers to find equivalents at Farnell or other places for those in Europe or wherever.

I am sure you will master SMD soldering with just a little practice. For the chips with lots of small pins I find some flux to be very useful, it helps the solder flow much easier and you can just drag your soldering iron across the pins and voila. You can buy it in a small plunger type needle thing that makes it easy to apply.

You can also try reflow soldering which I find actually to be easier than hand soldering. There is a discussion about it in another thread on this forum starting here (http://openpanzer.org/forum/index.php?topic=68.msg593#msg593). I use a cheap electronic hot plate. The one thing I have not done is a double-sided board. To reflow one of those you would need a small oven rather than a plate.

Many SMD components can be hand soldered but some chips like the VHN5050 motor drivers that Kim uses will really need to be reflowed because they have pads underneath the chip (in addition to the legs sticking out the sides) that have to be soldered, and of course you can not get a soldering iron underneath something. It looks like he has the audio amplifier and the smaller BD63573 chips on the bottom of the board and I believe those also have inaccessible pads. So I think reflow will almost have to be the only way you can mount at least some of these components, but maybe Kim will let us know what method he used.
 
Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: Heclo on September 07, 2020, 02:58:28 AM
Thank you so much for taking the time Luke!

Quote
I've created a new motor class called Onboard_ESC_CD (for C & D). I've put the Sabertooth_SerialESC motor class back to normal so now that can still be selected. In OP Config, I've created a new entry in the Drive Motors list called "HECLO ONLY! - Drivers C & D" so users can select these new outputs.

This is exactly what I had in mind, perfect!

Quote
To keep compatibility with all the other TCB boards in existence, I had to make your VNH5050 the C & D outputs, so we can keep the turret outputs at A & B. I renamed the variables in your code as well to keep everything consistent. From what I can see of your physical PCB I don't think this will require any changes to the silkscreen since I don't see A, B, C or D written on the board, but you will know better than me.

This was how I named them intially, but to get around the onboard motor driver warning in OP config, I switched them around. So this is perfect aswell.

Quote
Your motor current measuring code is good when using the onboard C & D motor drivers, but it would break any other kinds of outputs (serial controllers, hobby ESCs, etc...) so I added a check and now the current measuring code is only used when the C & D motor drivers are being used but the old code is used for any other kind of output. Of course if someone is using your shield they are most likely going to be using the onboard VNH5050 drivers, but it is best to allow all options just in case.

I don't quite follow you here. In my Frankenstein Leopard 2 (the one I make most of my experimentation on) I use brushless motors which are being controlled by ESC's (BlHeli32) via the servo outputs. The ESC's are supplied current via the EXT_ESC connector on the board, so their current consumption can be measured. The motor wattage is regulated to an accuracy of +-0,5W. I'll post a video of it in operation tonight?

Quote
I removed the mavlink folder from the source code because I couldn't see that it was being used anywhere. If this is a mistake you can let me know, but it compiles without it!

Yes this was a remnant from my experimentation with the "telemetry" out of the board, CRC calculation namely.

I will test the firmware ASAP!  ;D
Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: Heclo on September 07, 2020, 03:20:22 AM
Wow, Luke, you've been busy!
I have the bill of materials and will post it here. I have sourced Digikey Electronics here in the US for the components and have included their part numbers and links to the parts on their site.  I hope it is helpful!

I've not made any progress in building my boards. I recently started building "THEDIYGuy999" micro receiver board and am having problems getting it working.  It is all SMD components and until I conquer it I'm not going to attempt Kim's much busier board.

 Learning to work with SMD's at the tender age of 68 is a bit of a trial. I think I can solder them pretty well now, but when things don't work it is very hard to troubleshoot.  Continuity testing is fun when you are switching between 5x magnifier and reading glasses between the board and the schematic. Likewise, it is difficult to get a scope probe on a tiny Mega328P pin! Oh well, what else are we to do during the Covid shutdown?? :D

The soldering process I use is as follows:

1.  Reflow solder the VNH5050's. Check for bridging/gaps (using multimeter)

2.  Reflow most of the underside components, starting so close at you can get to the VNH5050's which are now upside down and hindering a complete reflow of the buttom.

3.  Hand soldering the rest of the top SMD components

4.  Hand soldering the rest of the buttom SMD components

5.  Hand soldering the top through-hole components

6.  Hand soldering all of the pins going into the arduino mega. (mounting the pins in the mega using it as the holder is the easiest way to do it)

Saying this is an easy soldering task would be a lie. It takes some practice to solder smd components of this size, youtube is your friend.

I use a simple hotplate for the reflowing such as this (https://www.ebay.com/itm/946C-Electronic-Hot-Plate-Preheating-Station-for-PCB-SMD-Heating-Work-220-110V/352851223746?hash=item52279264c2:g:IQ4AAOSwsCddyiGK)

Cheers Kim
Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: Heclo on September 07, 2020, 03:37:30 PM
I jumbled together a video showing the regulation feedback debug. You can hear the blheli_32 ESC's beep to life in the beginning.

Sorry for the shoddy filming.


Best regards Kim
Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: JPS99 on September 07, 2020, 04:06:53 PM
Kim and Luke, thanks for the soldering tips and workflow. I am doing a lot of research about SMD soldering on Youtube.  I am working on making a toaster oven I have into a reflow oven, which I think will give me the best chance for success with Kim's TCB Hat board.  I see some folks do double-sided boards in reflow ovens by using a temperature sensitive expoxy under the chips when reflowing the first side. That may be the way to go, or am I overthinking it?

 I just watched a couple of Kim's videos on Youtube, wow, great sounding tank and the stabilization feature is very cool!

I've begun assembling the road wheels on the T-35a that I'm building from Dean Rauch's files.  I've been trying to get an answer from him on what metal he is using as a leaf-style return spring on his bogeys, but so far no answer. I've tried contacting another fellow on Thingiverse who also built from Dean's files, but so far no response.
I've attached a photo of what I'm talking about. I tried some galvanized steel sheet I had, but it was too soft. Perhaps stainless steel around 0.35mm?

Thanks for any help you can offer.
Cheers - Joe/JPS99

Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: LukeZ on September 07, 2020, 04:12:54 PM
I don't quite follow you here. In my Frankenstein Leopard 2 (the one I make most of my experimentation on) I use brushless motors which are being controlled by ESC's (BlHeli32) via the servo outputs. The ESC's are supplied current via the EXT_ESC connector on the board, so their current consumption can be measured. The motor wattage is regulated to an accuracy of +-0,5W. I'll post a video of it in operation tonight?
You are completely correct! I needed to look more closely at your schematic. I knew the VNH5050 chips provide a current measurement output and I just assumed you were using that, but I see you have a dedicated current measuring IC so you are right, your code can work with any motor drive type. I have changed the code back to the way you had it and posted it as firmware v0.93.71.

It is a very interesting idea to regulate the model's behavior based on current draw and I would be curious to experience the difference in driving style that might give. Perhaps when I return to America I can try to build one of your boards so I can experience the difference first hand.

I am still a little unclear about your assembly process. I understand you do the VNH5050s first on the top of the board. Then you flip the board upside down, and this is the part I am confused about - since the VNH chips are now on the bottom, do you leave that section of the board hanging off your hot-plate? Otherwise the board would not lay flat on the hot plate. The sound amp and the two turret driver chips are really the only important ones to reflow on the bottom since they have hidden pads, and I see they are not directly over (under) the VNH chips, so it looks like it will work even if you leave the VNH end hanging off the hot plate.

I suppose the surface tension keeps the VNH chips attached even as their paste melts again during the second reflow, but I can imagine it would be important not to knock it suddenly while hot! Have you had problems with that?
Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: LukeZ on September 07, 2020, 04:30:52 PM
Kim and Luke, thanks for the soldering tips and workflow. I am doing a lot of research about SMD soldering on Youtube.  I am working on making a toaster oven I have into a reflow oven, which I think will give me the best chance for success with Kim's TCB Hat board.  I see some folks do double-sided boards in reflow ovens by using a temperature sensitive expoxy under the chips when reflowing the first side. That may be the way to go, or am I overthinking it?

Looks like we just posted at the same time. I have not done oven reflow before but I agree it would probably be the easiest method for a double-sided board. From what I have read, the upside down parts should stay in place even without epoxy, simply from the "stickiness" of the paste itself (before melting), and after melting, from the surface tension of the liquid solder. However, this is probably most true for small components like resistors and such that don't really weigh anything. The VNH chips have a metal slug in them and are probably (relatively) heavy so those I am not so sure about, but Kim can answer that. Those might also be difficult to epoxy since the bottom of those chips is mostly going to be soldered. However, if you do the board in an oven you only have to melt it once and you can just reflow it with the VNH chips on top so gravity is not a problem.


Quote
I've begun assembling the road wheels on the T-35a that I'm building from Dean Rauch's files.  I've been trying to get an answer from him on what metal he is using as a leaf-style return spring on his bogeys, but so far no answer. I've tried contacting another fellow on Thingiverse who also built from Dean's files, but so far no response. I've attached a photo of what I'm talking about. I tried some galvanized steel sheet I had, but it was too soft. Perhaps stainless steel around 0.35mm?

I'm afraid I can't be of much help with that one! But I'm sure if you experience with various sheet metal you will find a suitable material. I would think stainless is generally less flexible than carbon steel, but in such a small scale maybe it doesn't matter, the thickness is probably what is important. Leaf springs are widely used in 1/10 scale crawler RCs but I don't know if they would be the right length/width for your requirements, however they are easy to source so maybe you could try some. The other thought that comes to mind is women's hair barrettes, but what are the odds they would be the right size?!
Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: JPS99 on September 07, 2020, 04:53:29 PM
Quote from: JPS99 link=topic=240.msg2488#msg2488 date=1599512813 The other thought that comes to mind is women's hair barrettes, but what are the odds they would be the right size?!
[/quote
Wow, that's thinking outside the box!  They would have to be fairly large, as what I've tried so far has been about 110mm X 12mm.
I'll check the local Dollar Stores to see if they have anything like that.
Thanks for the tip! (as well as the soldering guidance!)
Joe
Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: Heclo on September 08, 2020, 02:17:09 AM
Quote
since the VNH chips are now on the bottom, do you leave that section of the board hanging off your hot-plate?


Exactly yes! It is is not the optimal solution, but due to the component density on both sides of the board, this has proven the most practical.

Quote
I suppose the surface tension keeps the VNH chips attached even as their paste melts again during the second reflow, but I can imagine it would be important not to knock it suddenly while hot! Have you had problems with that?

In fact the VNH5050 can soak up so much heat that they doesn't reach the melting point while hanging over the side, I haven't had any problems with it anyway. I use 37/60 solder and a hotplate temperature of 220c.

Quote
Kim and Luke, thanks for the soldering tips and workflow. I am doing a lot of research about SMD soldering on Youtube.  I am working on making a toaster oven I have into a reflow oven, which I think will give me the best chance for success with Kim's TCB Hat board.  I see some folks do double-sided boards in reflow ovens by using a temperature sensitive expoxy under the chips when reflowing the first side. That may be the way to go, or am I overthinking it?

This sounds like a very interresting approach!

Quote
You are completely correct! I needed to look more closely at your schematic. I knew the VNH5050 chips provide a current measurement output and I just assumed you were using that, but I see you have a dedicated current measuring IC so you are right, your code can work with any motor drive type. I have changed the code back to the way you had it and posted it as firmware v0.93.71.

It is a very interesting idea to regulate the model's behavior based on current draw and I would be curious to experience the difference in driving style that might give. Perhaps when I return to America I can try to build one of your boards so I can experience the difference first hand.


Thank you for reimplementing it! :D
The whole idea of the wattage regulation was to make the model behave as their prototype meaning when the model goes through rough terrain it should slow down to a pace that reflects the prototype.

Using my leopard 2 as example:

Prototype: Engine power      = 1130kW                          Model: engine power (scaled down)            = 272W, adjusted after rigorous testing to 100W
                Weight                = 62000kg                                    Weight                                          = 13,8kg
                Top road speed    = 73km/h                                     Top road speed                              = 4,56km/h
                Top terrain speed = 40km/h                                     Top terrain speed                           = 2,5km/h

The result is that when I drive the tank through grass or up a slope it slows down while the motor sound is still going full monty and if I try to go up a slope that is too steep the tank will grind to a halt, just like the real thing would.
A feature I would love to be implemented in the OP Config is the ability to set this max motor power. As it is now it has to be set in the OP_Driver.cpp.

By the way if it would be helpful to you Luke I could send you a finished board? It makes it a lot easier to work with code I imagine.

Cheers Kim
Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: LukeZ on September 09, 2020, 09:04:00 AM
The whole idea of the wattage regulation was to make the model behave as their prototype meaning when the model goes through rough terrain it should slow down to a pace that reflects the prototype.

A feature I would love to be implemented in the OP Config is the ability to set this max motor power. As it is now it has to be set in the OP_Driver.cpp
Hi Kim, I have had to look more closely at your code, I admit when I first saw the words "PID" my eyes glazed over. I have some vague memory of them from college or somewhere, but only recall that it is somewhat complicated.

When you say the max power is set manually in OP_Driver, are you referring to this array: log_speed_curve_out[] ?

If so, it looks like there are 5 numbers actually needed, corresponding to the desired max wattage for 5 segments on a logarithmic scale. Even if we make it possible to set these numbers in OP Config, I wonder how many people are going to have any clue what to enter? The final effect will seem to depend on the motors used, the gearbox ratio, the battery voltage, and the model's specific handling characteristics as influenced by its weight. Even if they have the ability to measure their own current draw (which most do not as I have discovered on this forum), it still seems like it will take a lot of trial and error over different terrain at different speeds to derive suitable wattage values. To me this just seems like something very, very few people are going to want to do or even be able to do. I am not saying it is a bad feature, in fact it is very cool, but it is not widely applicable.

Even having looked at the code I am still not perfectly clear on how the scaling and PID work, so I don't think I would be able to explain it very clearly in the help files.

I tried to create a similar effect myself, but my approach was to use an IMU. This was useful for barrel stabilization but at the same time could also measure when the tank was going up or down an incline. When going up, the maximum speed would be reduced, so the user would have to use more throttle to get up the hill, and the throttle sounds would increase, even though the tank was moving more slowly. When going downhill the effect would be reversed. The only adjustment the user would need to worry about in OP Config was the sensitivity, which was a number from 0-100% and it could also be adjusted from the transmitter if they wanted to experiment on-the-fly.

It worked quite well but in the end the 2560 processor couldn't handle the IMU communication along with everything else so I removed it from the final version. But I guess it illustrates an approach to this sort of thing that also keeps in mind the user and tries to make the settings easy and simple for them to understand. If I am making a product just for myself of course I can put in many complicated and esoteric capabilities, but if the goal is to share it with everyone then I have to take into account everyone's abilities. Already the main complaint about the TCB is that it is too complicated.

From what I can see now, as much as I think your approach is very impressive and clever, I'm not sure I want to add a section to OP Config for these adjustments. The number of people who would use it is surely so small that it would be easier for the rest of the community if those few people compile their own custom hex files.

To be honest, since your fixed values may not work for everyone, what might even be the better approach is to have the code function by default the way the standard TCB does. For those users who do want to use your custom wattage scaling, they would need to edit the code to enable it (set some variable to "true") and enter their 5 custom values. It would be best to put these options in a dedicated .h file rather than in OP_Driver, that would make it easier for the user and less likely they accidentally change something else. Then those users can recompile the code with their changes. But otherwise for people who want to use your shield but don't know anything about compiling code, the driving would already work like a normal TCB and they wouldn't have to think about any of this.
Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: Heclo on September 14, 2020, 03:16:52 AM
Quote
When you say the max power is set manually in OP_Driver, are you referring to this array: log_speed_curve_out[] ?

If so, it looks like there are 5 numbers actually needed, corresponding to the desired max wattage for 5 segments on a logarithmic scale. Even if we make it possible to set these numbers in OP Config, I wonder how many people are going to have any clue what to enter? The final effect will seem to depend on the motors used, the gearbox ratio, the battery voltage, and the model's specific handling characteristics as influenced by its weight. Even if they have the ability to measure their own current draw (which most do not as I have discovered on this forum), it still seems like it will take a lot of trial and error over different terrain at different speeds to derive suitable wattage values. To me this just seems like something very, very few people are going to want to do or even be able to do. I am not saying it is a bad feature, in fact it is very cool, but it is not widely applicable.

I have made a modification to the code so the logarithmic curve is fixed, meaning there is only one variable that need to be adjusted = engine_max_watt. The 5 points on the curve will be derived from this number.
Code: [Select]
float engine_max_watt = 50.0;
float log_speed_curve_in[] = {0, speedLimit >> 3, speedLimit >> 2, speedLimit >> 1, speedLimit};
  float log_speed_curve_out[] = {0.0, 0.02 * engine_max_watt,0.08 * engine_max_watt,0.25 * engine_max_watt, engine_max_watt};
  setpoint = FmultiMap(desiredEngineOutput, log_speed_curve_in, log_speed_curve_out, 5);
  feedback = engine_watts;


In my testing with different tanks there have been no need to tune the PID k values. I have tested tanks ranging from 20W to 180W and max Max speed (set in OP Config) of as low as 15%.
I don't think the users of Open Panzer should be underestimated, if someone wanted a plug and play solution they wouldn't be looking here. The project is already 100% DIY so if one has come this far...  :D

Quote
From what I can see now, as much as I think your approach is very impressive and clever, I'm not sure I want to add a section to OP Config for these adjustments. The number of people who would use it is surely so small that it would be easier for the rest of the community if those few people compile their own custom hex files.

To be honest, since your fixed values may not work for everyone, what might even be the better approach is to have the code function by default the way the standard TCB does. For those users who do want to use your custom wattage scaling, they would need to edit the code to enable it (set some variable to "true") and enter their 5 custom values. It would be best to put these options in a dedicated .h file rather than in OP_Driver, that would make it easier for the user and less likely they accidentally change something else. Then those users can recompile the code with their changes. But otherwise for people who want to use your shield but don't know anything about compiling code, the driving would already work like a normal TCB and they wouldn't have to think about any of this.

This is how I've been doing it thus far, easy for me, not so much for anyone with no coding experience.
I imagined a parameter in the config like "Enable motor power regulation" and then a parameter like "Engine max power" with a default value of 50. The help file could explain that in order to scale the power use this formula: prototype kW / 16 ^ 3, and that due to the immense torque of electric motors the end result usually needs to be reduced by means of trial and error (go up a 60% slope and your speed should be reduced to a crawl).
One could even make the parameter in OP config be the value of the real tanks horse power, so that the user can lookup the real tank's specs and thereby get scale correct performance. The calculation could then be made in the code converting it to scale Watt (just an idea).

 
Could it be made so that if one have selected the "Heclo board" that new options become available? Like they remain hidden until you choose board or something?

I hope I am not being to much of a PITA, I am just very enthustiastic about making the hobby as realistic as possible  8)

Cheers Kim



Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: LukeZ on September 16, 2020, 01:52:54 PM
Hi Kim, sorry for the slow reply, things have been very busy lately. I think your modification that reduces the input to a single variable in watts is much more practical for the end user. They still need to know what a watt is, but they can experiment.

Nevertheless, I am unwilling at this time to make further changes to OP Config for this purpose. You are not being a PITA at all by making the request and I would like to accommodate it, but it sets a precedent which I would be obliged to maintain in the future, and there are other long term considerations I have to keep in mind. I know it is more work for people to compile the firmware if they want to make a change to your code, but at present the number of people using this is very small, and I have to keep some limits both on what I incorporate into the main project and also on the amount of work I sign up for voluntarily.

I am happy to make another change to the firmware and post a new hex, either with the power regulation turned on at a default of 50 watts, or else disabled by default, or something else if you have an idea. But to change it from whatever the default state is, the user will have to modify the source and recompile, or ask someone to do it for them if they don't know how.

The source for OP Config is also open so I suppose another option is to fork that and modify it to your heart's content!
Title: Re: Heclo TCB Shield for Mega2560 Boards
Post by: JPS99 on December 15, 2020, 08:05:26 AM

The soldering process I use is as follows:

1.  Reflow solder the VNH5050's. Check for bridging/gaps (using multimeter)

2.  Reflow most of the underside components, starting so close at you can get to the VNH5050's which are now upside down and hindering a complete reflow of the buttom.

3.  Hand soldering the rest of the top SMD components

4.  Hand soldering the rest of the buttom SMD components

5.  Hand soldering the top through-hole components

6.  Hand soldering all of the pins going into the arduino mega. (mounting the pins in the mega using it as the holder is the easiest way to do it)

Saying this is an easy soldering task would be a lie. It takes some practice to solder smd components of this size, youtube is your friend.

I use a simple hotplate for the reflowing such as this (https://www.ebay.com/itm/946C-Electronic-Hot-Plate-Preheating-Station-for-PCB-SMD-Heating-Work-220-110V/352851223746?hash=item52279264c2:g:IQ4AAOSwsCddyiGK)

Cheers Kim

Thanks, Kim. I'm just re-reading this as I am getting to the point where my T35 is ready for the electronics. I've been doing a lot of testing of the chassis and tracks as this behemoth has so much track footprint that it can cause problems and breakage. My reliability factor has gone up enough that I am now starting to work on the superstructure and need to get some turret movement and sound.  I'm looking forward to getting your TCB Hat working as it will add a lot of function to the T35. 

Regards and Merry Christmas,
Joe