Registration Notice

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

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Testing TCB Firmware with Stock Arduino Mega
« on: January 14, 2017, 02:26:34 PM »
It occurred to me that now, prior to physical release of the TCB, some people may have already on hand an Arduino Mega. The TCB uses the same processor as the Arduino Mega (ATmega2560) so the firmware will compile just fine on that board.

If you have an iBus or PPM receiver, you can connect it to your Arduino Mega with 3 pins (PPM to Mega pin 3, or iBus to Mega pin 15). Unfortunately SBus uses an inverted serial protocol, and before the processor can read this information the signal has to be "un"-inverted. This requires a transistor and two resistors which are on the TCB board but of course absent on the Arduino Mega. If you want to implement this transistor inverter yourself see the TCB schematic, it is very simple and most any basic transistor would work (the SBus signal would also go to Mega pin 15). But otherwise, stick with iBus or PPM receivers.

The Sabertooth can be connected to your Mega with two pins.

Additionally you could also hook up a Benedini TBS Mini to the Mega with only a few jumpers.

See the diagrams below, the first shows only a receiver and Sabertooth, the second adds the Benedini.

You don't need to use the Arduino editor for any of this.

Important Circuit Info: You will notice in the diagrams below we have Arduino pins A12 and 33 connected to ground. On the actual TCB board these pins are assigned to physical switches. Pin A12 is Dipswitch 5 and we set it to ground in order for the TCB to know it should be communicating over USB rather than an alternate serial port. Pin 33 is the Fight/Repair switch and we set it to ground in order that the TCB remain in Fight mode. This one doesn't really matter so much for the testing done here but Repair mode can have some confusing side effects without all the rest of the circuit present, so just jumper it to ground.

  • Plug your Arduino Mega into your PC using a USB cable.
  • Launch OP Config (download it here)
  • Select the COM port assigned to your Mega
  • Go to the Firmware tab of OP Config, click the "Get Latest Release" button, and then click the "Flash" button. After this process is complete, your Mega is running TCB firmware.
  • You should now be able to connect to your Mega using the "Connect" button in OP Config.
  • If you have a receiver connected, you should also be able to run through Radio Setup.
  • Make sure Drive Motor type is set to "Sabertooth Serial ESC" on the Motors tab of OP Config.
  • Create some function triggers if you like, and adjust any other driving settings you might like.
  • Write settings to your Mega using the blue arrow button.
  • Drive your tank around like a boss!

Other Helpful Threads:
Sergey's Open Panzer TCB From Scratch - on Russian site, but Google translate works very well.
Sergey's thread here on the OP Forum - with not as much detail as the Russian thread.

Mega_Drive.jpg
Testing TCB Firmware with Stock Arduino Mega Mega_Drive.jpg
Views: 1281
Mega_Drive_Sound.jpg
Testing TCB Firmware with Stock Arduino Mega Mega_Drive_Sound.jpg
Views: 1290
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #1 on: January 30, 2017, 12:22:34 PM »
This list of pins and their mappings may also be useful for those experimenting with a stock Mega. (As will the actual schematic, you can download a PDF of that on the Downloads page).

When using a commercial Arduino Mega board, you want to use the pin numbers from the PDF in the Ard column (for "Arduino"). These will correspond to the pins printed on your board.

The pins under the Atm column (for "ATmega") are the pin numbers on the physical chip itself, which would only be useful if you're designing a custom PCB.
*
TCB_Pinout.pdf
(13.12 kB ~ Downloads: 66)
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline vandborg

  • 9
    • View Profile
  • Denmark
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #2 on: February 18, 2017, 03:39:29 AM »
Hi there.

Nice work. I look forward to the release of TCB. Can anyone help with pins for extern ESC on a Mega board. I am a member of the largest danish panzerclub (and the only one :) ).
Regards

Torben
Member of Panzerteam Denmark
http://www.panzerteam.dk/

*

Offline vandborg

  • 9
    • View Profile
  • Denmark
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #3 on: February 18, 2017, 06:49:55 AM »
Hi again.

Have solved my problem. I will try to make a breakout board with basic functions. I have a scale 1/6 SU-85 with brushless motors and somewhere in my house, there is a Benidini TBS.
Regards

Torben
Member of Panzerteam Denmark
http://www.panzerteam.dk/

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #4 on: February 18, 2017, 10:30:06 AM »
Welcome Torben! Great to have people from around the world. I have also been the only member of various large panzer clubs myself, wherever I've lived. :)

Glad you figured out the ESC outputs on the stock Mega. For anyone else curious you can find them in the PDF attached above, but I will also list all 8 servo outputs here:

Mega Pin   .Output
22#8 - Benedini Prop 1
23#7 - Benedini Prop 2
24#6 - Benedini Prop 3
25#5 - Recoil Servo
26#4 - Barrel Elevation servo/ESC
27#3 - Turret Rotation servo/ESC
28#2 - Right Tread servo/ESC
29#1 - Left Tread servo/ESC

Depending on your selections in OP Config some of these may also be free for general pass-through, and you can assign any analog channel on your transmitter to control them directly, as if the TCB were a receiver.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline vandborg

  • 9
    • View Profile
  • Denmark
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #5 on: February 18, 2017, 12:22:08 PM »
Now another ?
It is about the 4 types of transistors used in the TBC. How sensitive types are they? I would like to use transistors who is non-smd types. I hope you understand my Q. English is not my native language :)
Regards

Torben
Member of Panzerteam Denmark
http://www.panzerteam.dk/

*

Rebus

Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #6 on: February 19, 2017, 12:51:17 AM »
Hello vanborg,

Waiting the TCB board from Hobbyking, I drawn a simple shield to plug on a standard Mega2560.
My idea is to experiment ... and try to understand Luke's work.

I have some IRFD024 laying around and I fitted 8 of them on the board (4 only are connected, others will be connected following my need).
These mosfets are not very powerfull (2A continuous, 20A pulsed), but they are easy to replace !

I'm still waiting my pcbs, but if you are interested I can share my Eagle files.
Regards

*

Offline vandborg

  • 9
    • View Profile
  • Denmark
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #7 on: February 19, 2017, 03:00:19 AM »
Hello Rebus.

I would love to see your files. I have been waithing to someone to take Arduino into our tanks. I have not the brain for that but can fiddle with electronics onsdag aften basic plan.
Regards

Torben
Member of Panzerteam Denmark
http://www.panzerteam.dk/

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #8 on: February 19, 2017, 12:48:28 PM »
Now another ? It is about the 4 types of transistors used in the TBC. How sensitive types are they? I would like to use transistors who is non-smd types.
Torben your English is very good and I understand you perfectly. The values of the MOSFETs/transistors used on the TCB are not crucial.

For the SBus inverter (Q10) you can use a BC337 NPN transistor which should be easily available and cheap. It can replace Q10 directly with no changes to the schematic.

For the light outputs Aux, L1, L2, Brake, MG, IR send, and Hit notify (Q1-Q7) you can also substitute a BC337 for the MOSFETs shown in the schematic. You will want to change the 150 ohm base resistor to something a bit higher like 562 ohms, this should give you roughly 400-500mA capacity. Note that will not be quite enough for the IR LED which draws quite a bit more, but the IR signal is sent for a very short amount of time so it might be fine, but you might also not get the full range. 

Note also that the MG output on the TCB uses a pin on the ATmega2560 processor that is no available on a stock Arduino Mega. You can move it to a different, unused pin on the Mega but you will need to change the MG_PORT, MG_DDR, and MG_PORTPIN defines in OP_Settings.h and re-compile. Or you can just use the blinking options of the Aux output as an MG light, it will work just as well.

For the high-intensity flash trigger (Q9) you can substitute any common PNP transistor, the value is not important. BC327, 2N3906, whatever you can find.

Finally there is a MOSFET (Q11) to control the Smoker. The smoker pulls quite a bit more current so you will need to keep that in mind, I have not tested how much but at least a few amps. Any through-hole MOSFET with power dissipation of 50 watts or more that can be turned on with 5v should work, FDP8880, FDP8440, RFD14N05L, IRL640A are just some random choices I see at the local supplier.



NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #9 on: February 19, 2017, 12:58:47 PM »
I forgot about Q8 for the mechanical recoil/airsoft drive. A BC337 may work here as well, barely. The bigger problem is that the TCB uses an external interrupt pin (Port E6) that is not available on the stock Mega (I mean the pin is there but the Mega board does not bring it out to a header). So these will not work anyway, and there is not a good way to use a different pin for that function. But you can always use a servo recoil instead.

As you can see, there are definitely some limitations when using a stock Mega board over the TCB.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline vandborg

  • 9
    • View Profile
  • Denmark
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #10 on: February 20, 2017, 03:32:37 AM »
Ohh yes, and I canĀ“t waith to get my fingers on the real stuff :) At the moment I am building a SU85 in scale 1-6 with brushless motors and there a Mega will fit fine.
At the same time, I have developed a full 3D printet Tiger I, auf E in scale 1-10 and there the TCB will fit perfect. And when finnished and tested, I will share these files.
Status 1.png
Testing TCB Firmware with Stock Arduino Mega Status 1.png
Views: 1390
Status 2.png
Testing TCB Firmware with Stock Arduino Mega Status 2.png
Views: 1598
Status 3.png
Testing TCB Firmware with Stock Arduino Mega Status 3.png
Views: 1378
Exhaust 1.png
Testing TCB Firmware with Stock Arduino Mega Exhaust 1.png
Views: 544
Regards

Torben
Member of Panzerteam Denmark
http://www.panzerteam.dk/

*

Rebus

Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #11 on: March 18, 2017, 12:31:12 PM »
Hello,

After several weeks, I got my proto pcbs, to plug on standard Mega2560 :


I have seen that a new firmware was available (03/10/2017) and I download it.
Some changes appears on the leds red, green and blue which now are flashing quickly.

Now I'm able to experiment !

Regards

PS: I have some spare pcb, if somebody is interrested (but I'm living in France)



Sorry Luke to have tried destroying your forum !
I have resized my 24Mpix picture in old SVGA 800x600, I hope it's ok.
Proto TCB.jpg
Testing TCB Firmware with Stock Arduino Mega Proto TCB.jpg
Views: 585
« Last Edit: March 19, 2017, 09:54:45 AM by Rebus »

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #12 on: March 18, 2017, 01:36:48 PM »
Rebus very cool! Please keep us posted on how things work. I know you have already seen it but the LED key here can help decode what the blinking means!

You tried attaching an image to your post but it was too large and caused issues with the forum software. It wasn't too large in absolute size (only about 1MB), but it was too large in dimensional size - about 6000x4000 pixels. The forum tries to create small thumbnails of each image and for complicated technical reasons the process fails with a picture that large. Please try re-sizing your photo first to something more reasonable, then re-upload.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline vandborg

  • 9
    • View Profile
  • Denmark
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #13 on: March 24, 2017, 03:40:45 PM »
Hi Rebus.

Can You post one to Denmark and what is the price? I can pay via Paypal. And can You email the pcb files to me? (tvandborg@live.dk)

Regards

Torben
Regards

Torben
Member of Panzerteam Denmark
http://www.panzerteam.dk/

*

dannydeleon

Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #14 on: April 17, 2017, 10:09:18 PM »
Hi Luke,

Thanks for all the effort you put into this project. It is shaping up to be a very flexible solution for controlling an rc tank.

I got a question. I am trying to test your TCB firmware using an ArduinoMega that I have lying around. It is one of those clones that I got from Amazon which uses the cheaper CH341 chip instead of the original one used in the genuine arduino. I was able to connect my mega board to the PC and was successful in flashing it with the latest TCB firmware as you listed in your first post. My problem is when I try to CONNECT, it would say attempting to connect (at the bottom) and after a second or so a red box appears that says "disconnected from the device". I got the right COM port and left the baud rate as 115200. I tried changing the baud rate of the COM port to 115200 in Device Manager but still no success. I tried all the different baud rates in the OPConfig drop down but no success.

Do you know what is the issue I am getting? Can you tell me or suggest something to try?

Thanks,
Danny