Open Panzer

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

Title: Testing 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.

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 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.
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 ^ _ ^