Registration Notice

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

*

Offline johnnyvd

  • 165
    • View Profile
  • Netherlands
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #75 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?
* E-75 / E-100 PAK44 "monster" - in progress
* Sturmjagdtiger PAK44 - in progress
* pz.kpfw KV-2 754(r) - in progress
* T-34 88mm "Kurland Tiger" - in progress

*

Offline Lotuswins

  • 119
    • View Profile
  • Roseburg, oregon
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #76 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
IMG_0630.JPG
Testing TCB Firmware with Stock Arduino Mega IMG_0630.JPG
Views: 78
IMG_0631.JPG
Testing TCB Firmware with Stock Arduino Mega IMG_0631.JPG
Views: 75
« Last Edit: November 16, 2019, 11:41:00 AM by Lotuswins »

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #77 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. 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, 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.

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!
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Lotuswins

  • 119
    • View Profile
  • Roseburg, oregon
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #78 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

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #79 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.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Lotuswins

  • 119
    • View Profile
  • Roseburg, oregon
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #80 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




*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #81 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.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Lotuswins

  • 119
    • View Profile
  • Roseburg, oregon
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #82 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  :)

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #83 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.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Wibbly

  • 43
    • View Profile
  • Wales, UK
Wiring Question
« Reply #84 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?
Been into 1/16 tanks for over 10 years.

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Wiring Question
« Reply #85 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.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Wibbly

  • 43
    • View Profile
  • Wales, UK
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #86 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.



Capture.PNG
Testing TCB Firmware with Stock Arduino Mega Capture.PNG
Views: 45
Been into 1/16 tanks for over 10 years.

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #87 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.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Online NS-21

  • 10
    • View Profile
  • Russia
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #88 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.

*

Offline LukeZ

  • 898
    • View Profile
  • Amiens, France
Re: Testing TCB Firmware with Stock Arduino Mega
« Reply #89 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!
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs