Open Panzer

Developer's Forum => TCB Dev => Topic started by: LukeZ on January 14, 2017, 02:26:34 PM

Title: TCB Firmware with Stock Arduino Mega
Post by: LukeZ 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 (http://www.openpanzer.org/downloads/tcbmk1/eagle/OpenPanzer_TCB_Mk1_Schematic.pdf), 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.


Other Helpful Threads:
Sergey's Open Panzer TCB From Scratch (https://tankspb.com/index.php?topic=754.0) - on Russian site, but Google translate works very well.
Sergey's thread here on the OP Forum (http://openpanzer.org/forum/index.php?topic=100.0) - with not as much detail as the Russian thread.


Edit: I've added also another diagram even more detailed from user jhamm (Jürgen) showing connections to a Mega Pro Mini, but the pin numbers are the same for the standard Mega.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ 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 (http://openpanzer.org/downloads)).

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.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: vandborg 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 :) ).
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: vandborg 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.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ 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.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: vandborg 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 :)
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Rebus 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
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: vandborg 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.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ 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.



Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ 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.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: vandborg 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.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Rebus 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.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ 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 (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:tcbinstall:boardlayout#onboard_leds) 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.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: vandborg 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
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: dannydeleon 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
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on April 17, 2017, 11:18:49 PM
Hi Danny,

First of all, make sure you have pin A12 jumpered to ground as shown in the schematic at the top of this thread, otherwise the TCB is going to ignore communication attempts over the USB port. That's the most likely issue.

Otherwise it's hard to say what might be happening. Failure to connect often happens even with legit devices but in my experience it is always a momentary glitch that clears up on the second or third try if you keep trying to connect.

115200 is the correct baud rate. And you shouldn't need to change the rate in device manager although that shouldn't hurt anything.

I don't have a clone to test with. I would think they should still work and obviously some communication is possible since you flashed the firmware. But "connecting" is different than flashing and who knows, maybe there is something different about those serial chips that is causing an issue.

I'd try some of the standard things first - perhaps try re-installing the CH341 drivers, for sure reboot the computer, and also make sure no other programs are open (such as the Arduino IDE) that might be tying up the COM port.

In OP Config you can also go to the Firmware tab while trying to connect and you will see in the console screen whatever activity is going on. OP Config sends the connection command ("OPZ") several times, and if connection is successful the TCB will respond with something like "133|133|0|27641".

You can also try the "Snoop" button on that same tab to see if the TCB is even operating correctly - at the very least you should see a "Waiting for radio" message from the TCB, unless you have a receiver connected in which case you will see all kinds of status information dumped out. If you don't see either of those things try flashing again.

Let me know how you get on.

EDIT: There is also a connection workaround - connect first via Snoop (rather than the Connect button). If this is successful, wait for all the TCB messages to complete, then click the Connect button and connection should work.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: dannydeleon on April 18, 2017, 11:29:08 PM
Hi Luke,

Thanks for your help :) It was the missing jumpers all along. I missed that part from your first post. Now just waiting for my ESC and PPM receiver. I am going to test regular RC ESC just to see how the driving behaves. I use a lot of TBS minis/micros in my tanks so I got the sound portion covered. I wanted to test the TBS micro in particular because based on my experience, I cannot get the Function 1/2 to work on the micro. On the Mini, I basically have the same parameter configuration as the TCB but when I tried it on the micro, setting PROP2 to Function 1/2 was very inconsistent. I basically have the same tank config on all my models in my 9xRPro running eR9X. but had to use PROP3, set it to 12 coder for the engine start if I use the micro for it to work consistently.

Anyway thanks again. On with the testing :).

-Danny
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on April 19, 2017, 11:13:23 AM
Danny I don't know if you saw, but Thomas Benedini released a firmware update and a new version of his TBS Flash software over the weekend (Flash v3). This adds some more usable sounds when paired with our TCB, and simplifies the interface between the two (there is no longer the need to run through a teaching routine on the Mini).

But - his new software only works on the Mini, and I don't believe he intends to support the Micro with it. So keep that in mind. I've never actually tested a Micro even on the old firmware, I've only ever used the Mini. I can only assume he is trying to move away from the Micro because it has been cloned by the Chinese, which is great for the customer but obviously not good for his business.

Moving forward our project is only going to support his new software both because of the added functionality but also because it's too much hassle to keep two different versions going at once. The Wiki page on the Benedini has been updated (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:tcbinstall:sound_benedini_v3), you can read it for the new setup instructions.

To use the new version you'll have to download Flash V3 from Benedini, update your TBS Mini, and also update your Mega with the latest TCB firmware (0.92.04 or greater).
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: dannydeleon on April 26, 2017, 06:04:19 PM
Hi Luke,

Since I bought my TBS from Dan of Battlearmorrc, I reached out to Thomas to see if I can get the usercode/password for the download section and he sent it to me after I showed him my invoice :). Thanks again for clueing me on the new TBS Flash version.

I am having a problem with OP Config reading my radio. Since I was going to do this as a test, I bought a Frysky DJT Tx module and it came with a V8FR-II Rx not knowing that the V8FR-II Rx cannot do PPM. I had a small Frysky compatible 8Channel Rx that does PPM which I bought from banggood for my micro drone, https://www.banggood.com/FD800-Tiny-Frsky-8CH-PPMSBUS-Receiver-Compatible-FRSKY-ACCST-X9DPlusDJTDFTDHT-For-QX95-QX90-p-1108071.html, which I tried binding with the DJT. It binded but when I go to the Radio section and hit the Read Radio button, it says "Radio is not found". I tried different things but no success so I ordered a D4R-II RX to see if the problem is my TX or RX. The 9xRPro is set to PPM Protocol, 8Channels, and FrameLength of 22.5ms, I think.

Oh, and I followed your instruction to turn the TX first before connecting to the TCB. It still didn't work. Any other suggestions while I wait for my D4R-II RX?

Thanks,
-Danny
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on April 26, 2017, 06:29:54 PM
The first thing to check is whether your Mega is able to read the receiver correctly. Connect your receiver to the Mega and the Mega to your computer. In OP Config, select the correct COM port, then go to the Firmware tab and click the Snoop button. If the Mega can't read the receiver it will say something like "Waiting for radio..." and just hang until the receiver is detected. This would indicate there is an issue with the PPM output of your receiver perhaps, or the connection to the Mega. The receiver you linked to says it can do PPM or SBus, but I don't see the instructions on that page for how you select one or the other. Perhaps your receiver is in SBus mode rather than PPM. (The TCB can read SBus but your stock Mega won't be able to without additional hardware).

If the TCB is able to read the receiver then it will proceed to spit out a bunch of debugging information, some of which will be information about the receiver including the protocol type (which should be PPM in your case) and the number of detected channels. If that looks good then the issue could be with OP Config reading the signal in real time. But that is less likely, so try the Snoop thing first and see what you get.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: dannydeleon on April 29, 2017, 02:06:06 AM
Hi Luke,

Thanks for your help. I was able to make the radio work by attaching the signal pin of the receiver to pin 3 of the Mega instead of pin 15 as in the diagram of your first post. I looked at the TCB_pinout.xls that you provided and I saw pin 3 says PPM so I thought I might try it and it worked.

-Danny
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on April 29, 2017, 01:33:33 PM
Good catch Danny! You're absolutely right, that was my bad for omitting that in the instructions. On the actual TCB the radio signal is sent to both pin 3 and pin 15 and the processor picks up the correct one depending on the protocol, but I had forgotten that.

I've updated the pictures at the beginning of this thread. For anyone following along, Danny is correct - connect your PPM receiver to Arduino Mega pin 3. If you have an iBus receiver, connect it to Mega pin 15.

Thanks again for catching that.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: dannydeleon on May 11, 2017, 01:38:06 PM
Hi Luke,

I am back. Thanks for all your help, I was able to make the RC ESC work with the Mega. It works like a charm. Now I encountered something that I cannot explain and you probably can. This might just be because I am using a Mega instead of the real TCB.  So my T9xPro uses er9X and I wanted to test the RC PassThrough using my TBS Micro card. My radio is set for RETA channel order. When I read the radio in OPConfig, every channel work as expected and the track motors move as expected (I haven't tested the turret channels). I wanted to see if I can make the TBS Micro work. Since the TCB only supports the TBS mini now, I thought if I can just pass through the RC signal to the Micro as if it is connected to the RX, maybe it will work. So I assigned Aux1 to Channel 5 of type analog, Aux3 to Channel 7 of type analog in OPConfig. Now in the Functions tab, I created 2 functions, one is RC Passthrough triggered by Aux1 variable, second is RC Passthrough triggered by Aux3 variable. Aux1 (Channel 5) will be the engine off/on toggle and Aux3 (Channel 7 will be the engine sounds). On my radio, Channel 5 is assigned to a 2-way switch and Channel 7 is assigned Channel 2 as the source (Channel 2 is my throttle). So every time Channel 2 moves, Channel 7 moves in unison. Now when I upload this to the Mega and test it, when I flick the 2 way switch on my radio, the Micro turns off and on. When I move the throttle stick up and down, the engine sound changes. BUT, my track motors no longer no longer spin. If I revert it to no Micro, the motors work :(. When I read the radio, the display shows Channel 2 (Throttle) moves and Aux3(channel 7) moves in unison.

Anyway, not that important since I'll be using the Mini anyway but just wondering why it is behaving that way.

-Danny
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on May 11, 2017, 11:53:21 PM
Danny,

A couple things. First, the only real difference between the Mini and the Micro as it relates to being controlled by the TCB are the auxillary sounds triggered on Prop 3. On the Micro there is a limit of 12 sounds and on the Mini (when used with the new version of TBS Flash v3) the limit is increased to 16. Because there are more sounds the signal that gets sent to the Benedini to trigger those sounds is different, and this is why they are not compatible.

However the signals for engine speed (Prop 1) and engine on/off (Prop 2) should be pretty much the same. You could try setting the sound card in OP Config to Benedini and then hooking up the Micro to Prop 1 and Prop 2 (leave Prop 3 disconnected). This might work to get you engine sounds on the Micro and you don't need to worry about RC pass-throughs. 

But - it sounds like using RC pass-throughs you have gotten the Micro to work anyway, the only thing is you are lacking motor control. Have you tried keeping the Mega connected to the computer and using the Snoop console to see what is going on? Perhaps it is as simple as the TCB not being told to turn the "engine" on (it has its own internal engine state variable which must be enabled before it will allow you to control the motors). If you have Channel 5 assigned to a 2-way switch and this channel is passed-through to the Micro, that's great for starting the engine sounds on the Micro - but did you remember you need to assign a function to start the engine on the TCB as well? Ideally you would just assign it to the same 2-way switch on Channel 5, unfortunately to get the pass-through to work on that channel you have to set it to "analog" in OP Config, as you know. This lets the signal be passed-through but because it is now an analog trigger you can't assign it to the engine on/off function which is of type digital. If you have enough extra channels in your 9X you could mix some other channel to Channel 5, let's say for example Channel 9, then in OP Config set Channel 5 to Analog -> assign to RC pass-through function -> connect to Micro (as you have already done), but set Channel 9 to digital of type 2-position switch -> assign to engine on/off functions.

Alternatively you could just set the engine to start automatically with the first blip of throttle (this option is on the Driving tab). So you still have to use Channel 5 to turn on the Micro, but when you advance the throttle the TCB will turn its internal "engine" on as well.

If there is some other problem going on then we'd need to do more troubleshooting. Like I say, running things while viewing the console output should help you pinpoint the issue.


Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: uglyduck on May 23, 2017, 10:09:37 PM
A couple of questions regarding using the Mega before the TCB arrives:

I plan on using a pair of HobbyKing X-Car 45's for ESC's.  Where would I plug them into the Mega?  The same pins as listed in the TCB Pinout?  Same method as described in the wiki for the TCB?

If using the Mega, would it be IR battle capable (with the battle apple of course) or would this function be limited to the TCB?

And finally a general question about the TCB; is it compatible with the DBU? http://darkith.dyndns.org/~darkith/html/dbu_inst.shtml (http://darkith.dyndns.org/~darkith/html/dbu_inst.shtml)
I ask because is far less expensive than the Tamiya system and may appeal to those willing to engage in a project like this anyway.


Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on May 24, 2017, 01:12:10 PM
I plan on using a pair of HobbyKing X-Car 45's for ESC's.  Where would I plug them into the Mega?  The same pins as listed in the TCB Pinout?
See this post from earlier in this thread (http://openpanzer.org/forum/index.php?topic=16.msg97#msg97). Right tread ESC goes to pin 28 on the Mega, left tread to pin 29. These pins are for the signal wires to the ESCs. Both ESCs will also need a Ground connection to the Mega, which you can get from various places on the Mega board. Whether you connect the +5v from the ESC to the Mega is up to you. You could do so and use the ESC to power the Mega (connect the +5v from only a single ESC, not both). Or if you power your Mega directly from your main battery then leave the +5v from both ESCs disconnected. Either way you are going to have a real rat's nest of wiring!

If using the Mega, would it be IR battle capable (with the battle apple of course) or would this function be limited to the TCB?
You could connect an Apple to the Mega and you would be able to receive hits, but to send IR you would need additional circuitry because the Mega doesn't have the power to drive the IR LED directly (at least not with any kind of range). You don't need a lot, just a transistor/MOSFET and a few resistors, but again you start to really get into a wiring mess.

And finally a general question about the TCB; is it compatible with the DBU? http://darkith.dyndns.org/~darkith/html/dbu_inst.shtml (http://darkith.dyndns.org/~darkith/html/dbu_inst.shtml)
I ask because is far less expensive than the Tamiya system and may appeal to those willing to engage in a project like this anyway.
All the various "apples" operate the same way, so yes you can use the DBU with the TCB as long as you connect it properly (easy to do on the TCB since every pin is labelled on the bottom of the board). You can also use the Taigen apple (http://www.taigentanks.com/taigen-tank-parts/tag120098) which is dirt cheap but doesn't have indicator LEDs, there is a photo of it wired to the TCB on the IR page in the Wiki (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:tcbinstall:ir).

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Rebus on October 23, 2017, 09:58:52 AM
Hello Luke,

I am really sorry that your project was devalued by Hobbyking attitude. 

Why don't use my piggyback solution on a classic Mega2560 card ?
This proto card can and must be improved, and my Eagle files are available to all, as a working basis.

Using through holes components (except 1206 resistors), allows that everybody is able to built it.
As an example, I'm interrested with the Scout Esc but ... my old eyes and fingers stop myself because I can't achieve safe soldering on these very small parts.

Your firmware should be adapted because some ATMega2560 pins are not available on the I/O connectors.

With low price and excellent quality of SEED pcbs, this could be a cheap and temporary solution ... waiting better days !

Best Regards.

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on October 23, 2017, 01:08:17 PM
Thanks for the offer of your files. If anyone would like to follow your approach and build a shield PCB I would encourage them to do so!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on March 03, 2019, 10:44:01 PM
Since the TCB is no longer available commercially there has been an increased interest in using an off-the-shelf Arduino Mega board as a do-it-yourself (DIY) solution. There are several challenges with this approach, but also one big problem: the TCB assigns two of its functions to pins on the ATmega2560 processor that are not actually connected on Arduino Mega boards. The processor on the TCB and Arduino Mega is the same, but for space constraints the Arduino Mega doesn't connect all the pins that are actually available, but because I designed the TCB from scratch, I was able to use any pin I wanted.

To solve this problem for those wanting to experiment with Arduino Mega boards, I have just released a new version of OP Config (v0.93.46). In this new release, you will have the ability to download a "TCB - DIY Version" firmware. This "DIY" firmware will always have the same options and features as the regular TCB firmware, and will be updated on the same schedule, the only difference is that the DIY firmware will relocate the two problematic pins from the traditional TCB design.

The pins that change on the DIY firmware are:
I need to create some updated documentation to permanently record this but in the meantime the new firmware is there and will work for DIY projects.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: jhamm on August 01, 2019, 12:15:46 AM
Hi,
made my own TCB´s from scratch.
First test  with Mega Core and the other with Mega Pro Mini:
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on August 02, 2019, 09:24:39 PM
That's true dedication! I hope they work well in your models, let us know.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: jhamm on August 04, 2019, 12:25:22 PM
Hi Luke,
yes they work well.
I finish the Tankrace yesterday on second place. :)
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: jhamm on August 06, 2019, 01:55:50 AM
Hello,
here additional info for a build with the Arduino Mega...
Title: Arduino Mega Option?
Post by: Lotuswins on August 08, 2019, 09:21:21 PM
Hi Luke,

Well, I am now in need of one or two more TCBs, and have been reading up on using the Arduino Mega.  Having no experience with arduino's, could you suggest:

1) a vendor/manufacturer of preferred board with as many components which would make the transition minimal hassle?

2) a complete wiring diagram, which includes lights, sabertooth, etc. which the DIY firmware will work with? The latest one you posted is great, but missing the LED side, I think?
3) any other components which are needed IE: transistors/etc. for inverting the Sbus signal....I assume we need to make a small board to interface this? or any other components needed to emulate the TCB.
4) anyone to contact with success, willing to share pictures, etc?

Anyways, thanks for all the awesome help.  All my tanks are working well, so tackling a DIY seems to be the next step.....and I have this KT I'm assembling from bits which needs a brain.....

Jerry
Title: Re: Arduino Mega Option?
Post by: jhamm on August 09, 2019, 05:03:52 AM
Hi,
i made a extended Drawing, see attached.
First step try a Arduino Mega, if you get it work do the next step an build a TCB by a Mega2560Core or Mega2560MiniPro.
There is no ready by build solution, you have to think and create the circuit.
All neccesary information you find here:
http://openpanzer.org/forum/index.php?topic=16.0
Title: Re: Arduino Mega Option?
Post by: LukeZ on August 09, 2019, 02:43:32 PM
Hi Jerry,

First, I've merged your posts with the Arduino Mega thread as you can see, to keep all the discussion in one place

Having no experience with arduino's, could you suggest:
1) a vendor/manufacturer of preferred board with as many components which would make the transition minimal hassle?

All the commercially available Arduino Mega boards are functionally the same, they differ only in size/form factor. None of them will have any of the components that will make the transition hassle free, indeed all of them aren't really circuits so much as they are just "breakout boards" which simply bring the teensy-tiny pins of the processor out to headers where you can more easily access them.

2) a complete wiring diagram, which includes lights, sabertooth, etc. which the DIY firmware will work with? The latest one you posted is great, but missing the LED side, I think?
3) any other components which are needed IE: transistors/etc. for inverting the Sbus signal....I assume we need to make a small board to interface this? or any other components needed to emulate the TCB.

See this post earlier in this thread (http://openpanzer.org/forum/index.php?topic=16.msg70#msg70) for a pinout document (updated to show the alternate DIY pins, of which there are only two). Of course a complete schematic as well as bill of materials is available on the Downloads page (http://openpanzer.org/downloads). The pins in the schematic refer to ATmega pin numbers, whereas your mega board will use Arduino pin numbers, which are not the same. However the document in the post I just linked will provide the crosswalk.

4) anyone to contact with success, willing to share pictures, etc?

This is the thread to be in! Start from the beginning and read through.

Making a DIY version is not entirely an easy process but start with the simple things (radio in and servo outputs), then go from there. Don't connect or bother with any functionality you won't be using to simplify the final result.

Comprehensive support for this undertaking is beyond the scope of the project but feel free to ask specific questions and I will try to assist.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on August 09, 2019, 02:55:27 PM
See also this thread by Sergey (http://openpanzer.org/forum/index.php?topic=100.0) from Russia who I think was the first to make a DIY version.

His Russian-language thread is also definitely worth checking out, it has more detail (he provides a link to it).
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Rebus on August 23, 2019, 02:02:49 AM
Hello,

I'm  working on a new "piggy-back TCB" plugged on a standard ATMega board.
As said before I'm not very young and fitting a pcb with smd components smaller than 1206 size, is a pain for me.

I need to reduce the length because on the previous pcb, some pins connectors were in contact with USB plug on Mega board.
My new prototype board would use "big components", and because space available is not very wide, some functionalities will be sacrified.

I have seen that Luke add some possibilities for DIY boards, and I would like to clarify some details :

- Machine Gun mosfet drive was driven with PE2, non available on Mega board
   Now connected to PD1 (Pin 20  SDA of I2c port)   
   Correct ?

- Recoil switch was connected to PE6, non available on Mega board
  Now  connected to PD0 (Pin 21  SCL of I2c port) 
  Correct ?

So, I2c connector can be removed
L298 removed and replaced by 2 connectors for external drivers as like chinese Monster Moto shield
IR battle components removed and replaced with connector.
5V regulator is removed and Servos connectors, leds, and all accessories are powered by a BEC.

We can discuss about that, my Eagle files (and Gerber) would be available for everybody.

Have a nice day




Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on August 23, 2019, 07:45:20 AM
I have seen that Luke add some possibilities for DIY boards, and I would like to clarify some details :

- Machine Gun mosfet drive was driven with PE2, non available on Mega board
   Now connected to PD1 (Pin 20  SDA of I2c port)   
   Correct ?

- Recoil switch was connected to PE6, non available on Mega board
  Now  connected to PD0 (Pin 21  SCL of I2c port) 
  Correct ?

So, I2c connector can be removed
That is all precisely correct. It requires us to give up the I2C port but we are not using that port in the TCB firmware anyway.

I will be interested to see the results of your DIY experiment and I'm sure they will be useful to others as well.

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Rebus on August 23, 2019, 08:50:39 AM
Hi Luke,

Thanks for your double check.
My new board is ready, i will send Gerber file to China quickly.
When I wil got pcb, after testing, errors (!) correction ... i will publish Eagle files.

Best regards,

PS : Sorry Luke, but after your explanations, I2c connector was sacrified !
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on August 23, 2019, 02:11:57 PM
PS : Sorry Luke, but after your explanations, I2c connector was sacrified !
Yes, it's unnecessary. If I were producing the TCB today I would remove it.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on August 28, 2019, 12:05:11 PM
Okay, just getting started after vacation and the roofing contract from hell....

Simple question:  I tried to get registered on the St. Petersburg Tank Forum, and couldn't pass the 'non-robot' test:   What is the correct response for 'Tank Leningrad'? 

jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on August 28, 2019, 01:57:31 PM
Hi Jerry, I can't remember now what I answered. But I've send a PM to a couple of the Russian guys and hopefully they will chime in shortly.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Deny on August 28, 2019, 02:33:29 PM
Hi! Writing kv-1
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on August 28, 2019, 03:42:50 PM
Thank you Luke and Denis, that worked!!  Jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on September 09, 2019, 06:44:54 PM
Hi all,

So I'm getting started on this, and have a Mega, a spare sabertooth, a spare taigen sound card, etc. all plugged into a test board.  I'm having trouble understanding where to plug in the DIP switch inputs.  The OP schematic shows pins 91,92,87,86,85 for sw 1 thru 5.  Yet the Mega diagrams don't show those pins coming out?  Are they reassigned in the DIY firmware? 

Also, I seem to have gotten the board to respond to PPM, and can start it (engine starting sound) but then it automatically shuts down, won't stay running.  Any thoughts? so far all the DIP inputs are not connected, is that the issue perhaps?

thanks, Jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on September 09, 2019, 08:07:26 PM
Hi Jerry, when referring to the pinout PDF at the beginning of this thread (http://openpanzer.org/forum/index.php?topic=16.msg70#msg70), you want to use the pin numbers in the Ard column (for "Arduino"). You're looking at the Atm column (for "ATmega") which are the pin numbers on the physical chip itself. But Arduino renames things and that is what is marked on your Mega board.

Therefore Dipswitches 1-5 will be Arduino pins A6, A5, A10, A11, and A12.

Any number of things could be going on with your rebooting issue. It is not likely to be anything related to the dipswitches. Are you possibly trying to power everything with USB? It won't be able to handle the load. Try using a battery, and try removing the Taigen sound card and see if that makes any difference. You can use USB for testing responsiveness to your radio commands using Snoop, but as soon as you start attaching peripherals you need a real power source.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on September 10, 2019, 05:01:26 PM
Thanks Luke, I overlooked the pinout pdf, thinking it was just for the TCB.....dooh!

So I got the dip switch included with jumpers, but still no joy on the staying running.  I then hooked up an LED for the MG, and it was blinking like a low voltage issue.  So I disabled the LV cutoff, and bingo it now stays running.  I'm using an external source for all 5 volt power, and I checked with my Fluke, all voltages rock solid at 5v and 7.2v.  However, the MG light blinks on startup, etc. but no machine gun sound nor blinking from pin 20.  Hmmmm, more work to do. 

Fun to be trouble shooting again....

Jerry

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on September 10, 2019, 05:06:41 PM
Okay, had my channels crossed....MG now working!!  on to the other LEDs.....jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on September 10, 2019, 05:26:42 PM
I'm using an external source for all 5 volt power, and I checked with my Fluke, all voltages rock solid at 5v and 7.2v.
That is slightly confusing, typically we provide an Arduino board with something higher than 5 volts and the Arduino steps it down to 5 with its onboard regulator. In fact these regulators typically require at least 1 volt higher and often more even to function. So if you are feeding 5 volts directly to the Arduino it could be browning out.

Now using a second 5 volt supply to drive external 5 volt components (such as LEDs or the Taigen sound card or a recoil servo) is fine, that is like using a BEC in an RC truck. But give the Arduino whatever your full battery voltage is on the VIN input.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on September 10, 2019, 08:36:39 PM
Hi Luke, I guess I explained it poorly.  I'm putting 7.4 volts onto vin on the arduino board and not using 5v out of the arduino for anything.  The sabertooth is also powered by the 7.4 volt source.  I'm using a 5v source independent of the arduino for the receiver, sound board, etc., connected to a common ground.

Perhaps the little jumpers are too small to feed the arduino power in?  causing a voltage drop and the voltage shutdown?? 

jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on September 10, 2019, 10:33:25 PM
Ok, in that case I'm sure you have plenty of power to the Arduino and your little jumpers are fine. The chip itself draws very little current and your external devices are being powered independently of the onboard regulator on the Arduino so power shouldn't be a problem. 

You're right though that you should disable the LVC since you don't have a voltage sense circuit hooked up and that will just cause issues, but anyway you figured that out.

You'll have to keep troubleshooting. Try disconnecting peripherals and see if the program still works, try looking at Snoop to see if anything informative shows up or if you can pinpoint what specific actions cause the reset.

Due to the infinite number of possible combinations it is also possible to create a combination of trigger functions that will cause a reset, but these would be illogical combinations and I'm sure you have a very simple and abbreviated list going anyway.

I see you're using the PWM-to-PPM converter again, another thing to try would be a PPM/digital receiver directly.

I'm sure it will be something simple in the end but you'll have to keep sleuthing to narrow down what the issue might be.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on October 03, 2019, 01:31:45 PM
After being tied up on other things, I finally pulled an Arduino 2560 out of a dusty box, and set about getting the OP firmware onto it.

A quick tip for anyone thinking of making their own TCB using an Arduino board. If you buy a cheap Chinese 2560 you may hit problems trying to get the board to communicate with your PC.

The reason is that FTDI/USB is a proprietary chip, not public domain. The people at FTDI realised that the Chinese had cloned their chip on Arduino boards so revamped their drivers so that they would only work on genuine USB chips. Some Chinese boards work, others don't. Mine didn't.

I had an ancient laptop in a drawer that I had used for previous Arduino projects, and that had a Legacy driver on it. This driver was released before the cloning problem, so has no internal checks for a genuine chip.

It worked! I downloaded the DIY-Hex firmware onto the cloned 2560.

I have a PWM converter on the way, and will then set about building the rest of the Open Panzer system, my only concern at the moment is getting the standard HL style motor driven turret rotation/elevation motors to work, rather than replacing them with servo's. Same goes for the Torro mechanical recoil.

Other than that, a muzzle flash is the only thing to get working and it will all be good to go.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on October 03, 2019, 05:33:52 PM
Hi Wibbly,

You don't have to use servos specifically for the turret motor controls. The RC outputs can drive servos yes, but also any standard RC speed control. AlieExpress/Banggood have many very small and extremely inexpensive brushed ESCs that will drive your turret motors and that is the easiest way to go.

If you want to replicate what is on the TCB itself, it uses an L298 motor driver chip. This chip requires multiple connections to the 2560 in addition to power and ground and the motor outputs. You can buy L298 breakout boards from China and they should work, but the wiring will be more of a mess and I don't think you will save any space.

The mechanical recoil motor will also require some other components, namely a MOSFET or transistor to drive the motor, and various passive components such as diodes, resistors and capacitors. These are all shown in the schematic under the heading "Recoil Power and Trigger." That one is not going to be so easy but if you are comfortable assembling your own circuits you can give it a try.

The muzzle flash is easier and requires only a PNP transistor and a resistor. Of course on the TCB we are using surface mount components but a bog-standard 2N3906 transistor will work fine here and you can buy them for a few pennies anywhere in the world.

It might be worth posting your progress and questions in the OP forum thread so that all the information can remain in one place, and there is already a good deal of discussion over there that you will find useful.

Good luck!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on October 03, 2019, 05:34:15 PM
One more quick comment - in my experience some of the PWM-PPM converters are really flaky. Yours might work fine but even so the wiring with individual PWM channels is really a mess. It would be much better to use a native PPM/iBus/or SBus receiver. Yes it's true, without any additional components a Mega2560 can only read PPM or iBus. If you want to read SBus you need to add a transistor and 2 resistors. Since you are already getting prepared to add external components that is fairly trivial to do and would be much cleaner of an installation and cheaper to boot. Look at the schematic for the resistor values, as for the transistor in this case any standard NPN should be fine such as a 2N3904 or BC337.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on October 19, 2019, 08:04:00 AM
Can I load the DIY firmware using the IDE?

Whilst playing around with the tx, Read Radio etc, my Windows 10 laptop decided to stop uploading to the Arduino. It connects, but throws up an AVRDude.exe error message

"The application was unable to start correctly (0x000007b). Click OK to close the application."

when I try to flash.

It looks like the firmware is corrupted on the 2560, I've reinstalled the OP interface but no joy. Re-installed drivers and no joy either.

The 2560 lights up, the VR hasn't blown, and the OP interface will connect. It just won't identify the port COM4, which is the only one on offer.

I assumed that the USB I/O had blown and ordered another 2560, but then fired up my Linux desktop. I had the same result, no port found. After a bit of digging around I have the 2560 'apparently' talking to the pc, eg the serial monitor works.

In order to test the comms, how do I upload the DIY hex file onto the 2560, I can't use the OP interface as this is Windows based. Never done this before.

Hoping someone can help?  It's got to be worth a try, though the 2560 may have toasted something :(
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on October 19, 2019, 11:12:17 AM
Yes you can flash the firmware from the Arduino IDE, but you don't use a Hex file, you download all the source code from GitHub and then open the project in the IDE.

However before you try all that try this first.

Go to https://zadig.akeo.ie/ (https://zadig.akeo.ie/) and download the Zadig 2.4 program.

It's just a single EXE, it doesn't need to install anything. Run the EXE. Plug in your Arduino to the computer. In Zadig go to the Options menu and select "List All Devices."

Then in the main drop-down box try to find your Arduino device. It may be listed as "FT232R USB UART" or who knows what else. If you can't identify it let me know what devices it does find and I'll see if I recognize one.

One you select your Arduino device, on the left side of the form it will show what driver is currently installed, and on the right side of the form it will give you an option to replace that driver. I would be interested to know what driver it says is currently installed, but after you make a note of that, select "libusb-win32 (version xxx)" from the list on the right and then click the Replace Driver button.

Now reboot, then try flashing again and see it if works.
 
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on October 19, 2019, 01:00:17 PM
I already have this useful program.   ;D

The only device is

usb serial device

The driver was:

usbser (v10.0.17763.1)

Having updated the driver as suggested, the COM port box in the config was blank.

However, I just tried USB Serial (CDC) in desperation..and it worked. The firmware updated.

The radio readings are a bit glitchy but I am putting that down to the converter in the circuit.

Having now centered the sticks, and allocated ch3 to throttle, and ch1 to steering, with pins 28 and 29 hooked up to the signals from the esc's, I am getting no response. My radio is in Mode 1, so the throttle is right stick up, and steering right stick left/right.

Can I assume that the 28/29 pins remain the same for the drive motors regardless of which mode the radio is in?

There may yet be a blown tx/rx chip on the 2560, if the tx signals aren't getting through the Arduino. I won't know until the new board arrives.

PS - I downloaded the latest OP Config as well.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on October 19, 2019, 01:24:47 PM
Good, this sounded very much like a driver issue so I figured that would solve it.

Can I assume that the 28/29 pins remain the same for the drive motors regardless of which mode the radio is in?
Yes, that is correct. It doesn't care what mode your radio is in or what channel is what, so long as you map everything correctly in the Read Radio procedure. If you have the sticks correctly assigned to throttle and steering and you can see them moving in the correct direction when reading the radio, then you are good to go.

Most likely you are missing something very simple like the engine hasn't been started. Using Snoop is the best tool to debug this. Can you start the engine and see that reflected in Snoop? After the engine is started, when you move the throttle forward does Snoop say you are moving forward? (You can also use the red/green LEDs on the board to confirm that movement is being commanded, see here (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:tcbinstall:boardlayout#onboard_leds)).

There may yet be a blown tx/rx chip on the 2560, if the tx signals aren't getting through the Arduino. I won't know until the new board arrives.
I'm not sure exactly what you mean here, if you can flash firmware and read the radio then tx/rx to the Arduino are working fine. Serial communications aren't used for driving the ESCs, those are servo outputs.

If you fry the ATmega2560 chip then it usually doesn't work at all, but in some cases it is possible to ruin isolated pins. However I haven't heard that you've done anything to damage the chip so far, sounds like you just had a Windows hangup with the USB driver.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on October 19, 2019, 01:40:28 PM
The other thing I will add is that you don't need to flash new firmware unless an update has been released, and even then only if you need/want whatever new thing has been added in the latest release. Once you have a working firmware on the board, there is no need to update it.

When you do flash a new firmware it can erase all your prior saved settings. So it very well could be for example that you had engine start assigned to some switch but with the new firmware that has been removed and you need to re-create it.

You can always tell what settings the TCB thinks it has by connecting to OP Config and doing a read from device (green down arrow). Now look at the settings and especially the function triggers and see if they are what you expect. The same goes for your channel assignments. If they are not correct, you need to change them.

The way to avoid having to do this every time a new firmware is flashed is to save your settings to an OPZ file (in OP Config go to the File menu and select "Save Settings to File.")

Now if a firmware update does erase your settings, you just have to open that OPZ file (either double-click on it in Windows, or if OP Config is already go to the File menu and select "Import Settings.") Then write those settings to your TCB (using the blue up arrow).

But again, once you have your model working there is usually not a need to be re-flashing firmware. Of course you can always change the settings whenever you want, but that is just reading/writing to the device in OP Config, and does not involve flashing firmware.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: luckowner on October 22, 2019, 11:23:10 AM
Dear LukeZ, long time no see, I my very busy before, and now I can take a break.
I have made some sound card without teensy, and it works well. So my next step it to design some TCB card for my trucks. I wound make you a surprise when all the things finshed, but TCB does not work. So I have to get some help from you.
In fact I have made some TCB from empty pcb and new atmega2560. Is the bootloader for TCB  special? I use stk500boot_v2_mega2560.hex as bootloader, is that right? When I finished flash the bootloader , I connect TCB with USB but OP config can't connect.
Can you tell my some detials about how can I make a empty 2560 be a TCB? Thank you.
And here is my sound card, It is just 5*3 cm .
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on October 22, 2019, 12:02:19 PM
Hi Luck. I am very impressed with your work on the miniature sound card, excellent job. Are you use a 4-layer board?

With the elimination of the Teensy and the reduction in size, production costs of such a board should be much more reasonable. I don't know if you have any contacts with Chinese manufacturing but there might be a greater willingness for someone to take this to market than the existing design.

As for the TCB - yes, it does use a custom bootloader, I have attached it to this post along with some instructions if you want to use it. The main difference is that it has been reduced in size from the standard bootloader and it also permits flashing on an alternate serial port depending on the position of Dipswitch 5 (Arduino A12, ATmega2560 pin number 85, port K4). When this pin is held to Gnd the processor will accept firmware flashing through Serial 0 (USB on the stock TCB board), when held to +5v it will accept firmware flashing through Serial 1.

However you can still use the stock Arduino bootloader since we usually don't need the alternate flashing port. Everyone here using off-the-shelf Arduino Megas are using the stock bootloader.

You mention that you flashed the bootloader, but you didn't say whether you had flashed the firmware. After you burn the bootloader then flash the latest firmware. After both of those are done then you can try to connect. I don't know if you are having a problem at the firmware stage or the connecting stage.

If you are having problems flashing the firmware, you can try to flash a simple test sketch from the Arduino IDE, something like blink an LED. See if the IDE has problems or not.

For connecting, have you tried the alternate connection method (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:operation:troubleshooting) where you connect first via Snoop, and once that has been established then click the Connect button?

Let me know what you find and I will help you out.

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: luckowner on October 23, 2019, 02:09:17 AM
Hi Luck. I am very impressed with your work on the miniature sound card, excellent job. Are you use a 4-layer board?

With the elimination of the Teensy and the reduction in size, production costs of such a board should be much more reasonable. I don't know if you have any contacts with Chinese manufacturing but there might be a greater willingness for someone to take this to market than the existing design.

As for the TCB - yes, it does use a custom bootloader, I have attached it to this post along with some instructions if you want to use it. The main difference is that it has been reduced in size from the standard bootloader and it also permits flashing on an alternate serial port depending on the position of Dipswitch 5 (Arduino A12, ATmega2560 pin number 85, port K4). When this pin is held to Gnd the processor will accept firmware flashing through Serial 0 (USB on the stock TCB board), when held to +5v it will accept firmware flashing through Serial 1.

However you can still use the stock Arduino bootloader since we usually don't need the alternate flashing port. Everyone here using off-the-shelf Arduino Megas are using the stock bootloader.

You mention that you flashed the bootloader, but you didn't say whether you had flashed the firmware. After you burn the bootloader then flash the latest firmware. After both of those are done then you can try to connect. I don't know if you are having a problem at the firmware stage or the connecting stage.

If you are having problems flashing the firmware, you can try to flash a simple test sketch from the Arduino IDE, something like blink an LED. See if the IDE has problems or not.

For connecting, have you tried the alternate connection method (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:operation:troubleshooting) where you connect first via Snoop, and once that has been established then click the Connect button?

Let me know what you find and I will help you out.
I just use a 2-layer board because I don't need to use all the pin of MK20. And the 2-layer board is cheap. Many of my friend is very interesting in this little sound card.Your work is very good, I can only improve a little.I think that the acceleration sound should change with frequency instead of just playing in the original sound. Have you tried this? I am trying to do this, but I have only little time.
Before that, I think I should have perfect hardware first. Light card is useful for tucks as there are always many lights on a truck.This well be a fully new design.
For TCB . I think I have a bad programmer. So the Hex may not be on the TCB. The light don't work. So I have to buy a new one. Thank you for your suggestion.I will tell you if there is any progress.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on October 23, 2019, 09:17:58 AM
I think that the acceleration sound should change with frequency instead of just playing in the original sound. Have you tried this? I am trying to do this, but I have only little time.
I am not sure I understand exactly what you are asking. But I will say, the current audio capabilities of the Teensy do not allow us to speed up or slow down a .wav file. If we want an acceleration sound that sounds faster, we have to create two sound files - one slow, one fast.

Before that, I think I should have perfect hardware first. Light card is useful for tucks as there are always many lights on a truck.This well be a fully new design.
You might also be interested in an earlier project of mine called Open Source Lights (OSL). It is not very sophisticated but it does have a lot of options for lights on cars/trucks. You can read about it here - Open Source Lights - Arduino based RC Light Controller (https://www.rcgroups.com/forums/showthread.php?1539753-Open-Source-Lights-Arduino-based-RC-Light-Controller)

I think I have a bad programmer. So the Hex may not be on the TCB. The light don't work. So I have to buy a new one. Thank you for your suggestion.I will tell you if there is any progress.
AVRDUDE should tell you (through the IDE or the command line, whichever one you are using) if the burn bootloader failed. But a bad programmer is very often a problem. I have used this one (https://www.aliexpress.com/item/2036402518.html) with success (set it to 5v).

It's hard to tell exactly from your picture, but I don't see a USB connector. Did you go with your previous plan of using a separate board for the bootloader chip?
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on October 25, 2019, 02:34:48 AM
I recently bought a 2560 off Ebay, did it in a rush, just looked for a cheap one. Having spent hours trying to get a driver that worked, I went back and looked at the listing. I had purchased a board with a 328P chip, not a 340/341. >:(

The board will hook up to the IDE, but will not connect to the OP configuration. Depending on the driver it will either show a blank port field, or it will show one, but when I click on Connect, it just displays 'Disconnected'. It sometimes displays 'Port not Open'.

I've no idea what the conflict is, I have tried every driver I can find on the web, Zadig 2.4 etc, tried deleting the device, deleting drivers etc, but no joy whatsoever.

My other 2650 with a 340 chip simply plugs in on the USB and connects no problem.

The vendor accepts free returns so I can send it back, and I have ordered another one that actually has a 340 chip on it.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on October 25, 2019, 12:25:11 PM
What can I say but that cheap stuff from China often comes with a hidden cost!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on October 26, 2019, 05:13:15 AM
There is a reason why I don't buy lottery tickets,  ;D ;D ;D

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on October 26, 2019, 06:07:16 AM
The new board arrived, I had specifically looked for a board that had a 340 chip on it. The Ebay ad had a pic of the chip, and stated that it was a 340.

I got a magnifying glass out, the chip on the board I received was unmarked, as was the last one. In fact the new board is identical to the last one purchased from a different vendor, so is probably a 328P.

This one is also going back as it has the same problem, Ebay is a nightmare!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: luckowner on October 28, 2019, 06:53:26 AM
I think that the acceleration sound should change with frequency instead of just playing in the original sound. Have you tried this? I am trying to do this, but I have only little time.
I am not sure I understand exactly what you are asking. But I will say, the current audio capabilities of the Teensy do not allow us to speed up or slow down a .wav file. If we want an acceleration sound that sounds faster, we have to create two sound files - one slow, one fast.

Before that, I think I should have perfect hardware first. Light card is useful for tucks as there are always many lights on a truck.This well be a fully new design.
You might also be interested in an earlier project of mine called Open Source Lights (OSL). It is not very sophisticated but it does have a lot of options for lights on cars/trucks. You can read about it here - Open Source Lights - Arduino based RC Light Controller (https://www.rcgroups.com/forums/showthread.php?1539753-Open-Source-Lights-Arduino-based-RC-Light-Controller)

I think I have a bad programmer. So the Hex may not be on the TCB. The light don't work. So I have to buy a new one. Thank you for your suggestion.I will tell you if there is any progress.
AVRDUDE should tell you (through the IDE or the command line, whichever one you are using) if the burn bootloader failed. But a bad programmer is very often a problem. I have used this one (https://www.aliexpress.com/item/2036402518.html) with success (set it to 5v).

It's hard to tell exactly from your picture, but I don't see a USB connector. Did you go with your previous plan of using a separate board for the bootloader chip?
Yes ,I want an acceleration  sound  when PWM frequency is high, and a slow sound  when the frequency is low. So I can just need a idle sound to creat all the sound for all of the PWM.I don't need any other thing. And it is what I will do with your code.
I have see the light card, another great job. I will see more when the sound card and TCB is OK.
I have got a new programmer and it is OK. I am working on some test.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Rad_Schuhart on October 29, 2019, 07:06:54 AM
luckowner, I am very impressed about your soundcard too! Does it have lights output? Do you have more info, and do you plan to sell it?

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on November 02, 2019, 02:48:27 AM
Ok, I have a problem and despite hours trying to solve it, I am completely stuck.

I am using the latest Config download.

I tried two clones but the TCB config would not connect to them.
I now have a genuine, boxed 2560 and that will not connect either.

I have tried the Arduino IDE on a Linux PC, a Vista laptop, and a Windows 10 laptop, and they all simply plugged in, found the port and I could click on Serial Monitor, no problem.

I have tried the same boards on the Vista laptop and the Windows 10 laptop, and they will not connect to the TCB config.

I have 'Arduino 2560' displayed in Device Manager, I have a port displayed in the Config.

When I click on Connect it either displays 'Device is Disconnected', or 'Port is Closed'.

I have tried all of the drivers in Zadig, no joy.
I have tried manually installing drivers via Windows, no joy.

Something, somewhere is refusing to allow communication between the USB and the Genuine 2560 and I have no idea what it is. I have been all over the web looking for solutions. I've tried installing, uninstalling drivers, reboots, and downloaded the latest Net Framework, Windows 10 is also the latest up to date version.

Oddly I have a broken 2560 clone, though a good clone with the right chipset, I can plug that in and it hooks up to the TCB config no problem. I have the GND>12 jumper in place at all times.

Does anyone know what the problem could be?   :-[ :-[ :-[
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 02, 2019, 12:10:23 PM
There are two types of connection in OP Config - the first is what you are trying when you click the "Connect" button. The second is the Snoop connection and that is the equivalent of the Serial Monitor in the Arduino IDE (it just listens or "snoops" but doesn't actually communicate).

Have you tried just connecting with Snoop to see what it does? If it can connect via Snoop, while snooping you can then click the Connect button, and see if it will connect that way.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 02, 2019, 12:56:30 PM
Another thing to mention - your Mega boards obviously don't come with any firmware on them. You will not be able to connect with OP Config until you've flashed the TCB firmware to them, this can be done using the Flash utility in OP Config or it can also be done with the the Arduino IDE if you download the source code (https://github.com/OpenPanzerProject/TCB).

Have you been able to successfully flash the firmware first?
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on November 02, 2019, 01:32:54 PM
OMG Luke, I am absolutely kicking myself now.  :) :) :)

Sat here, tried snoop, nothing, selected the DIY firmware, clicked Flash and it all worked perfectly.

When I tried it on the first board I must have flashed it first, totally forgot the most logical thing in the world when I tried the second one.

Many thanks!

Rob
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 02, 2019, 01:40:09 PM
Well I'm glad that's all it was! So many times here on the forum, and to be honest in my own experience as well, it's the simple things that really bite you!  8)
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: johnnyvd on November 12, 2019, 06:47:46 AM
Dear LukeZ, long time no see, I my very busy before, and now I can take a break.
I have made some sound card without teensy, and it works well. So my next step it to design some TCB card for my trucks. I wound make you a surprise when all the things finshed, but TCB does not work. So I have to get some help from you.
In fact I have made some TCB from empty pcb and new atmega2560. Is the bootloader for TCB  special? I use stk500boot_v2_mega2560.hex as bootloader, is that right? When I finished flash the bootloader , I connect TCB with USB but OP config can't connect.
Can you tell my some detials about how can I make a empty 2560 be a TCB? Thank you.
And here is my sound card, It is just 5*3 cm .

Hi Luck, very nice soundcards! How can we make/acquire these? Do you have Gerber files/BOM lists?
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on November 15, 2019, 11:58:34 PM
Hi Luke,

I'm working away on a breadboard version now.  I'm testing, and using the BC337 for the sbus inversion isn't working??  are the resistors going to work with this substitution into the current schematic?  I see the turn on voltage is 1.2vdc for the 337, vs 700mv for the BC848? 

Help!!   Jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 16, 2019, 08:17:28 AM
The BC337 should work although I have not tested it personally, however there are accounts of others using it, see here (https://intofpv.com/t-creating-an-sbus-inverter). That guy used different resistor values than the TCB and you could try modifying yours to be closer to his, he used 6.8k and 2.2k instead of 47k and 10k so quite a bit lower.

The 1.2 volt turn-on should not be a problem even if your receiver only manages to spit out a 3.3v signal, which is not unommon.

You can also buy a pre-made inverter for cheap (https://www.readytoflyquads.com/rtf-sbus-inverter), but I'm not sure what the shipping would be. Here is also a page on how to tap into the uninverted signal on certain SBus receivers (https://www.getfpv.com/learn/fpv-diy-repairs-and-mods/get-uninverted-sbus-frsky-receivers/).

I'm having a hard time identifying exactly the radio portion of the schematic you posted. The main thing to check is if you have the transistor wired correctly, it's easy to get the legs backwards as I know from experience.

Keep me posted!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on November 16, 2019, 03:39:08 PM
Hi Luke, thanks for the quick reply.  I'm pulling my hair out on this one!! 

So I have my trusty Mega2560 by Elegco on my testing breadboard thingy,  which is nice for doing this trial and error testing. 

BTW, sorry for the layout drawing, I meant to post a pic of the 'shield', if that is the right term, so I modified it.

I've tried both sets of resistors, the arduino likes neither.  I have ppm working fine from a 9x pwm xmtr through a converter to ppm.  When I try hooking up the inverter, using a
FrSky XSR receiver, no radio is detected (both from blinking leds, and from snooping 'waiting for radio').  So I tried the 9x with converter using the sbus output, still no go.  I put a voltmeter from input to output on the inverter circuit, and get 3.27vdc, which to me seems that the signal is getting inverted?  Am I right in thinking that?  Is it perhaps that this transistor is too slow for the frequency of the sbus signal? 

I guess its time to drag out the scope?  This is really crazy....its got to be something simple.....so I can start kicking myself.   ::)

Jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 16, 2019, 08:01:40 PM
I have ppm working fine from a 9x pwm xmtr through a converter to ppm.  When I try hooking up the inverter, using a FrSky XSR receiver, no radio is detected (both from blinking leds, and from snooping 'waiting for radio').  So I tried the 9x with converter using the sbus output, still no go.

When you say you tried using the "converter with the SBus output", do you mean you tried using the PWM-to-PPM converter on the SBus output? That will not work since the converter will only work with PWM input. But I do note that the XSR also has a PPM output. Since you know your Mega is reading PPM just fine, you could try connecting the PPM output of your XSR directly to the Mega, for that test you won't need the converter or the inverter.

I wonder if it could be something as simple as the receiver just not being bound correctly to your transmitter module.

Also note on the link I provided earlier they show where on the XSR you can tap into to get the uninverted SBus signal directly. You could try that as well, if it works then we know the issue is with the inverter transistor, if it doesn't then I would begin to suspect more strongly something with the receiver.

I put a voltmeter from input to output on the inverter circuit, and get 3.27vdc, which to me seems that the signal is getting inverted?  Am I right in thinking that?  Is it perhaps that this transistor is too slow for the frequency of the sbus signal?
I think there isn't much we can tell with just a voltmeter, the scope would tell us more, but I would try the easier tests above first.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on November 17, 2019, 02:17:11 PM
Quote
When you say you tried using the "converter with the SBus output", do you mean you tried using the PWM-to-PPM converter on the SBus output? That will not work since the converter will only work with PWM input. But I do note that the XSR also has a PPM output. Since you know your Mega is reading PPM just fine, you could try connecting the PPM output of your XSR directly to the Mega, for that test you won't need the converter or the inverter.

The converter I'm using (HK) has both PPM and Sbus outputs.  I hooked up the XSR CPPM output and it worked well, like the 9x reciever did on PPM output.  So both receivers are in good order.

Quote
I wonder if it could be something as simple as the receiver just not being bound correctly to your transmitter module.

I rebound, just to be sure, no change....

So I connected up my trusty Tektronix TAS 465 dual channel scope, (be kind as I think I use this thing once every 5 years).  Channel one to the input to the inverter, and Channel two to the output.  The input square wave is about 2.5v high, whereas the output is about twice that.  So the transistor is amplifying the signal?  I checked with both sets of resistors (6.8k/2.2k & 47k/10k) and the ouputs appear about the same.  This signal is being inverted, just by too much??

Should I now go for the through hole equivalent of the BC848 (I think its a BC548)? 

Jerry



Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 17, 2019, 02:45:57 PM
So I connected up my trusty Tektronix TAS 465 dual channel scope, (be kind as I think I use this thing once every 5 years).  Channel one to the input to the inverter, and Channel two to the output.  The input square wave is about 2.5v high, whereas the output is about twice that.  So the transistor is amplifying the signal?  I checked with both sets of resistors (6.8k/2.2k & 47k/10k) and the ouputs appear about the same.  This signal is being inverted, just by too much??

Should I now go for the through hole equivalent of the BC848 (I think its a BC548)?
That o-scope test hasn't told us anything. We are interested in whether the signal is being inverted, the absolute voltage levels are not of interest. No doubt your receiver is operating at 3.3v and the Mega is running at 5 volt so what appears to be an "amplification" is to be expected (nothing is really being "amplified" just translated).

What you want to see on the oscilloscope is when the input to the transistor goes low the output goes high, and vice versa. That is inversion and that is the piece that you are trying to figure out.

Sure, you can try the BC548, or just eliminate the inversion circuit all-together using the instructions in the link I provided as a test.

EDIT: Actually, I'm willing to bet I know what your problem is. Note that the radio input signal gets routed to two pins on the Mega - Arduino pin 3 for PPM, and Arduino pin 15 for iBus/inverted SBus. Probably you have just routed the receiver to pin 3 and not also to 15.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on November 18, 2019, 01:07:06 AM
Quote
Actually, I'm willing to be I know what your problem is. Note that the radio input signal gets routed to two pins on the Mega - Arduino pin 3 for PPM, and Arduino pin 15 for iBus/inverted SBus. Probably you have just routed the receiver to pin 3 and not also to 15.

And you would have won.  That was the issue, since only one line is shown on the schematic, I thought only one lead was there....but apparently two are needed.  Once I connected to pin 15, the lights all went out, and the engine sound would start, and all seems now to work....

On to the next challenge. 

Thanks a bunch Luke, remind me not to bet against you in the future  :)
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 18, 2019, 10:32:08 PM
I'm glad that's all it was!

Since you have done all this work, can you confirm that the BC337 works with the same resistors listed in the TCB schematic (47k and 18k)? This would be good information for others to know who might try this same thing.
Title: Wiring Question
Post by: Wibbly on November 21, 2019, 06:06:58 AM
Ok, I can't figure this out, admittedly I am taking huge amounts of meds at the moment, but something must be staring me in the face and I can't see it.

I am using a PWM tx/rx and an S2PW pwm>ppm converter. These are widely used in the RC aircraft world and are reliable.
The latest DIY firmware is installed.

If I hook up the speed controller as a normal PWM set up, without the Mega2560, I can run a tank motor in forward and reverse on Channel 3 (right stick).

I have the basic:

GND>A12
GND>33


If I hook up the converter PPM output to the Arduino:

GND
3
5v

that would appear to be correct.

This leaves:

GND
5v (tried with and without this connected)
28

These I connect into the esc 3 pin plug.

The esc is run off a good battery.
The Arduino is run off a good battery.

The most that happens is that the tank motor will run for a few seconds using Channel 3, but if I centre the stick it will not then restart. It will not run in reverse.

Something is either shutting down the esc, or something is stopping the PPM signal. I cannot figure out what it is.

Strangely I had the same set up with a previous version of the DIY firmware and had a tank driving around no problem at all, but now...I am pulling my hair out. What have I missed?
Title: Re: Wiring Question
Post by: LukeZ on November 21, 2019, 07:59:05 AM
I am using a PWM tx/rx and an S2PW pwm>ppm converter. These are widely used in the RC aircraft world and are reliable.
I have mentioned this many times before and at the risk of sounding like a broken record, PWM-to-PPM converters are not recommended. They are not widely used in my opinion and the whole reason digital receivers were invented is to eliminate all the problems and shortcomings not only of these converters but of native PPM itself. The TCB is designed for high channel count digital radios, buy one!

But putting that aside let's focus on your issue. Note, I've merged your question with the Arduino Mega testing thread since that is what you are working with.

Your physical wiring sounds correct. Only do not connect 5v from your ESC to the Mega! Just GND and Signal. (Of course for your receiver you do want 5v).

The most that happens is that the tank motor will run for a few seconds using Channel 3, but if I centre the stick it will not then restart. It will not run in reverse.

What have I missed?
Have you run Radio Setup on this arrangement? You will get nowhere until that is completed. Watching the channels move during Radio Setup will tell you whether the Mega is reading all the channels correctly, and lets you confirm whether they are mapped correctly to your functions.

Once that has been completed successfully if you still have problems run your Mega while connected to OP Config in Snoop. This will tell you if you are able to start the engine correctly and whether it is responding to throttle/steering commands as you would expect.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on November 21, 2019, 01:52:16 PM
Did a snoop as you suggested.

Motor started as usual.

However what Snoop told me was that no matter what I set the LVC to, or whether it is enabled or not, the firmware will declare that the LVC has been reached, and power to the motor is shut off.



Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 21, 2019, 02:31:57 PM
Well LVC would explain why it stops moving right away. I just tested mine and I can turn off LVC without a problem, remember that if you make any changes in OP Config, including just un-checking the LVC option, you need to write the changes to your TCB/Mega for them to take effect.

I would also make sure you have the most recent version of OP Config as well as the most recent firmware on the board. I have made some changes to both recently, not related to LVC necessarily but if you are using mis-matched versions of OP Config/firmware it can cause confusing issues. This seems more likely to be the case for you because from your screenshot it shouldn't matter even if LVC is enabled since your battery voltage is obviously higher than the cutoff level.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on November 25, 2019, 07:17:34 AM
Hi LukeZ and other forum members!

I decided to design a shield in EasyEDA for the TCB project from scratch.

And I have a question. If I add the necessary details to the board, to expand the functionality, they will work with DIY firmware:

1. External motor serial
2. Radio Input (to invert the signal)
3. Muzzle flash
4. Heng long smoker
5. Machine gin led output pin
Thanks.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 25, 2019, 10:59:25 AM
Yes, the DIY firmware has full functionality. It can do everything the regular firmware can do. The only difference is the attachment of some pins which are necessary to change in order to be compatible with off-the-shelf Arduino Mega boards.

Please keep us posted on your project!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on November 25, 2019, 02:36:04 PM
This is my first experience with PCB layout and EasyEDA in my life. :(

I have already placed an order, now I am only waiting for the arrival of components.
Should I create a new topic or describe my experience in this topic?

(https://lh3.googleusercontent.com/l2LrKDnEJma-s4yjKosyF0T9Q67QbntvqpLK5UAi2gWcU1bqBve0g6y0O0E1pCl0q1rAWvnQJfaQTXxb9WN7oy4xgTtqyDvQcfgYmT5a6I9QGkwz_Skwybre26IGnUbehfvt3jM0fiBfeLI15IWpImFfkKvUVWJ9_HHEwCCP8oo1_JkWB5nifG9An0cLfW-OVZQPiRrU5-NOykYGnvUOlCnb9t_EbR6Q_CKT2qhYNdFDBv7MKAKIivccGb03z4iWRjzNwAFZ74G5RGviY9PhimKp-WYpXTCvJqiBZAJ5yUTvXzfk4czsYSX3-T038ZLAkvDTyRuOPMm1cXlSsYvDX3W_EiapWvLWgEYpzthb91wah5cAW1V3j-mKlM4AjEKN1gl6_uZaWMTymnhWPDqD9OWnLaI0xRQB2RL3S35KncC-2CCqG_RPpF5PWF3jMXaN6lKaGmU1d8BSJj2Sp2iwAWd_Ytl-t8JU_24krrVXYQsTQ02ZAVtC9I3SnpzyDM7e_gzgSqIikw2uRKMalEzwhEMwKHN7uwoMNK-vRnUSq3aiTsQluAXqJhxQnQYzN71ITYgNXtUV3K4lLYT4vfIFNLh2O9vmooKkYkE7x_SQ_eaQy-7ZI5wAmy2_Kfe6Mn98oruuHlBttisRAP0r1-g9TW2NAyT7XP2K5PoDZWVqwhzHEQD7QGP6xz0=w648-h357-no)

(https://lh3.googleusercontent.com/46irQ8_U91sPnUmUblS0eSVduJhkqfpgwbore-kLpC6g7H-RcskNr4FTc-ApIy93r5bEpR2-w8-Tw8qgYSrjx_TNyStzjoYMcshT7qUyvJ2HEakrfIgBd4F4LBqocQcIIA10FKoicEvyCxOEamJf2N7wU-4nGn1TcQLglxVwWpaUye4GnHHlMKpU2LJ3IiLLd4i7P2fPfwMcH-Y0J-Y8wmC9ylIM5MJDJcCZXvDmXTovCjIadCUpKzOCVyVmupPwcy90Rv6BTt88cQI2QW508Y6o3y46XsXTLaj1rJXemz1WWCLxT9cXqjLSnA5JY-G4djLhpA93YDtdcN904YRCUyuB9C3leNXADO50M5cwOudsB2NctmXl0RwTY-zJ8wH3yqZZWIe89DLJQBp8-Hk9ndAraMp3kOt6LJM-dLu9-7qJAz3mpIr4_j4O6uouCKEtVvi1lOE4w61ZcqIQaq9qhLuxm-QLCagQnPvW-6Ytb5UoHEz-cqTbAVs15cxCNuhPEk2ZpdhQl8hwTZrWM0G_hh3RuG0He2YtLBndQLROjnD9NLN_IMjJR7ZSxXtGFgePdn3wYojvjEPT5RrUv_DzoIadKBI_pfTuoGUiC1vX3UZZiD-qbCN6-5SOgcFErIWlv9ayiEIrHmoHmTvk74OeEACUVQ2kpQunF53Hhibe7s34g1qd_q33Pzg=w653-h357-no)
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 25, 2019, 03:31:14 PM
This is my first experience with PCB layout and EasyEDA in my life. :(

I have already placed an order, now I am only waiting for the arrival of components.
Should I create a new topic or describe my experience in this topic?
Good work, your trace layout is very neat! I think we can keep the discussion in this thread where more people will see it.

Am I correct that you still expect to use additional components off-board? For example I see all the light outputs but no MOSFETs to switch them.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on November 25, 2019, 03:44:38 PM
Yes, I plan on using MOSFETs externally for various third-party devices.

As the saying goes, a good thought comes after I handed over the layout to production, now I would have done some things differently.
But I think this is not the latest version of the board, ideally I would like to make a very small version of the TCB board in size.

And I also want to collect a sound card, since there is no where on sale, and I really liked the functionality from the description.

I am interested in making your designs. I studied the experience of sergevk, and when I laid out the printed circuit board, I based on his experience in placing radio components and connectors, which I think is obvious from the design of my printed circuit board.
When I get a positive experience with the first version of the board, now I want to mark the MOSFETs on the board in the next version.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: jhamm on November 25, 2019, 11:39:37 PM
Hi,
there isn´t any picture or layout to see....
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 26, 2019, 12:16:33 AM
Yes, I plan on using MOSFETs externally for various third-party devices.

As the saying goes, a good thought comes after I handed over the layout to production, now I would have done some things differently.
Yes, I certainly know about that! No sooner do you send your board design off to be produced, do you remember something that should be changed. The production version of the TCB board that Hobby King sold was my 23rd revision. You never get it right the first time!

Anyway I am glad you are interested in building these designs and of course that is one of the goals of the open source project, to have others adapt the existing work to their own needs.

You don't have to link to photos at Google Docs or any other image hosting site, just upload them to the forum using the "Attachments and other options" link below the area where you type your post.

Jurgen, I have attached the two images that NS-21 posted earlier in case you couldn't see them.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on November 28, 2019, 03:24:22 AM
Just a quick update on my 2560 DIY project.

After a few glitches, and sourcing the reason for them, I seem to have got the drive motors working, along with the turret controls. Just waiting on some more cheap 20amp esc's.

The PWM>PPM converter works, the glitches I narrowed down to an old tx I am using that is less accurate than the firmware expects it to be. Eg the sticks don't always centre at the exact same position each time. The tx was sending false signals, so I disabled the default functions and expanding the dead zone from 10 to 15 sorted the problem.

Hopefully the new esc's will arrive soon, and I will get everything plugged in and see how it runs.

The plan is to see if an installation works all ok, and then think about upgrading the drive esc maybe with a Sabretooth. I can install a Turnigy rx and use my Turnigy tx to improve things, I might even push the boat out and buy a PPM tx/rx??

The next step will then be getting a muzzle flash, and the mechanical recoil working, though if that gets messy I'll change the recoil for a servo, which is easy for me to do.

I have a few DasMikro Mini sound boards, so can hook one of those up, though a side by side test reveals that the Dasmikro boards don't quite have the same sound quality as the originals. They will do the job though.

It's an interesting project, I have learnt a huge amount about how the system works along the way by tinkering, and for anyone else thinking of doing this my advice is to click on those '?' found on the GUI, they provide a wealth of information on how to set things up. Using snoop is the first thing that anyone should do as it tells you what the tx is doing and controlling.

Knowing what I now know, If the TCB ever goes back into production at a good price I would buy them in an instant.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 28, 2019, 09:05:39 PM
Thanks Wibbly for the positive comments. I'm glad you're making progress on your project and that things are working. Perseverance is the key with all this tinkering and you have certainly stuck with it. Keep us posted, and as always I am happy to help with any new obstacles that spring up in your way!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: jhamm on November 29, 2019, 12:28:54 AM
Hi there,
Luke thank you for the pictures...

Wibbly,
I think you put yourself big stones in the way.
Try the simple things first and buy a iBus or SBus RX - it could not be easier.
All RC-Output at the TCB works perfect - there is no hassle.
Have a look at the 5V voltage, the 2560 board has a voltage regulator with 1A performance - that is not much.
For more than one servo you need extra 5V.
Look at the Picture, there is a 5V 3A voltage regulator.

DasMicro can not be louder or better than a TCB Mini, it only has a 1W amplifier.
Important: You need an 8 ohm speaker with good efficiency like Visaton FRWS-5
If the sound sample is recorded too loud, you get distortion.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on November 29, 2019, 02:05:23 AM
@jhamm

The purpose of the project was to see what works and what doesn't, I just enjoy tinkering with this sort of thing simply to see if I can get things to work at minimal cost. I already have voltage regulators, amplifiers etc, so I can hook up anything as the project progresses. I have created my own Elmod sound files in the past using Audacity so can load these onto the DasMikro Mini if I need to. Yes, I always use Visaton speakers, they are good, high quality speakers, and 3D printed enclosures improve the output as well. At indoor club meets we all turn the volume down, as ten tanks running indoors quickly become a strain on everyone's eardrums. lol.

There was a rumour that a US distributor was thinking of putting the TCB back into production, I have no idea if that will ever become a reality. There is a market for it now, the low cost DasMikro sound units makes it a viable proposition, but they didn't exist when Hobbyking ceased production.

Like many, I have several transmitters, but none of them are PPM or SBUS. If I bought one it would only be useful for a tank that runs this one board, which would render it uneconomic. All of my other tanks use Elmod and Clark boards (TK22 & TK40) and PWM. The Elmods are flawless, the Clark boards not so much but they do the job.

I also run RC trucks and Rock Crawlers, so my wallet gets emptied very quickly nowadays! ::)








Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on November 29, 2019, 10:59:46 AM
New cheap 20amp esc's arrived today, created a messy wiring loom to test the running gear, and it runs very well. It's set to full acceleration at the moment, but I can tweak that later. I have tested the turret rotation esc and that works as well.

I now need to sort the recoil and muzzle flash, I'm not too bothered about elevation as I rarely use it.

£10 Arduino.
2 x £5 esc's.
£9 signal converter.

Turret will add:
1 x £5 esc.
Servo £3.
Voltage regulator £5

Sound £25 Das Mikro Mini
Speaker £10?

Total around £90 doing it all as cheaply as possible.

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: jhamm on November 30, 2019, 03:20:06 AM
My opinion is,
for the hobby i use and buy the best i can get.
The TCB is in my eyes the best Solution.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on November 30, 2019, 04:40:15 AM
It's only just occurred to me that I have the entire hull and turret loom, complete with mechanical recoil and the muzzle flash unit neatly removed, all complete with screws and mounting plates, including the tx and RX18. I will see how much I can sell this for.

A friend has a PPM tx/rx so I will test the set up using that at some point and then see about buying decent esc's for the motors, and a compatible tx/rx. If it covers the cost, then it's a win/win.  ;) . I have Hobbywing 1060 esc's that I can test on it, so will try those once everything is working nicely. I can then see which components make the biggest difference from the baseline that I now have.

The project for me isn't about the best, I could have just gone and bought another Elmod, or swapped one that I already have, it was simply to see how cheaply I could get this working. The good thing about this set up is that it is all modular. If one component fails then I simply replace it instead of having to buy a complete new aftermarket board at a cost of £100+.  ;D

One question that someone may be able to answer?

I currently have two 2000mah 2S Lipo's installed. One powers the Arduino, the other powers the esc's and recoil servo. Can I assume that using a single battery will work perfectly, I tested it this way to avoid any power spikes to the Arduino, but I am guessing that this is overkill.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on November 30, 2019, 11:58:13 PM
Thanks Wibbly for keeping us posted. Your tank is running quite well from the looks of it.

One question that someone may be able to answer?

I currently have two 2000mah 2S Lipo's installed. One powers the Arduino, the other powers the esc's and recoil servo. Can I assume that using a single battery will work perfectly, I tested it this way to avoid any power spikes to the Arduino, but I am guessing that this is overkill.
Yes, a single battery should work just fine and I don't expect any issues with spikes to the Arduino, since in fact a single battery is all we use with the TCB. If your drive motors draw too much current and lower the source battery voltage too much the TCB (but more likely your receiver) will brown out (meaning reset), but that is really just an issue of a dead battery rather than spikes or temporary drops.

Just to let you guys know I am in the midst of a long-distance move and will be rather pre-occupied for the next few weeks. But keep on as you are as I suspect many others are reading about your project who aren't posting.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 01, 2019, 03:50:12 PM
The servo recoil is almost finished, and should work ok. My last task is a muzzle flash. I am looking to use a simple high intensity led, but can't see a pin allocated to one on the PDF schematic.

I see that pin 9 is allocated to the IR emitter.

Could I use that and GND for the flash led?, it would be an easy option as it will be synched to the main gun. The pulse signal may mess things up though. If there is a pin that I can use that would be even better.

I am assuming that pin 41 marked high intensity muzzle flash is for use with the Heng Long flash unit.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 01, 2019, 08:35:07 PM
The IR pin would not be a good choice because it sends out a long signal which will not look like a flash.

There is nothing to stop you using Arduino Pin 41, the Heng Long/Taigen flash unit just takes a short signal so if connected to an LED that would just be a flash.

OP Config also offers the options to configure a flash (or "pulse", same thing) on the Aux Output (Arduino pin 8) or either of the general-purpose I/O A or B (Arduino pins A9 and A8). The Aux output would be best since there is already an "Auto flash with cannon" checkbox to make it even easier (see the Lights & I/O tab).

In any case you probably need to use a transistor rather than drive the LED directly from the Arduino, and remember to use a current-limiting resistor inline with your LED that matches the specs for your LED.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 02, 2019, 01:13:11 AM
Many thanks Luke, your help and advice is much appreciated.  ;)
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 03, 2019, 06:52:18 AM
I just hooked up my Turnigy with E9XR firmware as it is a much better tx (yes, I know it's not PPM, lol).

Huge difference in tank control, I edited the acceleration/deceleration/turn etc and it is all as smooth as silk now.

My next problem is the DasMikro Mini. I see that there is a Wiki for hooking one up to the TCB, but is there any info on how to connect one to the Arduino DIY. I have a programming cable so editing settings on the Mini isn't a problem, the Tiger sounds are now loaded and play ok on another RC model.

Basically, do I need to connect the three pins on Prop 1 & 2 to the Arduino 5v/GND and Prop pins?
What are the settings to make the engine, turret and gun sounds operate correctly?

It's already on Autostart, it's really the wiring and Prop settings I am after, especially if they are different to the TCB.

Edit 1: Just had a thought. I am using a PWM receiver and a signal converter. The Mini uses a pass through cable. It usually plugs into the Mini, and the Y lead is then plugged into the receiver and an esc. Will it work if I plug the Y lead into the receiver and the PWM>PPM signal converter? It will read the throttle stick and should theoretically generate the sounds. I might give that a go and see what happens.  ;)

Edit 2: It works perfectly. Super easy just plug the Mini in, in between the standard PWM receiver and the signal converter, video to follow.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 03, 2019, 08:54:11 AM
Hi Wibbly, the TCB and the Arduino operate identically so all the settings on the Wiki for the TCB will apply in your case as well.

As for wiring, you are correct - you need to connect Prop 1, Prop2 and Prop 3 to Arduino pins 22, 23, and 24 (you can use all three Props with the Benedini Mini, but only Prop 1 and 2 with the Micro or Micro clones). Then as you say provide +5v and Gnd to the Benedini (you only need to provide it once, it doesn't have to be copied on each Prop input).

As for using the Y-lead directly from your receiver - yes, you can do that if you want, but at that point you are bypassing completely the TCB so the engine will probably not be synchronized and I don't know how the Benedini would know to play the sounds like the machine gun and cannon unless you program those into your transmitter separately which I think would get to be too complicated.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 03, 2019, 09:52:49 AM
Hi Luke,

A quick video of the engine sounds, it seems to work ok, I can't test the turret sounds until I have completed the servo recoil, which is my next job. It's running like a dream now, just needed a decent tx and tweaking the motors via the config.  ;)

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 03, 2019, 11:36:33 AM
I’m glad to hear it! I hope others will be encouraged by your experience to try the same thing. 
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 04, 2019, 03:16:37 AM
After having tried to get the recoil to work, I have drawn a blank.

Tried using a voltage regulator to power the servo +/-, with the signal going to pin 25. No joy. I discovered today that the digital readout was inaccurate. I set it to 5.9v as the servo's are 6v. A multimeter revealed that the actual output was 6.5v. Damned Chinese electronics...will need to test the servo's on another model to check that they aren't blown.

I also tried using the Arduino 5v, pin 25 and GND, but still no joy.

The best I got was a servo that operated over a small range at all four corners of the left stick, whilst a barely moving pulse in the gun fire position.

Has anyone got any suggestions?

Edit: Note to self...when tidying up wiring ensure that pin 33 is in pin 33 and not 34. I had put it into Repair Mode, as Snoop revealed.


I still had the problem where the low voltage warning would simply shut the board down.
I took a look back through the info available on the site and found a reference to pin 15? Should this be pinned to GND to activate the LV warning correctly?




Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 05, 2019, 08:58:02 AM
It sounds like you have the servo wired correctly - pin 25 to servo signal, plus +5v and ground or 6 volts if you want, servos usually aren't very picky about source voltage.

If you had it in repair mode then the servo would not recoil when you fire the cannon, but it sounds like you corrected that.

It could be that for some reason the recoil servo's saved endpoints are just too narrow so it doesn't look like it's doing anything. It would be worth going through the recoil setup menu, that will tell you both if the servo is working correctly but also of course let you set up the endpoints to your liking.

You can read about recoil setup on this page (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:operation:specmenus) and there is even an instructional video. To enter the recoil menu first dipswitch 3 and 4 have to be off but since they aren't even connected on your 2560 they are already off by default. Then you have to "press and hold the input button for 2 seconds." This button (or it can just be a wire) connects to Arduino Analog input 14 (ADC14), and you "push" it by connecting it to ground.

It would be good to do this while Snooping so you can get confirmation that things are working correctly, as you won't probably have the green and red LEDs as visual aids.

I still had the problem where the low voltage warning would simply shut the board down.
I took a look back through the info available on the site and found a reference to pin 15? Should this be pinned to GND to activate the LV warning correctly?
Arduino Pin 15 is the input for digital receivers (SBus or Ibus), but I think you mean pin A15 (or ADC15). It can be confusing, but there are digital and analog pins on your Mega and so even though they have some of the same numbers there is a difference between 15 and A15.

Since you don't have an LVC circuit the best thing to do is disable LVC entirely in OP Config. But the other thing that would not be a bad idea is to connect pin A15 to +5 volts, that will fool the Mega into thinking the battery voltage is somewhere around 16 volts and therefore the cutoff shouldn't happen. Frankly it shouldn't happen either if the LVC is just disabled in OP Config but I don't, maybe an occasional glitch could happen if we leave the pin disconnected.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 05, 2019, 11:58:06 AM
Thanks Luke, yes I did mean A15, I should type slower... :(

I have a voltage regulator with a digital display. Press the button and it show the output voltage, press it again and it shows the input voltage, so I can use that to check the battery level, as I have an easy access upper hull. Running a 3300mah 2S Lipo should give me plenty of run time.

I'll check the servo limits, sounds easy enough.

I was looking at Sergey's schematic, it looks like his VR only has the live feed taken off it, the negative isn't shown as having a connection. I've no idea how that works with the servo. He is obviously a clever guy. ;)

Ordinarily an Arduino has both the servo GND and a battery GND onto the Arduino. I am assuming that this isn't required, and that the servo GND is the only one required?
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 05, 2019, 01:32:00 PM
Sergey's schematic (https://tankspb.com/index.php?topic=754.0) could be misleading to newcomers to electronics, but in fact what is important is that every component share the same ground and his circuit does that. Most of the shared grounds are connected up near his on/off switch so it can look like there isn't a ground for example on his voltage regulator, or that his servo outputs don't have a ground connection with the Arduino, but they do.

Ordinarily an Arduino has both the servo GND and a battery GND onto the Arduino. I am assuming that this isn't required, and that the servo GND is the only one required?
Your servo will of course always require GND and positive voltage (as well as the signal). But of those first two only the GND is necessary to share with the Arduino. As long as the ground connection to your servo connects to some wire somewhere that also connects to the ground on your Arduino and the ground on your source battery, then you are fine.

The positive voltage does not have to be shared, for example if you want to run your servo at 6 volts but the Arduino is running at 5. That's fine, they can be powered at different levels just so long as all grounds are common (this means your battery, your voltage regulator, and all devices including Arduino, servos, ESCs, etc all share a common ground).
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 05, 2019, 02:55:56 PM
Many thanks Luke. I was just looking at the VR without checking upstream to see the source of the loom.

I will go recheck all of the GND connections tomorrow, and see what happens.

Once the servo is working it's only the muzzle flash to resolve.  :)
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 06, 2019, 11:55:45 AM
I connected the servo on 5v, Sig, and GND, and it glitched.

I then connected the + and -  to the VR, and ran GND to the balance lead on the Lipo, and added GND from the servo, and - on the VR to Arduino GND.

Added the Cannon fire to the function on left stick up.

The servo worked perfectly, no glitching at all. I didn't need to run the pin 14 menu at all.

I'll solder all the joints tomorrow.

One weird anomaly, the engine starts up when I touch the left stick, as well as the right stick. It's no big deal, but I have no idea why it is doing that.

Lastly, the muzzle flash. If I hook it up on the high intensity pin do I also need to select it in the config. I tried it a couple of days ago without the box checked and the led stayed permanently lit?
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 07, 2019, 01:23:31 PM
And it's all done.

I have a Tiger 1 with great sound, perfect throttle control, recoil and muzzle flash.
All neatly installed, and not a resistor, transistor etc used anywhere.
I might wire up the headlight so that I know when it is switched on.

So, it can be done, and a thousand thanks to Luke for his endless patiience.

The only glitches I have are that the engine sounds start when I touch the left stick, as well as the right, and I am not getting a cannon fire sound. I will have to take a look at the sound file to see if there is actually one in there.

 ;D ;D ;D

PS - I'll post up a video when it is all properly back together.

Edit: I've now figured out that the DasMikro Mini is the source of the glitches. I think I just need to disable auto start and set up the sounds properly.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 08, 2019, 07:01:49 AM
Hi Wibbly, sorry I've been slow to reply but I see that the longer I've waited the more problems you have solved until now maybe there is nothing left to do. I hope you will consider doing a writeup of the details of your wiring for others to copy.

I don't know how you've got the DasMikro setup but I would suggest following the arrangement described in the Wiki. There are other ways to do it, as you mentioned before even bypassing the TCB/Mega entirely and driving it straight from your receiver, but then the sounds will not be synchronized. I assume that was what you had going on, but let us know when you get it all sorted. I'm sure your experiments will be of great use to others.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 08, 2019, 07:18:22 AM
I have started doing a write up, it will take a while to cover it all so that even a complete novice like myself can do it. Hopefully others will see it and have a go.

Having jumped through all of the hoops, I now know how to configure everything, so anyone will just be able to follow the instructions and it will work.

I changed the Mini connections so that it runs from the Arduino, but having looked at the manual I can see that I need to configure the sounds so that the cannon is triggered correctly. Rad knows the Benedini system inside out, so I will pick his brains. I am taking a guess that the engine sounds are triggered on the left (turret) stick because I have auto start switched on, rather than letting the TCB firmware handle it on the right (throttle) stick.

If I had bought all of the components from China I could have saved a fair amount of cash, and if I do another one I'll simply order everything that way.

I've been out RC rock crawling today at high altitude in freezing weather, and I need to warm up!! :-[





Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 08, 2019, 01:56:36 PM
All back together, and all working.

Just need to figure out how to activate the cannon sound from the Mini sound unit, and trigger it from the left stick up.

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 09, 2019, 01:42:13 PM
Ok, I tried the following settings, and I'm still missing the cannon or machine gun sounds.

Cannon is sound 2
Machine Gun is sound 1

I have disconnected Prop 3, this has had the desired effect of removing the engine start up on the left stick. I am assuming it isn't required for the above sounds.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 09, 2019, 02:12:44 PM
You don't need the "User Sound 2 - Play Once" function in OP Config, you only need the Cannon Fire function.

The User Sounds are extra sounds that will only work with the Benedini Mini. The sound numbers in OP Config and in TBS Flash are not related to each other. You can read more about user sounds on the Wiki page for the Benedini Mini (not the Micro), but anyway you are using the Micro so it doesn't matter at this point.

Anyway the fix is easy. In OP Config, on the Sounds tab, you need to change the sound card selection to the Benedini Micro, right now you have the Benedini Mini selected. Once you make this change OP Config should automatically remove the "User Sound 2 - Play Once" function from the functions list, because it is not supported for the Micro. But regardless go back to the Functions tab and make sure it is gone, but also make sure the cannon fire function is still defined as you have it now.

Probably that is all it will take. It looks to me like you have TBS Flash setup correctly.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 09, 2019, 04:26:16 PM
Just to clarify, I have the DasMikro Mini, hence Mini is selected in both the TBS and TCB.

I tried deleting the User sound from the functions list, and even tried changing the sound card to micro, I also unchecked the turret rotation, barrel elevation, and lights boxes.

I tried resetting the min/max stick positions for the radio in case the up stick wasn't registering, but unfortunately, the cannon sound still eludes me.  :-\


Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 09, 2019, 05:35:32 PM
Ok my apologies, I had gotten it into my head you were using the Micro clone. I forgot that only recently they have cloned the Mini, but it is not helped by the fact they call themselves DasMikro!

Ok, so you do need to select Benedini - Mini as the sound device on the Sound tab of OP Config. Then you need to refer to the Mini (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:tcbinstall:sound_benedini_v3) Wiki page. Note that we have to put sounds in a different location on the Parameter tab of TBS Flash when using the Mini (also you may have to use a new version of TBS Flash depending). Note that now your cannon fire sound (your Sound #2 in TBS Flash) will need to be assigned to slot 3 of the first coder column.

Please also read the entirety of that Wiki page to make sure the rest of your Mini settings are specified correctly for compatibility with the Open Panzer device.

That should finally correct your problem, but let me know!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 10, 2019, 02:59:03 AM
I have a feeling that as my TBS Flash is v1.0.1.4 that this may be causing a conflict between the TBS and the TCB. The DasMikro is v2.08.

I am not too sure how the diagnostic screen works, if I click on Read all of the fields go blank, if I try and edit the existing values then it won't let me.

If I start the tank with the USB attached, select Sound 2 (cannon) and click on Execute, it plays the cannon sound, so the TBS knows it is there. I am wondering whether the TBS needs the correct values in Prop settings so that it knows when to play the sounds when it gets a signal from the TCB. The engine sounds work ok, so it must just be Prop 2 that isn't seeing what it should.

If all else fails I have a friend who has the latest TBS Flash, so I may pay him a long overdue visit, hook the tank up to his pc and see if this makes a difference.

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 10, 2019, 06:07:47 AM
I am wondering whether the TBS needs the correct values in Prop settings so that it knows when to play the sounds when it gets a signal from the TCB. The engine sounds work ok, so it must just be Prop 2 that isn't seeing what it should.
Yes I think that is the case. To use the Mini with the TCB (whether it be Benedini's or the DasMikro) you will need TBS Flash v3 or v4. Flash v1 will only work with the Micro sound cards and even then with more limited options.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 10, 2019, 07:04:31 AM
I've just been playing around with it, trying all sorts of different combinations.

I managed to get the cannon sound but only when it was somehow linked to the Engine Start. I also had it on left stick down left, and even playing after the engine shut down. Need to figure out which parameters move it to left stick up.

The sound is there, the TBS can play it, and the TCB can play it. It's now a matter of identifying what correctly triggers it.  :o


Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 10, 2019, 11:53:56 AM
I really don't think you will get it to work with your version of Flash because the Mini won't know what values to expect on the Prop 3 input which for the Mini is what we use to play all the sounds (except engine sounds and the repair sound, which go on Prop 2). When using the Micro we don't use Prop 3 at all and cannon and machine gun get set to Prop 2, the positions of which are hard-coded in the Micro so that is easy.

But with the Mini it needs to know in advance all the various positions of Prop 3 (there are 16 positions) and Thomas Benedini was kind enough to create a utility on the Diagnostic tab of Flash v3 and v4 where you can import a PropSettings file to tell the Mini what these positions will be. But Flash v1 has no such ability.

If you are getting some cannon fire sounds on engine start or odd positions of your turret stick then probably what is happening is that the Mini is using some default assumptions about the 16 positions which do not match what your TCB is actually sending, so instead of playing the cannon sound when it is supposed to it is playing it at some other time under some other conditions.

I know all this is frustrating, but what the Chinese cloners don't make very clear is that their products only work with Thomas's software and Thomas is only giving out his software to people who have actually bought a product from him. One of the very reasons why he has continued to release new versions of TBS Flash is precisely so he can stay ahead of the clone game and hopefully add features that will not work with the bootlegged software.

What I can say is that the Open Panzer firmware, even on a DIY Mega board will absolutely work with Thomas's sound card, but I can only guarantee it when the official products and software from Thomas are utilized. I don't personally mind people trying other things, it's not costing me money either way, but I think most of the time it's not going to work.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 10, 2019, 02:54:07 PM
I don't blame Thomas in the slightest for taking this approach, it is his product and it must have been as frustrating as hell to see the Chinese cloning it.

I have Micro boards, so I'll try using one of those.

The Mini clones were bought for RC Trucks, and they will work fine on those, so it's not wasted money, it would have been good if they worked with the TCB firmware though. ;D

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 12, 2019, 08:08:18 AM
Update:

Finally got around to loading the Tiger 3 sounds onto a 'micro' board.

The Parameters and Diagnostic screens are shown below.
The OP is set to 'Micro'.

I've tried Prop 3 connected and disconnected.

Still no cannon sound?  :-\

Interestingly the engine sound is much the same to my untrained ear on both the mini and the micro.
The Benedini Flash is on autostart, it now starts the engine sound as soon as power is connected.

If anyone has problems with their FTDI USB UART, the driver they should try is v2.10.00. FTDI and Windows conspire to remove it, so if your FTDI stops working you may have to reinstall it. Windows Updates sometimes replace it with a later version that won't work.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 12, 2019, 10:21:48 AM
Hi Wibbly, you have the Prop2 Type set to "2nd Coder 2-Key" but it should be "Function 1/2" (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:tcbinstall:sound_benedini_micro#flash_-_parameter_tab). I know, they look similar, but do very different things.

Leave Prop3 disconnected, it isn't used with the Micro and will only confuse it.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 13, 2019, 08:17:56 AM
I have hooked up the Micro board.

All settings as you have described in the Flash, and I am part way there.

As soon as I power the tank up the cannon sounds, but it repeats non stop. The only way to stop it is to turn the tank off.

Prop 3 isn't connected, just Prop 1 & 2.

If I pull the Prop 2 plug from the Micro while it is generating the cannon sound, it still carries on?

Hopefully you will know what is causing this, I have checked all of the pins and connections, but drawn a blank.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 13, 2019, 08:24:55 AM
Can you post your OPZ file for me to look at, and also your parameter file from TBS Flash (.tbp file)?

You might also check Snoop to see if it shows anything useful.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 13, 2019, 09:43:03 AM
I've got these two, but can't see the *.tbp file, even a search doesn't throw anything up?

Just realised I probably need to generate it...will follow soon.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 13, 2019, 09:48:10 AM
I've got these two, but can't see the *.tbp file, even a search doesn't throw anything up?
Yeah, in TBS Flash go to the File menu and select "Save Parameter" and select a location on your hard-drive.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 13, 2019, 09:55:23 AM
Also, thank for the snoop file but my thought there was to try firing the cannon and see what Snoop says, just to make sure it is reading your transmitter correctly.

One other thing - I see you have the engine set to auto-start with throttle. I haven't tested this with the Micro but it might not work very well in keeping synchronization. The Micro has some limitations when it comes to the engine starting and stopping. You can read here the recommended way to control the engine with the Micro (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:tcbinstall:sound_benedini_micro#engine_sounds), which involves a 2-position switch on your transmitter.

I also see a bug in OP Config in that when you select the Micro on the Sounds tab the turret and elevation sound checkboxes should be hidden since they don't do anything with the Micro. This is just a visual error and isn't related to the issues you're having with the cannon fire function, but it's good you helped me notice it.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 14, 2019, 06:39:42 AM
The quest continues... ;D

I tried setting the 'gear' two way switch on the tx to Engine On/Engine Off. What this actually does is engage and disengage the transmission.

I have tried autostart set to off on both the Micro and the TCB, but the second I turn the power on the cannon sounds repeatedly. I can even unplug Prop 2 and the cannon sound keeps going. If only connect the USB and activate the OP Config this will also activate the repeating cannon sound.

It seems that the cannon sound is triggered by power to the Arduino rather than any switch on the radio, or setting in the OP config, or Flash ?

I only just noticed that you are in Amiens...I used to live close to Chateaubriant further west. I've been down your side a couple of times to see the WW1 sites etc. ;)


Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 14, 2019, 07:06:10 AM
In my experience when things are going this crazy something very simple has been overlooked. You mention that your transmitter switch engages/disengages the transmission. That is not correct if what you assigned the switch to is "Engine - Toggle On/Off." Are you possibly using a mis-matched version of firmware on the TCB with software in OP Config? Update both to the latest to make sure they are compatible with each other.

Then forgetting the Benedini for the moment, verify that your transmitter is triggering the correct functions that you expect with the correct stick/switch movements using Snoop. For example you should be able to see the cannon fire displayed in Snoop when you move your turret stick up. If not, get those things resolved, either by running through Radio Setup again, or double-checking your function-trigger assignments, etc...

As for the Benedini, are you remembering to write the parameters to the device when you change them in TBS Flash? You may also want to re-write your sounds to the Benedini just to be safe.

Re Amiens, I only just moved here a couple weeks ago from the USA. I'll be here for the next several months. Where are you located in England? I may be heading over there later next year.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 14, 2019, 07:26:20 AM
It appears that I misread the instruction:

Quote
Due to the way the engine is started on the Micro, if you assign the individual “Engine - Turn On” and “Engine - Turn Off” functions on the TCB to a 2-position switch on your transmitter, the Micro will begin playing the engine sounds when you turn on the device, even if the switch on your transmitter is on the Off position. In order to avoid this, use the “Engine - Toggle On/Off” function instead of the individual on and off functions, and assign that to a 2-position switch. One position will toggle the engine, the other position will do nothing. Keep the switch in the nothing position when you start the TCB and it will then remain synchronized with the Micro.

I'll try again using the correct function... :(
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 14, 2019, 08:06:41 AM
Just to check, should I be setting:

Micro - Autostart off, but set to Engine Sound or Manual Start.
TCB - Autostart off.

I tried swapping the Engine On, Engine Off, for the toggle, but it is still engaging and disengaging the transmission. The engine sound starts as soon as the power is switched on.

The repeating cannon sound has gone, but it won't generate the sound on left stick up.

I am in no rush with this, so please don't think that I am expecting instant responses, I can pick up the replies anytime. :'(
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 14, 2019, 08:22:30 AM
Hi Wibbly, if I'm sitting in front of the computer anyway I don't mind responding. :)

For the engine settings, the Wiki in its current state is confusing and I need to update it.

EDIT: this message was a bodge. Here is an edited version:
For the Micro the Engine Type in TBS Flash should be set to "Autostart." In this case the Micro will start the engine sounds as soon as the throttle is advanced and it will stop the engine when idle for 20 seconds. You still need a function on the TCB to start the engine, and the TCB will conveniently blip the throttle signal to the Micro when that function is called. But since there is no way to tell the Micro to turn off the engine the best method is to make the TCB match the Micro settings. In that case, go to the Driving tab of OP Config and check the option to "Auto Start Engine with Throttle." Then also tell OP Config to "Auto Stop Engine when idle for: " and select 0.3 minutes (approximately 20 seconds).

The transmission is automatically engaged by the TCB as a convenience to the user whenever you start the engine (subject to a user-defined delay that you can set in OP Config). So that is why you are seeing that message in Snoop. 

I didn't see in Snoop that you tried to fire the cannon. While Snooping try moving your turret stick up and see if Snoop shows cannon fired.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 14, 2019, 08:55:10 AM
Good grief! The Wiki really needed some changing, my apologies. The whole bit about using a switch to toggle the engine should have gone under the Mini page on the Wiki, and not the Micro page. In fact on the Micro there is only one engine-start option that is supported, and that is Auto Start (set in TBS Flash). Under this method the Micro will auto start the engine with the first blip of throttle (which the TCB automatically sends when you start the engine using a TCB function). The Micro will also auto-turn off the engine when idle for 20 seconds. I have updated the Wiki on these topics.

You still need a function when using the Micro to start the engine, and technically this can still be a switch, but there will be no way for the switch to turn off the engine, only on. With the Micro the only way to stop the engine is for the Micro to detect idle for 20 seconds. So in this case it probably actually does make most sense to for the function to start the engine on the TCB to be the built-in function that is selected with the "Auto Start Engine with Throttle" checkbox on the Driving tab of OP Config. In that case you don't need to create any other function triggers for engine stuff, just check that option and blip the throttle.

So ignore most of what I said about engine stuff above and I will go back and edit it.

However it sounds like your main issue has been the cannon fire sound which I hope we can still resolve.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 14, 2019, 10:22:44 AM
Lol, that was exactly what it was doing originally, I thought I was going mad, I was checking and rechecking the wiring, the TBS flash parameters, and the TCB.

I'm just glad it was working it was designed to do.

Ok, I will revert it to how it was, and await a suggestion for the cannon sound. No rush at all.

The only pointers I can give are that the muzzle flash is working off the high intensity flash pin, and that the servo recoil works fine, and that both are driven off left stick up centre.

If the missing sound can be linked to a function, I can add it to the same trigger. Your knowledge is far greater than mine, if the TCB is reading the TBS sound library and can isolate individual sounds, then being able to read Sound 2 from the function set up would solve it. Then again I may be hallucinating.... :(

I did wonder whether the cannon sound defaults to a different trigger, but tried all stick positions and switches (though none of the other switches are active) to no effect.

(Just for anyone that is reading this and wondering what the TBS parameters are on the right side, PWM etc. The Benedini is primarily a sound board. These settings allow anyone to create a sound, and then trigger a servo when the sound is activated, the far right parameters determine the servo range and speed. It's quite clever, as it can drive two devices, such as a linear servo or a standard servo, it can even be linked to lights).
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 14, 2019, 11:46:58 AM
Ok, if the flash and servo recoil are working on left stick up then we know the function trigger is working (you could have used Snoop also as suggested).

The other thing you could try is putting a regular hobby servo on the Prop 2 output that normally goes to the Micro. We are just sending regular servo signals to the Micro so its fine to replace it with a servo instead.

When used with the Micro the Prop 2 output has three positions - servo center which tells the Micro to "do nothing." Cannon fire is one extreme, and machine gun is the other extreme. When you fire the cannon the servo should blip over to one side if the signal is being sent correctly to the Micro. The blip won't last very long and your servo will probably not have time to travel all the way to one end because the signal is rather short, but you should still see the servo blip.

If you assign a "Machine Gun - Fire" and "Machine Gun - Stop" function to some other control on your radio you should see the servo move the other direction. This one is easier to see visually because when the machine gun is turned on the signal is sent and held until the machine gun is turned off, whereas the cannon fire is just a single quick pulse.

If that works then we can assume the issue is with your Micro somewhere.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 16, 2019, 03:44:49 AM
Hi Luke

Quick question. Haven't had a chance to test the Micro signal with a servo yet, well I did try it but the servo never moved a muscle, but I need to check it isn't a duff servo just to be sure.

If I can get to a friends this week, and get him to download V3 or later of the TBS Flash, would this theoretically allow the Mini board, rather than the Micro, to function seamlessly? I only ask because the engine start (blipping the right stick) is a much better way of starting the tank, and also shuts the sounds down after a few seconds of idle. The board is quite loud, so having it auto shut down would be the preferred way to go.  ;)
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 16, 2019, 05:42:54 AM
Yes, if you can get either Flash v3 or v4 then you should be able to use your Mini.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 16, 2019, 02:30:02 PM
Managed to test the servo on Prop 2, with the Micro. I hooked up the servo +/- to the VR and the signal to the Prop 2 pin on the Arduino. Blipped the left stick up and the servo went one way, so I am assuming that this confirms the correct signal going to the micro.

I will have to wait till I can get access to V3+ Flash to check out the compatibility of the Mini board. Hopefully within the next few days, it's a 140 mile round trip!  :o
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 17, 2019, 01:42:28 PM
Having visited a friend, and having had a play around, I now have everything working. Eg Engine sounds, and cannon fire. I used the Mini board, and set everything up as per the Mini wiki.

One exception, I had to use Autostart in the TBS Flash, as otherwise I got the start up sound on right stick up, but once that stopped there were no running engine sounds.

It was downloading your parameter file for the Prop settings that did the trick in the end. As to whether this file will work on the old version of Flash I don't know?

It would appear that Flash 3 or 4 is required to allow the DasMikro boards to play with the TCB nicely, but as to whether there is a way around this, only you will know.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 17, 2019, 04:27:12 PM
I did it, the DasMikro Micro, now plays the Cannon sound, and without using TBS Flash 4.

It was the engine start up sound glitch with the Mini that made me think.

Screenshots are attached of the settings that I used. I used the Tiger 3 soundset. The bottom two sounds will need to be removed as they take up to much memory, they are only voices anyway.

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: jhamm on December 18, 2019, 12:05:20 AM
Hi Wibbly,
this isn´t new information...
Look at the Wiki?http://openpanzer.org/wiki/doku.php?id=wiki:tcb:tcbinstall:sound_benedini_micro (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:tcbinstall:sound_benedini_micro)

The 2nd Coder start the Cannon or Machine Gun Fire which is Sound 1 and 2 at the Playlist.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 18, 2019, 04:37:25 AM
Hi Wibbly, I'm glad you persevered. Yes, the Micro will work with Flash v1 (as will even the Mini), you just don't get as many features.

It's funny, but from your most recent screenshots I don't see how you've done anything different than what was in the Wiki, or for that matter, what you appeared to have been doing earlier this week. You mention the "engine startup sound glitch" but I'm not sure if I know what that was or if you resolved it.

Do you know what it was exactly that was preventing the Micro from working before, that you have since changed? It would be good to know.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on December 18, 2019, 11:41:32 AM

The boards arrived, it remains to wait for the arrival of the necessary radio elements and nodes.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 18, 2019, 03:21:42 PM

The only changes I made were to which slot the main gun sound was in. The only way that I got it to work was by having one sound in that slot. Anything in slot 2 just repeats as soon as the power is switched on.

The gun sound will only operate if the left stick is about 1mm to the left of centre at the top, otherwise i just get the flash and recoil. I don't know if this is due to the Prop settings in diagnostics, it seemed to work ok when I tested the mini. The v1 won't allow uploads of settings, the v3+ allows Luke's files to be uploaded.

I am happy with it as it is, and may build another system as I have a Leopard 2A6 sat on the shelf, as well as an M41 Gorilla, neither of which have control boards fitted. The motor control is as smooth as silk.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 19, 2019, 01:33:04 PM
From all your previous screen shots it looks to me like you had the cannon sound assigned to position 1 of the 2nd Coder column in TBS Flash, which is correct.

What it almost looks to me like is that the change that fixed it is was this earlier suggestion:
Hi Wibbly, you have the Prop2 Type set to "2nd Coder 2-Key" but it should be "Function 1/2" (http://openpanzer.org/wiki/doku.php?id=wiki:tcb:tcbinstall:sound_benedini_micro#flash_-_parameter_tab). I know, they look similar, but do very different things.

Only in your most recent screen shot do I see this now assigned correctly. The incorrect setting there certainly could have caused your machine gun sound to repeat incessantly.

The gun sound will only operate if the left stick is about 1mm to the left of centre at the top, otherwise i just get the flash and recoil. I don't know if this is due to the Prop settings in diagnostics, it seemed to work ok when I tested the mini. The v1 won't allow uploads of settings, the v3+ allows Luke's files to be uploaded.
This sounds strange, theoretically if the flash and recoil are going then the signal is also being sent to the Micro, moving the stick over a bit won't change that signal at all. So no in this case it is not an issue with the Benedini Prop settings and anyway those settings are mostly for Prop3 which we aren't using on the Micro anyway.

You could try moving those various cannon fire functions off the turret stick and assigning them to a switch on your transmitter and seeing if the problem goes away. Although the behavior you describe shouldn't happen, I also don't think the turret stick is really an ideal trigger source if you can avoid it.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 19, 2019, 01:34:11 PM

The boards arrived, it remains to wait for the arrival of the necessary radio elements and nodes.
I like the black! And we will be waiting patiently to see your experiment progress.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on December 19, 2019, 01:52:12 PM

The boards arrived, it remains to wait for the arrival of the necessary radio elements and nodes.
I like the black! And we will be waiting patiently to see your experiment progress.

LukeZ!

Thank you very much for your work in creating all your projects!
I consider them the best solution, with awesome support!
As soon as all the components are delivered and I will assemble the minimum configuration, I want to make a separate topic where I will describe all my first experience in mastering from the first steps - manufacturing.
I would be grateful if you transfer my messages there.

Further setup and more.
I think it will be correct for a separate topic to appear, and someone could repeat my steps.
I’m going to separately post after successful experiments of the initial configuration (only TСB board and drivers) all the files and the operating time of my version of the board and configuration profiles.

I am building your project, with my changes, for my first tank, I have a base HL M26.

I don’t have any experience before in building tanks, the basic electronics of HL tanks have very few features and functions.

P.S. I did not expect PCBs to look so good, this was my first experience with such an order. But I already found the shortcomings of my design, for example, the holes for the pin panels are very large.
It will be necessary to pay more attention to the study of the nuances of designing printed circuit boards.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Wibbly on December 19, 2019, 04:42:49 PM
Hi Luke

Quote
You could try moving those various cannon fire functions off the turret stick and assigning them to a switch on your transmitter and seeing if the problem goes away. Although the behavior you describe shouldn't happen, I also don't think the turret stick is really an ideal trigger source if you can avoid it.

I had exactly the same thought. There is a spring loaded trainer switch on the tx, I am going to transfer the functions there and everything should fall into synch. The only reason I hadn't done it when I started the project was because I had freshly installed ER9X firmware and didn't have a clue how to use it. I have since figured it out.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on December 23, 2019, 08:13:10 AM
As soon as all the components are delivered and I will assemble the minimum configuration, I want to make a separate topic where I will describe all my first experience in mastering from the first steps - manufacturing.
I would be grateful if you transfer my messages there.
I agree, a new thread dedicated to your project will be a good idea. It might be difficult to extract your messages and their replies from this thread but hopefully you can just give an introduction of what has already happened and then continue from there. Feel free to start a new thread in this forum (TCB Dev) whenever you are ready.

P.S. I did not expect PCBs to look so good, this was my first experience with such an order. But I already found the shortcomings of my design, for example, the holes for the pin panels are very large.
It will be necessary to pay more attention to the study of the nuances of designing printed circuit boards.
In my experience no matter how careful I am in the design stage, there is something about holding a physical board in my hands (as opposed to looking at it on the computer screen) that makes clear all kinds of things that should be done differently!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on January 06, 2020, 08:00:00 AM
It remains to wait a bit.

Not all lots have arrived.

I will say that this is an exciting lesson and quest!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Alexk on January 06, 2020, 11:18:33 AM
After sitting on it for almost a year I have also finally sent my arduino mega open panzer tcb shield and received them today.
they are for the standard arduino mega instead of the mini which resulted in most ports being clustered in the middle.

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on January 08, 2020, 09:33:48 AM
Both designs look very interesting in their own unique way. I guess you both will have some reflow soldering in your future, I'll be interested to hear how you find it, but in my experience it is not too difficult with the right equipment (which can be inexpensive) and much easier than trying to solder very small components by hand.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on January 09, 2020, 10:09:47 AM
Hi LukeZ!

Reflow soldering paste at home "on the knee" does not seem to me anything complicated.

The simplest is a kitchen stove with temperature control such as REX-C100 + glass.

I also have a soldering hair dryer.

Today I received Arduino Pro MEGA2560, and decided to play around, try out OP Config while the rest of the radio elements are traveling.

I managed to flash, judging by the OP Config logs.

But when I try to connect to OP Config, the port is selected correctly, I tried all the speeds - there is no connection.

I have two options, what is the problem, one is correct one is not.

1. I use Arduino Pro MEGA2560 embedded version from Robotdyn, their bootloader is not correct. It is necessary to reflash.

2. OP Config only works through Bluetooth.



Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on January 09, 2020, 10:58:48 AM
Did you remember to set Arduino pin A12 to ground (http://openpanzer.org/forum/index.php?topic=16.0)? That pin will tell the TCB firmware to communicate over USB instead of the alternate serial port. You don't need bluetooth but you do need to set that pin to ground. It is also a good idea to set pin 33 to ground as well (this tells the firmware that you are a fighting tank instead of a repair tank and will help you avoid some troubleshooting problems like why is the cannon not firing?)
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on January 09, 2020, 11:16:22 AM
Here I am a stupid military moron!

As in that proverb - the elephant did not notice!

Sprinkle my head with ashes and go read FAQ!

Shame on me.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on January 09, 2020, 11:37:59 AM
Ha ha, it happens to all of us, don't worry!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on January 09, 2020, 11:58:31 AM
LukeZ, I can’t imagine what kind of person you are.

I seriously recommend inspecting your back in the mirror.

There should be wings with white feathers.

(https://i.pinimg.com/originals/6e/ec/38/6eec38c8cf09df6e9f7fc749f1972f84.jpg)
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on January 09, 2020, 01:03:52 PM
I can assure you there are no such things on my back!  ;D
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Snipah on January 13, 2020, 02:27:54 AM
Reading all this with interest can I ask a question regarding prototyping boards.
Before you rush off and have them made would 3D printing one to view in your hands help? At least with your dimensions and holes + its relatively cheap?
Just an idea!

Cheers Snipah :-)
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on January 14, 2020, 08:24:17 AM
Interesting question, but in my experience the cost of bare PCBs is probably no more than the cost of 3D printed part, and I'm not sure if the file formats would be the same in any case. Of course if you have a 3D printer laying about already then you could try it!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on January 14, 2020, 08:39:10 AM
It seems to me pointless to prototype using a 3D printer.

My main mistakes in designing my version of TСB are unnecessarily large openings for connectors, and more functionality could be added.

It is only my fault and inexperience as well as inattention when designing a printed circuit board.

Of course, there are still errors from the technical point of view of the wiring of the conductive tracks, but I do not have the education to understand what I did wrong.

Ordering the first 10 boards, at the first registration costs incredibly little, thanks to the discount of the PCB manufacturer.

There are many ways to get this discount more than once ^ _ ^
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on January 24, 2020, 06:03:08 PM
Well, I soldered.
I start tests and study the settings.


Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: jhamm on January 25, 2020, 06:42:41 AM
Look excellent!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on January 26, 2020, 06:35:51 AM
Good job! I see you used a metal stencil, hopefully it wasn't too expensive. I always get the thin plastic ones since I know I'll inevitably change the design. :)

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on January 26, 2020, 11:59:26 AM
Stencil cost 7 USD.

Not so much money, and there was a big discount for the first order.
In the future, I am going to assemble a homemade plotter to cut a stencil for myself for free.
I really liked how easy it is to make a printed circuit board for your project, without much difficulty.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on February 04, 2020, 04:08:09 PM
Hi Luke,

I'm still working on my home brew TCB, and have it mostly working now.  I just came across an issue though that I need help on. For the high intensity flash I have connected a BC327 transistor for Q9, which has a little lower rating than what the TCB has listed (.8 amp, 45v vs 1.0amp, 60v).  The flash had been working, using the latest LED flasher from Taigen, but stopped yesterday when I was confirming things were all good.  I tested the flasher on another tank, and it works fine.  I tested circuit continuity okay, and then for output but no trigger so I figure the transistor has broken down. 

I noted that this is a unique transistor (PNP) for the board, and am wondering why? and if perhaps the flash is needing a higher rated transistor? Recommendations for a through hole?

BTW, I changed the Q9 resistor too, from 150 to 562 as you recommended for the BC337's, I hope that is correct??

Thanks, Jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on February 05, 2020, 06:36:55 AM
Hi Jerry, you're right, that's the only PNP transistor on the board, the reason being the Taigen flash unit needs a positive trigger. NPN transistors are more common for switching things but the way they work is they switch the ground connection, we have to use a PNP to switch the positive voltage side.

I don't believe the current rating is an issue. I don't know for sure, but my best guess as to how the Taigen flasher works is that it charges a capacitor through the always-connected positive and negative leads. The third wire which we will connect to our transistor, is only the trigger signal that tells the flasher to flash. I highly doubt it carries very much current and it may not even be necessary to use a transistor for it, but we do so in order to protect the TCB processor as a matter of practice.

You checked the output of the transistor, but did you check the output from the processor ATmega2560 (ie, before the transistor)? That would let you know if there is a configuration/software issue rather than a transistor issue.

I have not actually tested this with through-hole components myself, so some experimentation is probably to be expected before we find the right values. With your BC337 I would think the 562 ohm base resistor should be fine, but you can try upping it to something like 1k and see if that makes a difference. The precise value is not critical but the higher the value the more current that can flow through that transistor. I actually don't know what current is required on the trigger pin of the Taigen flasher, but like I say I assume it is quite low.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on February 05, 2020, 06:43:08 AM
I am just re-reading your post and I see you said "the latest LED flasher from Taigen."

I had not known they had a new kind of flasher! I just went and looked, do you mean this one: TAG120620 (https://www.taigentanks.com/taigen-parts/ele-gb/tag120620)?

I have never seen that before nor obviously tested it. I can only assume it functions the same way as the previous one, given that it would still need to be compatible with their same motherboard, but this is of course only an assumption. I wonder how it compares in terms of performance, as I rather liked their older camera-flash version...
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on February 05, 2020, 12:24:03 PM
Hi Luke,

Yes, that is the newer flash unit using LEDs instead of a neon (HV) bulb.  It performs quite well actually, and I was able to fit the LEDs and a 3mm IR emitter in tandem inside my IS3 barrel.  We'll see how it works, once I get the tank up and fully functional.

So on your recommendations, I tested the different resistors to the BC327 transistor on my test rig (I love this breadboard thing...I've been able to test a number of things on it, and with very minimal setup). 

Here are the results:

Resistor       Unloaded Vm      Loaded Vm      Flash (Y/N)

1k                2.85vdc             3.08vdc           YYY

562              3.25vdc             2.6vdc             YYY

380              3.31vdc             2.4vdc             YYY

270              3.34vdc             2.7vdc             YYY

Voltage is from Digital Fluke 115 with Max capture set on, on VDC scale.  Note all triggers flashed, indicating the transistor in the tank is obviously blown.  I perhaps damaged the junction when soldering??  It was working previously.  The strongest trigger is with the 1k resistor.  Captured voltages are not peak values so they are relative.  I guess I'll replace the transistor (ugh, its a tight mess of wires), and see if it will last. 

Yes, I checked the output of the ATmega, and it is at 5vdc and drops on the triggering of the cannon.


Thanks for the insight on the function, I'll let you know the results....Jerry       
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on February 05, 2020, 12:46:43 PM
Well your test results are good, it shows that the circuit works even with the new Taigen device, and also that the resistor values are not critical, which I suspected. And even though you get a stronger trigger with the higher resistor, I'm guessing it makes no difference to the actual flash part, since the LED is powered by the little Taigen circuit. As long as it receives the signal to flash, it will do so with the same intensity.

We can only surmise what happened with your original transistor, but maybe when you dig it out you will notice something (possibly soldered backwards - I have done that many times). I really don't think it blew out due to use because the current it needs to switch is undoubtedly far below what it can actually handle.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on February 05, 2020, 02:30:07 PM
Hi Luke,

Well, that was painful!!   I replaced the transistor in question, and well, still no go.  So on to more troubleshooting which yielded a 27 ohm resistance to positive.....turned out a cold solder joint to the 5v bus....

Its all back working now, thanks for the help.....I must have jostled things when testing and the source voltage failed to provide a good pulse to the flash card. 

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on February 05, 2020, 02:38:09 PM
I am glad you are such a good troubleshooter, some of these problems would be very difficult to diagnose or resolve remotely on the internet. Thankfully the problem was simple in the end (if not simple to find or fix). Onwards and upwards!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on February 05, 2020, 03:31:16 PM
Since there is such lively communication that it cannot but rejoice, the project must live and develop, and it is especially pleasing that the author did not abandon the project, I will write my question.

Although I started a separate topic in “show and tell”, at the stage of this post preparation and testing-studying the settings, I was faced with the problem that I can’t configure the settings when I:

I turn on the transmission, and the smoke machine toggle switch is turned off in turn.

The tank starts up and the smoke machine works.

To turn off the smoke machine, I have to click the smoke switch on the machine.


I read inattentively somewhere, and did not understand the settings, or is it not a bug, is it a feature?

How to make sure that if the toggle switch of the smoke machine is in the off position, when the engine starts, the smoke does not work.

P.S.

I don’t need a ready-made solution, just give me a hint where I should direct my efforts.

I’m interested in sorting it out myself, with a minimum of hints.

Спасибо. Thanks.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on February 05, 2020, 04:14:01 PM
Hi NS, another user reported this very same problem recently in this thread (http://openpanzer.org/forum/index.php?topic=220.0). It is a bug, if the smoke switch on your transmitter is in the OFF position, the smoker should not start when the engine is started.

Can you verify what version of firmware you are using? Version 0.93.68 fixes this bug, but was only just released about a week ago so I would not be surprised if you are using an earlier version.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: NS-21 on February 05, 2020, 08:20:59 PM
Yes, I read that there are some difficulties.

But English is not my native mother tongue, and yes, and the maximum that I was taught in the army was the questioning of a prisoner of war.

Do I understand correctly?

Is there some kind of problem in the code that sometimes the processing position of the smoke machine switch does not occur?

Or am I wrong configuring triggers?

I can’t say for sure at the moment what firmware I have, but I tried the following parameters of your project, and I dance with joy:





The printed circuit board works. Partially figured out how it works.

Checked by:

1. The work of the smoke machine. Damn, cool, there is a proportion. But for today, a bug is saved in the firmware, the author has a note about it, it works.
2. Tower operation (ESC with commutator motor)
3. Work and calibration of the modes of operation of the lifting tool. (as in HL on the gear motor, and from the servo, in the mode of holding the position by deviation (pan-effect)
4. Rollback tools by means of servo. I did not spread Airsoft on my board, because I did it. I parted the pins of the mikrik of the airsoftorudia, and the power unit - laughed.
5. Light, dimensions, brake light, machine gun and their configuration via USB
6. Work from the Sbus successor. (I do not have an Ibus receiver, in my version of the board I implemented work from both types).


Not verified:

1. Work of a high-brightness flash of a shot (not available, there is a connector on the board)
2. Configuring the control board through the broomstick. There is a connector, there is a blue-tooth, it’s just that his hands have not yet reached his tests.
3. The operation of the motion motors, assembled on the tank, and the setting of delays, inertia and other things have not been verified.
4. Also, the logic of the jerk of the tank during firing has not been verified. Luke made changes there.
5. The port has not been tested for connecting the sound card of the openpanzer, Benedini and others, due to the reason I do not have it. I’m working on my version of the sound card from the openpanzer (I’ll just remove the flexibility and versatility of the original as unnecessary and reduce the size).
6. The operating modes of the IR battle and its performance have not been verified. .
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on February 06, 2020, 07:30:40 AM
Do I understand correctly?

Is there some kind of problem in the code that sometimes the processing position of the smoke machine switch does not occur?

Or am I wrong configuring triggers?

I can’t say for sure at the moment what firmware I have
There was a problem with the code, but it should now be fixed with the latest firmware.

To know what firmware you have, simple connect in OP Config, the firmware of your TCB is displayed in the lower left corner of the screen.

To update firmware, first check for OP Config updates (go to "Help" menu and select "Check for Updates"). If an update is detected, install it.

After OP Config is updated, then go to "Firmware" tab and select "TCB" firmware, and click the "Get Latest Release" button. This will download the latest TCB firmware from the web. Now with your TCB connected to the computer click the "Flash" button and the new firmware will be loaded onto your board.

Hopefully that fixes the problem with your smoker switch, but if not let me know.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on February 22, 2020, 04:00:21 PM
Hi Luke,

So I've built my second 'Homebuilt TCB', now:

But it takes me a week or so to do all the wiring, testing, etc.  Which could be saved by manufacturing a board.  So I've been working on Eagle for the past few days and have gotten the schematic changed to remove all that I hadn't needed in the past, and made a board image as the program does.  Unfortunately Eagle only gives a top and bottom layer in the free version.  This apparently isn't enough for my schematic, even with the changes.  Also, I'm concerned with the size of the current pathways being too small for certain of the circuits (smoker in particular). 

I am considering renting the full version ($60/mo.), but I want to ensure I can get it done, produced, and tested before the subscription runs out.  Would you know what additional information I will need for the additional layers?  Like pathway sizes, ground planes, via sizes??  I'm new to all this, so if you have any tips, they are most welcome.

Jerry

PS:  I'll try and .zip up the schematic and board (with only the airwires) for comment also.

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on February 22, 2020, 04:09:42 PM
Hi Luke,

Here are my drawings in zip format. 

Thanks, Jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on February 23, 2020, 06:07:18 AM
Hi Jerry, you should be able to get the "personal use" version of Fusion 360 for free (https://www.autodesk.com/campaigns/fusion-360-for-hobbyists), and then the Eagle add-on is only about $16 a month, at least that's what I'm paying right now. Maybe they have increased the prices.

The TCB itself is only two layers and that includes fairly comprehensive ground and power planes! Your design should be possible to do in 2 layers too, being even less complicated than the original TCB. Possibly you are trying to use the auto-router and it says it can't be done. The auto-router is really of no use in my view; I've never used it. You can do a lot with 2 layers (manually) but it definitely is like a massive puzzle.

Looking at your design I can see it will be a challenge, but without actually getting into it I don't know how bad/impossible/practical it might be.

I certainly don't think if you are new to circuit design that you will complete your design in a single month. Eagle takes a long time to learn, and routing even longer. There are many tutorials and resources on the internet, but even so it still requires a lot of effort on the part of the individual. Just like you can't put together a 10,000 piece puzzle very quickly, neither can you route a crowded board very quickly.

Even if you don't mind paying for the full version keeping a design to 2 layers is a good exercise. I would probably suggest you try it and see how far you get, that saves you from having to buy anything. Component placement is important, try to place things near to the pins they will be connected to, this way you don't have as many traces that run all across the board and will have to cross each other. You can also give yourself more room just by increasing the size of the board, but of course that makes it more expensive to produce and also we would prefer smaller for our models...

It's really beyond my abilities to give a tutorial on PCB design and traces sizes and such, and I'm no expert myself. But for signals you can always use down to 10 mil (0.01 inches) and that is the vast majority of what you have. For high power circuits like the smoker I usually don't even use traces, but rather planes/polygons. It might be useful to examine the board layout on the TCB to see how things like the ground and power planes were done. Notice the smoker MOSFET was placed quite close to the power input terminals, as were the onboard motor outputs, and things that needed less current were progressively farther away.

You are in for a lot of work if you want to make your own boards, but it can be a satisfying hobby if that's what you want to do!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on February 24, 2020, 02:46:43 PM
Thank you Luke,

I went straight to Eagle, which is where I got the $60 price, I'll try the other route to see if it is different if I cannot get the 2 layer model to work.  $16 is a lot better.

Only 2 layers??  Hmmm, I could have sworn!!

I'll swap around the components, now that I think of it I can arrange the grounds for the interposing transistors into a central strip down the middle of the Arduino connections, and align them better, closer to their end connections.   Should make it more rout-able, 

Yes, I did use the auto router, it would take 10 minutes, and overheated my laptop a few times so I had to blow out the dust to get it to finish the calculation.....HA!!

And using polygons is new to me, I'll give it a try to see how that goes too.  I'm enjoying discovering new things like this, hopefully I can get it to work.  Not having access to a HK product has given me a reason to proceed, otherwise I'd be bored.... :)

Thanks again, Jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on February 25, 2020, 05:03:57 AM
Well I'm glad we're keeping you from boredom! That's the right attitude to have. Good luck with the Eagle routing, it is quite satisfying when you get a massive tangle of air wires all neatly routed in the end, but it can be a job to get there. I think people who like puzzles and Sudoku and things like that would probably like routing boards just for the fun of it. Someone should make a game out of it.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on March 01, 2020, 09:25:36 PM
Hi Luke,

Well, thanks again for the tip again with Fusion360.  It wouldn't load on my laptop so I installed it on my gaming computer and in the end (very confusing) I eventually got the lower price for Eagle. Then figuring out how to enable more layers took a bit too, but finally got that going.  I couldn't do it in two layers, since the through wire components are so large, so I added 2 more and got all the signals into the inner layers (or most).  It took a while even then to get them all routed.  So it all checks out, and I did the B/M today but on excel instead of in the Eagle system (talk about time consuming).  I also got the quote for the board in the on board system at $333 which I thought way too much.  But OSH Park said $10  per sq. in.($80 total) for 3 boards, which is more manageable, so I have yet to do the Gerber files. 

Anyways, chipping away at this.....Jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on March 02, 2020, 11:52:18 AM
Well you are making progress and that is a good price for 4-layer boards. OSH is definitely the best place to get prototypes in the US, unless you have special board requirements. Will be interested to see how they turn out!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on April 24, 2020, 01:35:01 PM
Hi Luke,

I hope COVID19 isn't impacting your life too much.  Being retired, it is only the stay at home that is tiresome, but then I do modeling a lot and I just got a Prusa Mini in the mail which is keeping me occupied  ;D

So I am still chipping away at the Arduino shield, and got my first set back from OSH.  I had worked a few more days on the board layout and finally rearranged it down enough to get it onto a two layer board.  That was a chore!!  I found four errors on the OSH boards after initial testing, and have those corrected so I sent version 2 off to Seed since they have thicker boards (the 30 mill OSH ones are nice, but prying off the arduino really stresses them) and I can get 10 boards for almost the same price ($49).   Once I have those tested I can share it all. 

So the reason for my post is the Robotdyn Mega2560Pro auduino boards I have been using seem to now have a defect.  The ones prior have all worked, as long as you get the right one as was brought up earlier, but now apparently they have changed the 5v on board regulator to a more recent version and on both boards I just received, the regulator has failed.  One on initial power up, and the 2nd after a few days of testing. 

Details on the 5v regulator:

Earlier boards that work fine:  AMS1117 5.0 H904LP

These, faulty boards: AMS1117 5.0 GMIC 1938

I don't know if these are clone chips or not.  Anyways, I replaced the regs on both and they are now working.

So my question is: Does anyone know of another source of the Arduino Mega2560Pro other than Robotdyn that can be flashed okay by OPConfig??

thanks, Jerry



Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: jhamm on April 24, 2020, 02:45:37 PM
Hi Jerry,
i use the cheap Mega2560 Pro Mini R3.
But i desolder the Voltage-Regulator because it deliver only 1000mA - this ist not enough for the TCB.
I use a little external circuit with LT1085CT = 3A  or LT1084 = 5A for Tanks with a lot of Lights.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on April 27, 2020, 08:10:01 AM
So my question is: Does anyone know of another source of the Arduino Mega2560Pro other than Robotdyn that can be flashed okay by OPConfig??
To answer that question specifically, any board with an ATmega2560 processor can surely be flashed by OPConfig, but I understand your actual issue is the regulator on these. It may be that the regulator on those boards is not so much faulty as they are unable to handle the loads your shield may require, as Jurgen says (on the other hand, being a Chinese product I also would not be surprised if in fact they are using poor quality components).

At any rate I don't have any personal experience with other aftermarket boards, but I suspect they are all going to have regulators in the ~1 amp range (the specs for the RobotDyn regulator actually says only 800mA).
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on April 29, 2020, 12:40:28 PM
Hi Luke,

Thanks for answering.  My shield does not use the 5v output from the Arduino reg, but the digital pins do output a 5v signal, so too many outputs for the little reg they installed?  However unlikely that is, I did rob an old reg chip off a parts arduino and both new ones are now working fine (it is an 800ma output also), so as you surmised, it is probably the chinese made issue.

Oh well, I've ordered from another source so we will see if they will be more reliable.  I have two Robotdyn ones functioning okay, from older manufacture, and these two new ones failed in one week.....only discernible difference (to my humble observation skills) are the 5v reg stampings.

Jerry

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on July 12, 2020, 02:41:46 PM
Hi Luke,

I'm just about finished with my shield, but am having difficulty with the airsoft.  I measured 1.7 amp max on my DVM for the airsoft unit, and I don't think the BC337 is up to the task since it won't even start the motor running.  BC337 is rated at only 0.8 amps, and the surge must be too much on motor start.

Would you have a recommended TO92 replacement in mind?

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on July 13, 2020, 01:48:38 PM
Hi Luke,

I just ordered these up to test...should work?  I hope not to have to modify the boards/submit a new board request since it took 3 months last time from Seed  :'(

jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on July 13, 2020, 04:47:48 PM
Hi Jerry, sorry for the slow reply. The ZTX651 looks like it should work fine, though I note the order of the pins appears to be reversed from the BC337, so you will just want to double check and probably flip it around when you install it.

Also, to get the full 2 amps out of that transistor you will want to reduce the base resistor to around 200 ohms, this is R4 on your schematic.

Let us know how it works!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on July 13, 2020, 09:22:47 PM
Thank you Luke, especially for the advice on the bias resistor. 

I hope to finalize everything soon if this works, all else seems okay.   I plan to share the eagle/gerber files along with BOM and details on assembly.  It should be a much easier build than the original, but same footprint and connectors though without some of the frills which I have never used in any of my 12 tanks that have OPTCBs.....

Anyway, hopefully it will help your awesome design continue on.  I cannot thank you enough.   :)

Jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on July 25, 2020, 03:10:18 PM
Hi Luke,

Well I think I'm done with my shield.  I called it 'FatFingers' since us old folks can't seem to manipulate the SMD components too easily. 

I've included the Gerber zip file, and in the Here is the FatFingers V2 boards zip is the PDF of the schematic, the BOM in excel, an assembly writeup in Word, and the Eagle files.

I hope this helps someone who wants a TCB but can't manage the SMD and flow soldering.  Let me know if you have any comments?  I've assembled 4 of these so far, with 6 more to go.  Takes me about 3-4 hours for one, but doing multiple takes less time per board.

Jerry
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on July 26, 2020, 01:43:40 PM
Jerry this is really great, I read through your write-up and examined the board in Eagle. I can tell you put a lot of time and thought into this, I was surprised to see you even kept the same mounting hole dimensions and connector layout! Thanks for being so thorough in the documentation and creating the bill of material, etc...

I have created a new section on the Downloads (http://openpanzer.org/downloads#members) page called "Member Designs" and yours is the first design to be posted, and I've included links to the various board files and resources. I also put a link to your board on OSH Park under the OP account.

I noticed you mentioned trouble getting boards of adequate thickness from OSH Park, but although they do offer a thinner option, I believe the standard selection is 1.6mm thick which is what you recommend and which I agree is better. I did a test order at OSH Park and it looks like it comes to about $40 US for 3 boards, which seems reasonable. However SEEED is also a good place to order them so that is fine as well.

This may have already been mentioned earlier in the thread, if so forgive me, but did you ever find any other Arduino Mega boards besides the RobotDyn that uses the same footprint? Jürgen mentioned the generic Chinese "Mega2560 Pro Mini R3" boards which look very similar but I can't tell for sure if they are actually the same footprint or would be compatible with your shield. Anyway, if there are others you know of that would work let me know and I'll list them in the comments.

Over the years people have built quite a few different kinds of shields and partial shields, or assembled mostly functional TCB substitutes from various parts, but this one I think is the most complete project so far. It maintains all the functionality of the original board, can be built without advanced soldering techniques, and is well documented. I really do hope you get to experience the enjoyment of seeing someone else build and run your design!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on July 27, 2020, 11:29:42 AM
Hi Luke,

Thank you so much for the kind words, especially since mine is obviously an amateur effort.  One doesn't appreciate what effort goes into a boards design until one attempts his own!!  Your layout is really a piece of art!!  I can't imagine how long it must have taken to get all those bits and pieces to align and fit on a 2 layer board, it boggles the mind.

The Arduino I've located to replace the Robotdyn that works is from ebay: https://www.ebay.com/itm/274262551130.  I have two operating, so far so good.  I hope Robotdyn has fixed the 5v regulator issue, as I fear the ebay source will eventually dry up/change.... I will try again at Robotdyn, in the near future.  I could not find another 'commercial' outlet for the board, that would be a better source?

I think the OSH boards are better quality than the Seed version.  I was replacing that pesky transistor Q7, and the pads wanted to distort/lift on me with the Seed PCB.  The OSH pads seem to be better anchored to the substrate.  The reason I got the thinner board from OSH is that they don't offer the 1.6mm board and 2 oz. copper.  I have a good friend who I went to school with that went into the electronics field, and he recommended I use 2oz copper.  I'm not sure how 1 oz would work?  I really didn't do any current calcs on the board, simply went with as large a trace that would fit in the confines for other than signals (smoker, airsoft, etc.).   Also, the purple is a nice relief from the standard green color  8)

I feel honored that I'm the first on the Members Design!!! thank you.....Jerry

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on July 29, 2020, 09:35:42 AM
Thanks for the link to the eBay boards, and on closer examination it looks to me that the pro mini boards Jürgen mentioned will also work, there are minor differences but overall it's the same footprint. I made a note about these in the description on the Downloads page.

That is a good point about copper thickness, you're right OSH only offers thicker copper on their thinner board for some reason. I did a rough calculation for the smoker portion of your board and even with the 32 mil trace width you use, and even at 2 oz copper, the maximum calculated limit of those traces is only 1.7 amps. At 1 oz copper it drops to about 1 amp. I don't recall exactly how much current the generic Taigen/Heng Long smokers pull, the heating element itself was about 1/2 amp but then there is the current of the motor as well. (Actually it seems you measured one at 2.1 amps once (http://openpanzer.org/forum/index.php?topic=175.0))

It highlights yet another of the many aspects of board design, aside from merely squeezing everything into a finite area. This is why we often use planes rather than only traces for high current signals, or polygons if we don't have the luxury of covering the majority of a board layer with copper. Another method is to run double traces, one on top of the board and one on bottom, this effectively doubles your copper thickness without increasing the trace width, though of course you need to have a clear run on both the top and bottom for that to work. Component placement also helps, we can try to locate high current outputs/transistors as close as possible to the incoming power source, in order to keep trace length short. We used all these and more on the original TCB, which was produced using only 1 oz copper. However I will say, that although more difficult to assemble, an SMD board does make life easier in other ways, for one we need fewer traces on the bottom of the board, and fewer interruptions generally on the bottom due to fewer through-holes, so this makes it easier to to have large power planes on the bottom layer.

In your case I rather doubt it will be an issue, but you can keep an eye on your boards for signs of overheating. There is still a little room to increase power handling on your design but I'd just use it and see what empirical evidence tells you before feeling like you should launch into an overhaul.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Lotuswins on July 31, 2020, 01:09:05 PM
Hi Luke,

2.1 amps....back in 18......must have been an abused smoker  8)

I seem to have melted a few down too..... :-\

So I pulled out two new, one used Taigen V2 smokers out of the spares bin and messed around for a little while. 

I hooked up my FatFingersV2 board, and put the Fluke in series measuring amps in the AVG (average) mode.  At 80 percent setting at idle, I got 0.56 to 0.60 amps on all three smokers.  It goes up a bit when increasing the throttle to 100% as set up on the board, but not much.

So I then plugged the smokers directly into the battery at 7.89volts unloaded 6 cell NiMh.  This yielded 0.73 to 0.80 amps.   

A curious thing is happening though when you let the smoker run for a while.... The current reading, starting at 0.6 amps, would slowly rise.   At roughly the 2 minute mark, the amps had increased a little over 10%.  The front of the smoker got hot, could hardly touch it....I wonder if my previous readings were maximums with a very warm smoker?  Perhaps.....

So the resistor in the stock Taigen V2 units is a NiCr wire, wrapped around a fiberglass or silicone fabric cylinder, right?  Small, but effective..  I've seen them, after much use, turn all black, burnt to a crisp.  I wonder if the heating action eventually turns the insulator to carbon, reducing the resistance causing even more current to flow?  Right now, I've given up on the smokers, just replace them as they fail since they are cheap.   HL now has a newer version though, that has an improved resistor configuration (V6.0 I think) which has the wire wrapped piece inside an insulating tube, which wicks up the fluid.  The resistor is smaller than the Taigen version, and instead of a wad of cotton to wick the fluid up, they use a little sponge.  I have one in my JS2, and so far it hasn't failed me.  I haven't done a current read on it yet, but the resistance is in the same ballpark as the Taigen IIRC.

Thanks for doing the current calcs, at least it looks like the board will survive a stock smoker.  No temperature rise on the traces was detectable after the 2 minute run above.

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on July 31, 2020, 03:53:31 PM
Thanks for measuring that Jerry, those numbers are much more reasonable thankfully! That sounds closer to what I would have expected, and well within the tolerances of your board even with 1 oz copper which is good to know. Who knows what you must have done to that poor old smoker to have it draw over 2 amps! But these things are cheap and who knows what can happen. Maybe the little air-pump got gummed up with old fluid.

I am not surprised the current rises slightly over time as the smoker gets hot, there is definitely a relationship between the resistance of a conductor and its temperature, which principle as you know is used in reverse with thermistors to measure temperature! I've only taken apart a handful of older version Heng Long smokers and I thought they just used an actual resistor, but I would not be surprised if some of the newer ones do use nichrome wire as you have found.

It is hard for me to keep up with all the continuous developments but it seems Heng Long has really been upping their game. I notice in pictures their new smokers drive the heating element and fan separately, which is a much better arrangement (we added that feature to the TCB last year). I've also seen pictures of their new differential transmission similar to the DKLM gearbox, but haven't seen it in action. I have one of the DKLM geardrives and I really like it, but I don't know if Heng Long plan to release versions of theirs compatible with all their old models or if it will only fit in certain newer ones.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Sub on May 24, 2021, 05:47:34 PM
Hi Folks.
I have been reading this thread and others relaing to a mega 2560 and think i have finally plucked up courage to have a go at a diy TCB, the information provided here with the schematic diagrams have convinced to have a go.
I am a total novice at anything like this so THANK YOU ALL FOR SHARING THE INFO.
To be honest most of technical stuff went way above my head.
Before i start i have a couple of questions if i may.

1) When using LEDS for lights off the various pins, is the pin output 5v so i would need a resistor  for correct led voltage ? I noted that on the Russian chaps schematic he used resistors on the green and red presumably board indicator leds  but not on the lighting leds, or was this just an oversight on the lighting leds ?
2) I use direction indicators on my tanks when using a TCB from the 2 IO ports on the TCB does anyone know which pin outputs these will be on the Mega board please ?.
I like to try and find all the info out before starting so as i am not bugging anyone later on with constant questions......no doubt there will be more.
Thanks in advance.
Regards.
Sub.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on May 24, 2021, 08:49:08 PM
1) When using LEDS for lights off the various pins, is the pin output 5v so i would need a resistor  for correct led voltage ? I noted that on the Russian chaps schematic he used resistors on the green and red presumably board indicator leds  but not on the lighting leds, or was this just an oversight on the lighting leds ?
Correct, all outputs from the Mega chip are 5 volts, so yes, you should use an appropriately sized resistor for whatever LEDs you intend to connect. LedCalc.com (http://ledcalc.com/) is a good site for figuring this out. Keep in mind also that each pin (output) of the Mega chip can only source a maximum of 40mA! On the TCB  board we have the Mega chip driving MOSFETS, and these MOSFETS actually switch on or off the LED outputs, so the current available on the TCB is much higher. But when you are using an off the shelf Mega board you are just connecting things directly to the processor so you have to respect this maximum current draw. As for the Russian example, I suspect he just omitted some resistors for simplicity or maybe forget to include them in the schematic, but anyway they are necessary.


2) I use direction indicators on my tanks when using a TCB from the 2 IO ports on the TCB does anyone know which pin outputs these will be on the Mega board please ?.
There is a handy PDF available in the second post of this thread (or you can click here (http://openpanzer.org/forum/index.php?topic=16.msg70#msg70)) that shows all the TCB outputs mapped to what their label is on the Arduino Mega board. You can see the the general purpose I/O A is mapped to the Mega A9 and B is mapped to A8 ("A" for "analog" which is how it may be written on your board).
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Sub on May 25, 2021, 10:09:00 AM
Hi Luke,
Outstanding service as usual, many thx for your super quick reply.
I did read that posting and thought it was the A8 and A9 pins that were utilised so looks like i am understanding the general gist of things LOL.
The LEDS i use only draw 10 ma each so i should be fine, thank you for pointing that out.

I was graciously gifted an Arduino Uno and the LCD screen that goes with it plus various other bits by a good friend and was wondering if this screen could be utilised some how with a DIY TCB using a Mega board, all the pins correspond to each other, or is my brain going way too fast for my skill level at the moment ?
It would be cool if it could be used to show what the board is doing some how, even if it was only current voltage of the battery.
Once again thank you for your time.
Kind regards.
Sub.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Sub on May 25, 2021, 10:17:55 AM
Oops re the LCD screen, that should read 2.8 TFT lcd Shield V3
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Sub on May 25, 2021, 12:08:20 PM
Hi Luke.

So here goes, I bought 2 Mega 2560 and connected them up in turn, found the com ports shown, installed the jumper from A12 to gnd.
downloaded the DIY TCB hex file and Flashed one straight away and was able to connect the TCB and all was okm  awaiting radio etc.

Now the other one, I did exactly the same, it stated com port 5, but it would not flash the firmware, it kept stating wrong com port,
I could connect to com port 5 through snoop and it showed connected, but again i tried to flash from snoop and it disconnected saying wrong com port.
tried snoop and it connected to com port 5 ?.
I have the latest OP config and latest Firmware so am now stuck anyone any ideas ?  :'(
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Sub on May 26, 2021, 10:25:07 AM
I have now concluded it must be a defective board on the communication port, it has been returned to the Vendor.
Sub
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Sub on May 26, 2021, 06:32:35 PM
Well, wired up my Mega to fit my receiver, connected dipswitches and input button, the large manifold on the right is for servo pos and neg for the tank it will be going into, also red / green leds for board read out.
Bit of a rats nest at the moment but will be cleaned up if it works, now to set radio up in OP config. I will unplug the servo connections for setting up.
Sub.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on May 26, 2021, 11:29:12 PM
Hi Sub, my apologies for the slow reply! You've made a lot of progress I see. I will try to catch up.

I was graciously gifted an Arduino Uno and the LCD screen that goes with it plus various other bits by a good friend and was wondering if this screen could be utilised some how with a DIY TCB using a Mega board, all the pins correspond to each other, or is my brain going way too fast for my skill level at the moment ? It would be cool if it could be used to show what the board is doing some how, even if it was only current voltage of the battery.
This is a good question but in short the answer is probably going to lean more to the "brain moving too fast" side of things! Of course almost anything is theoretically possible but you'd need a good understanding of coding and also I think you would need to use a different LCD than the shield you presently have. Yes, that shield will plug directly into a UNO (and probably also a Mega) but it will interfere programmatically with pins required for TCB functions. If I were going to use an LCD the better way would be to get a serial LCD unit, there are lots available, and then send the messages out the SER.1 port. But even this would pose challenges. As an aside, I had originally planned an LCD feature for the TCB and that is what the (now unused) SER.3 connector is for. But even I who know how this thing works decided it wasn't worth the trouble.

If you did want a tiny voltage display inside your tank though you could easily add one with something like this (https://www.amazon.com/MakerFocus-Digital-Voltmeter-Two-Wire-2-5V-30V/dp/B0761MG9NS/ref=sr_1_58?dchild=1&keywords=voltage+meter&qid=1622088764&sr=8-58)!


Now the other one, I did exactly the same, it stated com port 5, but it would not flash the firmware, it kept stating wrong com port,
I could connect to com port 5 through snoop and it showed connected, but again i tried to flash from snoop and it disconnected saying wrong com port.
tried snoop and it connected to com port 5 ?.
As you've returned this one and will be getting a replacement we'll hope the replacement works on the first go. But if that one also gives you problems let me know, there are several things that could potentially have been going on.


Well, wired up my Mega to fit my receiver, connected dipswitches and input button, the large manifold on the right is for servo pos and neg for the tank it will be going into, also red / green leds for board read out.
That's a great start! If you intend to use a lot of servos (or maybe even just one), I might recommend that you supply them 5 volts through a hobby BEC rather than the 5 volts from the Arduino Mega. The TCB design used a hefty 5 volt regulator that can supply up to 3 amps, but an off the shelf Mega board can probably only supply maybe 500mA of 5 volt power. That's plenty to drive your LEDs and the receiver, but a servo could potentially cause the board to brown out. It won't hurt anything to try it, but for sure if you are using more than one servo I'd get a BEC, they're cheap and plentiful.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: jhamm on May 27, 2021, 01:06:27 AM
Hello,
try a ARDUINO Mega 2560 Pro Mini R3.
It´s smaller and cheaper.

Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Sub on May 27, 2021, 05:06:40 AM
Hi, thx for the info and encouragement.
Re the servos, if i use the BEC of the speedo will that be ok or will that be limited with going through the mega too.
Or if i just use a separate power source for the servos and speedo but link all their grounds up to the megas ground will that be ok.
Regards.
Sub.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: jhamm on May 27, 2021, 05:51:24 AM
Servos require a current of up to 2 A (sometimes more) under load.
The Arduino's 5V voltage regulator AMS1117 is limited to 1A and chinese copy of the AMS1117 is limited to 0,8A.
It is very annoying when the TCB resets because the power requirement of the servos is too high.
The BEC of the ESC is often limited and only delivers up to 2A.
Therefore, an extra BEC is important.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Sub on May 27, 2021, 10:00:49 AM
Hi chaps.
Thx for you reply...so if i understand you correctly, the esc would provide about 2 amps to the board but this would only be enough to power 1 servo at max stall ?.

So i would be better off using a separate power supply for the servos as then they could draw what amperage they require from the battery  with a 6 volt regulator and just wire the servo signal wires into the Mega then leave the Mega with its own 7.2v supply from the ESC, bec to run the board and Leds, and just connect the grounds together for Mega and servos.

I have been looking through my electronics spares box

I have found 2 MOSFET modules pics attached, i think ( from my limited electronic knowledge that these could be used with the mega for switching Higher amp load applications, is that correct and for the LEDS  if i need more than the 40 mah that the mega can supply.

A lot of questions so i apologise in advance chaps, bit i am trying to learn and improve my electronics skills and knowledge...or err... lack of...LOL.
regards
Sub.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Sub on May 27, 2021, 10:29:38 AM
Hi,
Me again....at risk of becoming a PITA,  i think i have have grasped the MOSFET module and an application i could use it on, I SAY MAY have grasped it.

If i apply 6v to the vin and gnd terminals, my servo + and -  manifold to the V+ and V- terminals, then connect pins gnd to the Mega and sig to 5V pin on the mega when i switch on the mega it will provide 5v to the mosfet module switching it on and supplying the 6v from the battery plus about 1 to 3 Amps to the servo manifold if i use a heat sink over 1 amp.


Or am i just deluding myself....
Sub.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Sub on May 27, 2021, 05:12:19 PM
Hi.
Well.
Here is where i am at today.
Rx plugged into Mega and recognised, OP opened up and all radio settings added, settings updated for the tank it is going into and preferences written onto the board all without any issues.
Radio functions tested whilst in snoop, all brake lights, forward and reverse (red / green) indicator board lights working and correct way around.
Lights 1 and 2 functional, mg light flashes, cannon fire led flashes when ca nnon activated.
Servo 2 steering works, turret traverse servo works when placed into Rc output.
barrel elevation works on servo pan. This was tested with just 1 servo being moved to its relevant pin number.
Left / right turn indicators work and turn off with steering.
Engine start / stop works and i can engage and dissengage transmission.
The only thing i could not get to work was the recoil servo, snoop said the cannon was firing but the servo didnt move but led flashed....

Edit re above...now have recoil servo working, turned out i had looked at Sergeys schematic which is NOT correct as he has recoil in servo pos 4, pin 26, i found the error after going back to read the pin position PDF, for the upteenth time... the recoil servo is pin 25 servo pos 5.

Dont know if that is how Sergey's radio is set up
 BUT for any other newcomers like me, just go off the PIN PDF and be wary of some one else's Arduino set up schematics.

If i wish to use a heng long motor gearbox for turret traverse i take it i use an esc connected to pin 27 for signal and then one of my mosfet modules for power and ground ?
or will the Mega be able to pwer the ESC  on its own.

Also need to connect the Taigen sound unit to see if that works.

Just gone about as far as i can now without some advice....its working well though it appears. ;D
Regards.
Sub.
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on May 28, 2021, 07:04:05 PM
Hi again Sub,

so if i understand you correctly, the esc would provide about 2 amps to the board but this would only be enough to power 1 servo at max stall ?
There is no one single answer for every application, but simply to avoid problems a BEC would be a good idea.


I have found 2 MOSFET modules pics attached, i think ( from my limited electronic knowledge that these could be used with the mega for switching Higher amp load applications, is that correct and for the LEDS  if i need more than the 40 mah that the mega can supply.
You certainly can use those MOSFET modules to switch higher current devices, including LEDs if they will draw too much.


If i apply 6v to the vin and gnd terminals, my servo + and -  manifold to the V+ and V- terminals, then connect pins gnd to the Mega and sig to 5V pin on the mega when i switch on the mega it will provide 5v to the mosfet module switching it on and supplying the 6v from the battery plus about 1 to 3 Amps to the servo manifold if i use a heat sink over 1 amp.
Your understanding here seems correct to me, but I don't see what the advantage is of this approach. You still need to come up with a 6 volt power source, so that is yet another thing to add and wires to attach. BECs are inexpensive and you can wire them directly to the battery without involving any wires to the Mega. When you plug the battery in, or flip on the main power switch for the model, then the BEC will turn on and can provide 5 (or 6 volts) to your servos.


The only thing i could not get to work was the recoil servo, snoop said the cannon was firing but the servo didnt move but led flashed....

Edit re above...now have recoil servo working, turned out i had looked at Sergeys schematic which is NOT correct as he has recoil in servo pos 4, pin 26, i found the error after going back to read the pin position PDF, for the upteenth time... the recoil servo is pin 25 servo pos 5.

Dont know if that is how Sergey's radio is set up BUT for any other newcomers like me, just go off the PIN PDF and be wary of some one else's Arduino set up schematics.
Good catch and thanks for letting us know. It looks like he had the wiring correct, he just got the labels switched around. I edited his picture in several places where I found it on this forum, so if anyone looks at it again in the future it should be correct.


If i wish to use a heng long motor gearbox for turret traverse i take it i use an esc connected to pin 27 for signal and then one of my mosfet modules for power and ground ?
You are correct about using pin 27 for the signal to your turret rotation ESC, but again, you do not need any MOSFETs, that is an unnecessary complication. From the Mega to the ESC you need only the signal (pin 27) and a shared ground which you will have anyway. To power the ESC, simply connect it to your battery.


If there were any other questions I missed feel free to ask again!
Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: Sub on May 29, 2021, 03:23:57 PM
Hi Luke.
Many thx for all your time and patience with these questions, come to think about it the ESC have there own mosfets fitted so bit of an uneducated question on my behalf really LOL.
Thank you once again, other than a BEC / separate supply votage for the servos it looks like i am there  WOHOO.

As an aside the vendor i bought my Megas off sent me a replacement today, took about 3 seconds to connect and download the firmware, so to test it i downloaded the saved settings for the first Mega i had just done and everything was perfect.

So it looks like the other had a defect.

So i now have 2 more working TCB's.

Once again many thx to you and those that have helped.
Regards.
Sub.


Title: Re: Testing TCB Firmware with Stock Arduino Mega
Post by: LukeZ on May 29, 2021, 10:03:58 PM
Good news it was just a faulty Mega and not something worse, but at least your vendor has been very quick with the replacement. I'm glad you've met with success along the DIY route, it's not always easy I know, the manufactured TCB is complicated enough! :)
Title: Re: TCB Firmware with Stock Arduino Mega
Post by: LukeZ on February 12, 2022, 07:22:35 AM
Just wanted to mention that I've posted another member's shield design to the Downloads page (http://www.openpanzer.org/downloads#members), called the Baldock Shield by Richard Baldock. It is all through-hole components and while it does not include every last feature of the original TCB the advantage is that it is simple and inexpensive to build and would do the majority of what a lot of people would want. 

He has a thread about it also at RCTankWarfare (https://www.rctankwarfare.co.uk/forums/viewtopic.php?f=208&t=32856) if you want to read more.
Title: Re: TCB Firmware with Stock Arduino Mega
Post by: Sub on September 03, 2023, 03:53:13 PM
Hi,
I have suddenly started having an issue with my Arduino Mega 2560 diy board.
The issue is that if i connect a freshly charged NIMH 7.2v pack or 2cell lipo via the jack plug the board throws a fit by flashing all the lights on in quick time, All the lights, those on the model and board and forward and reverse indicators, the board will not function, the receiver is powered up and lights up but the board is giving the signal of no radio connection yet it is, or low voltage but it is not???
The puzzling part is if i connect a slightly used NIMH pack say around 7.5 volts the board powers up first time every time, even when i connect a 6v NIMH pack it functions correctly, but not with a fully charged pack. It is as if something is limiting the voltage going into the board at a set voltage

Does any one have any ideas how to fix this issue its driving me nuts..thx
Regards.
Sub.
Title: Re: TCB Firmware with Stock Arduino Mega
Post by: NS-21 on September 03, 2023, 04:57:34 PM
Hi,
I have suddenly started having an issue with my Arduino Mega 2560 diy board.
The issue is that if i connect a freshly charged NIMH 7.2v pack or 2cell lipo via the jack plug the board throws a fit by flashing all the lights on in quick time, All the lights, those on the model and board and forward and reverse indicators, the board will not function, the receiver is powered up and lights up but the board is giving the signal of no radio connection yet it is, or low voltage but it is not???
The puzzling part is if i connect a slightly used NIMH pack say around 7.5 volts the board powers up first time every time, even when i connect a 6v NIMH pack it functions correctly, but not with a fully charged pack. It is as if something is limiting the voltage going into the board at a set voltage

Does any one have any ideas how to fix this issue its driving me nuts..thx
Regards.
Sub.

I'm certainly not a direct expert, but there is very little data.

For example:

1. I would like to see a diagram. Have you created your own version based on a respected author's board, or are you following his design?

2. Many interesting points, but so far you have provided little information.



Like mine.

I have created many versions (about 16 software versions and four hardware versions) based on Luke's original product.

I tested the microcircuit, the main power supply was 20 volts. I shared the power, and powered the 2560 DIY version from 16 volts. I have not seen such problems.

P.S. Yes, I've had a lot of fun with this project.
Title: Re: TCB Firmware with Stock Arduino Mega
Post by: Sub on September 04, 2023, 10:15:13 AM
Hi,
Thx for your quick reply, to answer a few of your questions,
The board is a stock Arduino mega 2560, nothing i have made, it is flashed with Luke's DIY Arduino firmware, 7.2volts power is supplied to the board via the jack plug utilising the on board 5v volt regulator for running the board only and utilises a separate 5v independant board for positive and negative feeds for the ancillary components, servos, leds etc with a common negative.

I have now managed to identify and isolate the issue, i had an incling what it was and further testing has confirmed it, as i mentioned in my earlier post, it works fine on 7.4volts but not on anything more despite being rated from 5 volts to 12v input
I checked the specs and various youtube testing videos of the AMS 1117 5.0 VOLT regulator chip mounted on the board and it appears that they are equipped with a thermal regulator that shuts the chip down if it gets over voltage or over current, then re sets when cooled ( provided you have not blown the chip off the board )
It would appear that for some reason my regulator chip has become defective and its parameters have gone out of whack and it tripping this failsafe too early.

I had another chip on an Arduino Uno i was not using so removed it and soldered it back onto my Mega board and everthing is now working fine
A pic of the offending regulator chip.
Hope this may be of use if someone else has this issue.
Regards.
Sub
Title: Re: TCB Firmware with Stock Arduino Mega
Post by: LukeZ on September 04, 2023, 01:48:56 PM
Hi Sub, sorry for the slow reply. I would have guessed the voltage regulator as well, but you discovered it yourself. Good work, and thanks for reporting back.

I remember reading somewhere that some of the Chinese Arduino boards use voltage regulators which have a lower current rating than what they claim in the specifications. At higher currents, this could cause the thermal shutoff that you theorize. And the higher the input voltage that the regulator has to drop to 5 volts, the more current and heat will be created. This might explain why yours worked with a lower voltage battery but not with a higher voltage battery.

In your case it seems like the regulator worked for a long time but slowly began to fail. I guess it was just a poor quality part. I agree, hopefully this information will be useful to others.