Page 1 of 6

Arduino 2560 project

Posted: Thu Oct 03, 2019 3:45 pm
by wibblywobbly
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 (Legacy means old/previous release). 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.

If anyone else has been down this path and has any advice...I would appreciate it, either here or on the Open Panzer forum. This is new territory for me, but has to be worth a go. :wave:

Re: Arduino 2560 project

Posted: Thu Oct 03, 2019 6:11 pm
by LukeZ
Hi Wibbly,

For both you and anyone else going down this path, please check out an entire thread on this topic over on the Open Panzer Forum - Testing TCB Firmware with Stock Arduino Mega

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!

Re: Arduino 2560 project

Posted: Thu Oct 03, 2019 6:14 pm
by wibblywobbly
Thanks Luke, the plan was to copy and paste the post onto the OP forum, it was the login that was holding that up.

Haven't received the email...not in my junk. I'll send you another email address.

Re: Arduino 2560 project

Posted: Thu Oct 03, 2019 6:17 pm
by LukeZ
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.

Re: Arduino 2560 project

Posted: Fri Oct 04, 2019 1:47 am
by c.rainford73
This is very interesting. I'm following this closely. Such a great product and nice to see mr. Wibbly undertaking this one :clap:

Re: Arduino 2560 project

Posted: Fri Oct 04, 2019 5:59 pm
by dane61
:thumbup:
c.rainford73 wrote:This is very interesting. I'm following this closely. Such a great product and nice to see mr. Wibbly undertaking this one :clap:

Re: Arduino 2560 project

Posted: Fri Oct 04, 2019 6:05 pm
by wibblywobbly
I bought a 8x8 RC truck a few months ago and swapped out the 16 channel stick tx/rx for a 3 channel trigger one. I was looking through the manual today and down at the bottom of one of the pages it states that it is a PPM tx/rx?? There is nothing on the tx to say that it is PPM, so I didn't have a clue.

I might hook it up when I get the chance and see whether it works with the Arduino.

Re: Arduino 2560 project

Posted: Fri Oct 04, 2019 6:26 pm
by LukeZ
The PPM functionality is a function of the receiver and not the transmitter, so I am not surprised it says anything on the transmitter. If you can get the receiver to spit out PPM then it should work with your Arduino.

Re: Arduino 2560 project

Posted: Fri Oct 04, 2019 6:29 pm
by wibblywobbly
Sure, I was aware of that, but It didn't say anything anywhere, lol, I only noticed the mention in the manual by chance, it was well hidden. :thumbup:

Re: Arduino 2560 project

Posted: Wed Oct 16, 2019 9:37 pm
by wibblywobbly
The PPM/SBUS converter board arrived today, though the pin strips had to be soldered on before I could use it. That wasn't easy as there is very little room to get a soldering tip to the centre row.

Time to test it...

Plugged the Arduino in via the USB, the jumpers were all in place. Hooked up the rx and converter. Switched on the radio, clicked on Snoop and....

Bingo, all of the data was displayed.

Just one issue and I have no idea how it did this, but, even though I had an Arduino hooked up. Nothing connected to it apart from the PPM converter, the data displayed on screen told me it was a repaired Clark board, and that there was a Benedini Sound board connected?

I tried these items a long while back, and I am amazed that the firmware was able to detect a repaired Clark board, and the sound card...but how did it know I had even tried?? Where could it get this data from? 8O 8O 8O

Next job is to hook up some small motors and esc's to test the comms on each circuit.