Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Rongyos

Pages: [1] 2 3
1
Other Open Source Projects / Re: Standalone Tank IR
« on: January 26, 2024, 01:14:03 PM »
Very good! I suppose that does not solve the initial firing of the cannon when the Taigen MFU first powers up.

Yes, it solved the phantom firing. :)
Also I tried the airsoft-microswitch connect to try before, but somehow thats not worked. I had to wait for the big bunch of resistors I purchased.

Rongyos

2
Other Open Source Projects / Re: Standalone Tank IR
« on: January 25, 2024, 05:38:57 AM »

Only some testing can answer these questions.

Hi Luke!

I can say that testing went good. In my case R1 = 2.4K; R2 = 10k. Now it has 1,3V at resting state and 5,28 when activated at charged 2cells liion. I think this is now good to go :)

Thanks
Rongyos

3
Other Open Source Projects / Re: Standalone Tank IR
« on: January 10, 2024, 03:01:20 PM »
Hi Luke!

I didn't check the obvious :(

You are correct, if digitalRead returns 1 that means HIGH. I'm certain the Taigen MFU keeps this pin HIGH except when the airsoft is fired, at which point it is held to Ground, but that doesn't mean there couldn't be some "noise" or a very brief signal on this pin when the Taigen starts - not long enough to activate an airsoft unit, but long enough for the Arduino to detect it and fire the cannon.

So every time at least 1.9V is there in this pin. BUT! When I checked this pin switched off (fortunately my switch is disconnecting the + wire) connecting multimeter to battery +  and airsoft pin it was around 7V visible (not much less then the battery actual voltage *DOUBLECHECKED it was 6,64 - 6,62Volts). When switching on the MFU its dropped from 7V to 1.99V and stayed there until I (I mean, my dear wife :D who helped me) fired the tank and it was 7.04V again (which is the actual battery voltage)

Now that I am thinking about it, it is also likely the voltage of this pin from the MFU, when the airsoft is not active, is greater than 5 volts. Of course the Nano can be damaged with input voltages higher than 5 volts, so this could also be a source of problems. You should try to measure this pin from the Taigen MFU with a voltmeter. If it is greater than 5 volts, there are ways to protect the Arduino, but we need to know what the voltage is.

I attached a schematic. Please ignore the voltage regulator and any other stuff connected to it because it is my "future" board. I dont have the current one because I overwrote it :D :(
Please see the blue ugly stuff, the 5V is supplied by taigen receiver connector (yes it has opportunity to connect aftermarket receivers and therefore TX-es to is. This connector provides 5,02V so I using it)


Unfortunatelly no other pin which provides 5V continuously. According to the schematic the IR connector is 5V but jI didnt get 5 volt from this pin, only 4.3 at max. Servo was not working with this.

It would also be good to check some other outputs on the Taigen, there are two more options I can think of: the flash trigger, and the IR port. I don't have a Taigen to test and my memory is not perfect, but I believe the flash pins were 5 volts. If so, that would be a better choice to connect to the Arduino.

No, those are not activated until receiving a signal from a microswitch (it is located in the airsoft or recoil unit and pushed mechanically by those units). The initial triggering signal is from the airsoft, anyway :( Or.... maybe that should be solution if I connect the airsoft signal to the microswitch pin and then, the MFU triggers the gun fire function then sends out the 5V to IR. If so, I have to redesign my board again, and order it from pcb manufacturer :'(

4
Other Open Source Projects / Re: Standalone Tank IR
« on: January 10, 2024, 10:11:55 AM »
Hi Rongyos,

At this point there are so many different symptoms which don't seem to have any relation to each other, that it is hard to say what is going on.

If the board board is reseting/freezing/locking, or just in general acting bizarre (not completing the serial statements, erratic servo behavior, etc...) something is not right, but yet I experience none of these on my end. So there are two possible explanations:

1. Possibly we are still struggling with a compiler issue. I kind of doubt it, but if you want to replicate my setup I am using Arduino IDE version 1.8.13 with the AVR Boards set to 1.6.20. We already discussed changing the boards to 1.6.20, but maybe there is a difference with the compiler itself. You could try downloading and installing 1.8.13 from this link, and again make sure the AVR Boards is set to 1.6.20, and see if that improves anything.

2. The second option, is that you are using modifications to the code that are causing problems, or there are electrical issue with your custom board. Those are things only you can troubleshoot, but through a process of elimination it is still possible to reduce the number of possibilities until you find the culprit.
[...]

In summary, the only way to solve any technical problem of this kind is to simplify everything down the absolute minimum until you arrive at a state where things work as they should. Only then can you begin to make changes, one at a time, testing at each step, until a problem occurs. Then you know what the problem is.

Hi Luke,

I did some experiment with / without my motherboard; with your hex and with my hex also.
I realized that when I tought the arduino was freezed there were 2 option:

1. It wasn't, but I was 1d10t and did not set the relay pin default as "HIGH". So when I switch on the arduino the relay was always on (led is on) until I shot the cannon. Now, I made a simple digitalwrite HIGH command in the void setup and now, everything is working right :)

2. there WAS a freeze. But it is a hardware issue. I think during the experiments I burnt out the IR emitter transistor or IDK, but when I try firing now, it fires 1 or 2 and the arduino is freezing. When I remove the IR LED (only the led) there is no issue anymore. Strange, there wasn't this issue before I could make a lot of cannon fire with this PCB.


I have good news (?). The whole phantom firing is caused by the Taigen MFU. Finally I found an 5v BEC, krimped some connector and with this stable power supply (I mean the Taigen probably also stable but not the airsoft pin which I use for activate button firing) there is no phantom firing, only the servo positions itself to its home pos. SO the code was good regarding this (your and mine too). With my board, with relay, with my mods in code etc....

But, when I connect it to the MFU and power it on (via the MFU PSupply) it does a phantom firing. I tried to disconnect the airsoft wire and power it on by the MFU and it was fine, worked correctly without phantom firing (I should probably make a hotkey in windows to write "phantom firing" :D ). I assume the Taigen "switch on" this pin later. Or (worst case scenario) it is always on LOW? (When I put digitalRead its always said it is 1 (high, right?)

Can you guide me out of this mess?


5
Other Open Source Projects / Re: Standalone Tank IR
« on: January 09, 2024, 01:47:23 AM »
The GitHub is now updated with all these changes. I hope now everything will work, please let me know your results.

Hi Luke!

Thank you again for you quick support. Unfortunatelly those mods are not working. The notify led is acting strange, when I shot the cannon some time (usually 4-5 times) the arduino reset itself and stay in a strange state ("L" board led is on, relay is on). You can see the pic what I mean. When I plug in the USB to see on the serial monitor what happens, this issue is not appearing (can it be a power supply issue? If yes, why servo, recoil and hit notification working?) MOD: well, in the pic the notification led is not on (3mm red one). But most of the time it freezed at staying on :)

When I only tried the 5V trigger mod of yours there wasn't any different operation then before. Phantom firing is still there. BUT I realized 2 things, maybe connected.

1. when I power on the arduino, there is ~20degree turn in the servo, like it start firing then stops. But, it does a firecannon function and everything works fine after that.

Code: [Select]
08:17:47.916 -> ---------------------------------------------
08:17:47.916 -> BATTLE INFO
08:17:47.916 -> ---------------------------------------------
08:17:47.916 -> Is Repair Tank?   No
08:17:47.916 -> Fire Protocol:    Tamiya
08:17:47.916 -> Hit Protocol 2:   Heng Long
08:17:47.916 -> Repaired by:      Clark Repair
08:17:47.916 -> Send MG IR Code:  No
08:17:47.916 -> Accept MG Damage: No
08:17:47.916 -> Damage Profile:   Tamiya Spec
08:17:47.916 -> Weight Class:     Medium
08:17:47.916 -> (6 cannon hits, 5.0 sec reload, 20.0 sec recovery)
08:17:47.916 ->
08:17:47.916 ->
08:17:47.916 ->

2. when the arduino is on and I push the reset button, the "setup" is incomplete (or cannot do the loop, IDK what happens) and relay stays in and you can see the servo do the same thing which I wrote in the point 1. I attached a video, it is showing what happens.


I dont know, but maybe the in the Tank.ino there is code part which is waiting for the initial cannon fire to go to the main loop.

6
Other Open Source Projects / Re: Standalone Tank IR
« on: January 07, 2024, 11:37:52 AM »

Ok, I understand now. You're right, these Chinese MFUs often prefer to toggle the ground signal rather than the positive, so you were correct to use the button input D4 (which triggers when held to ground) rather than the 5 volt input A0 (which triggers when brought to 5 volts). Your friend correctly identified the problem with the 5v input which was left floating, and disabled it by setting it to OUTPUT. That works fine. For others reading this, you can do the same, or as mentioned before, add a resistor between A0 and ground if you don't want to change the code.

Hi Luke!

My happiness was not long. Unfortuntely, the phantom firing is not visible on the serial monitor, but still there.  I have another idea with this, can you please put a code which activates the IR emitter pin a little bit later? I mean, the ir pin activated or start to wait the cannon function after 2 secs from bootup.
I put a button state in every initial bootup but its value 1 every time.

IDK why this dump the battle info 3 times after uploading the code ... :/

Code: [Select]
18:27:40.756 -> Button State: 1
18:27:41.021 ->
18:27:41.021 -> ---------------------------------------------
18:27:41.021 -> BATTLE INFO
18:27:41.021 -> ---------------------------------------------
18:27:41.021 -> Is Repair Tank?   No
18:27:41.021 -> Fire Protocol:    Tamiya
18:27:41.021 -> Hit Protocol 2:   Heng Long
18:27:41.021 -> Repaired by:      Clark Repair
18:27:41.021 -> Send MG IR Code:  No
18:27:41.021 -> Accept MG Damage: No
18:27:41.021 -> Damage Profile:   Tamiya Spec
18:27:41.021 -> Weight Class:     Medium
18:27:41.021 -> (6 cannon hits, 5.0 sec reload, 20.0 sec recovery)
18:27:41.064 ->
18:27:41.064 ->
18:27:41.064 ->
18:27:51.406 -> Button State: 1
18:27:51.671 ->
18:27:51.671 -> ---------------------------------------------
18:27:51.671 -> BATTLE INFO
18:27:51.671 -> ---------------------------------------------
18:27:51.671 -> Is Repair Tank?   No
18:27:51.671 -> Fire Protocol:    Tamiya
18:27:51.671 -> Hit Protocol 2:   Heng Long
18:27:51.671 -> Repaired by:      Clark Repair
18:27:51.714 -> Send MG IR Code:  No
18:27:51.714 -> Accept MG Damage: No
18:27:51.714 -> Damage Profile:   Tamiya Spec
18:27:51.714 -> Weight Class:     Medium
18:27:51.714 -> (6 cannon hits, 5.0 sec reload, 20.0 sec recovery)
18:27:51.714 ->
18:27:51.714 ->
18:27:51.714 ->
18:28:27.490 -> Button State: 1
18:28:27.753 ->
18:28:27.753 -> ---------------------------------------------
18:28:27.753 -> BATTLE INFO
18:28:27.753 -> ---------------------------------------------
18:28:27.753 -> Is Repair Tank?   No
18:28:27.753 -> Fire Protocol:    Tamiya
.... cannot copy more lines ----> Rongyos

Referring the reload led notification, unfortunately its not working. If I set it true its on all the time, until it gets a hit, making hit notification effect but reload notification is not active.

MOD: I just realized I can shoot the cannon after being destroyed (during recovery time). It is not desirable, so I just modified the cannon.ino with this simple stuff (tested, working)

Code: [Select]
// CANNON FIRE
// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------>>
void FireCannon()
{
    if (!Tank.isDestroyed) // Check if the tank is not destroyed
    {
        if (Tank.CannonReloaded()) // Only fire if reloading is complete
        {
            if (Tank.isRepairTank())

7
Other Open Source Projects / Re: Standalone Tank IR
« on: January 06, 2024, 05:16:57 PM »
Hi Luke!

Thank you for your support! I will try it tomorrow and share the results of your modifications :)



As for increasing the length of the tank destroyed period, it is set to 15 seconds because that is the Tamiya standard. However if you want to change it, modify this value near the top of the Tank.h tab:
Code: [Select]
// Tanks is dead for 15 seconds
#define DESTROYED_INOPERATIVE_TIME_mS   15000   // How long is the vehicle immobilized after being destroyed. 15 seconds is the Tamiya spec. After this,
                                                // the vehicle will automatically re-generate with full health restored.
No, maybe I was not understandable, sorry if my English is not perfect. For me the "tankdestroyed" notify LED effects were very similar to simple hit notification. I just wanted some longer blinking after destroy to make it more clear for the user that the tank is out. If I modify this can I reach my goal? (More blinking time, significantly longer than simple hit notification, the value was 450ms before thats what your comment also said :) )

Code: [Select]
// Now set a timer to keep coming back here after a short interval so we can blink the lights
        DestroyedBlinkerID = TankTimer->setInterval(5450, HitLEDs_Destroyed);     // This is a slow blink, about half a second

I guess you are using the manual pushbutton method to trigger the canon fire? Most people probably use the signal input so I suppose that is why we haven't caught this issue before.
I will update the documentation to make this more clear.

Thanks Luke, my plan was to use the 4th pin of the regular 8pin connector which is the airsoft signal pin. It sends out gnd signal, so thats why I used INPUT_PULLUP function to trigger the cannon fire. I don't need the 5V receiving pin because of this. Achieving my plan will let the users use this unit with older Heng Long and Taigen boards (they just need to extend the 4th wire and connect to relevant connector to the battle unit). I also have 2 Taigens and my test were good except the "phantom firing", but with the simple solution from my friend it disappeared!
I will test your led modifications and let you know!

Thanks and regards
Rongyos

8
Other Open Source Projects / Re: Standalone Tank IR
« on: January 04, 2024, 12:53:03 PM »
I have a suspicion this is related to the Arduino IDE version issue that was discussed earlier in this thread. With certain versions of the IDE the code will compile but without enough memory available, and the sketch will operate very erratically, if at all.

You were right, I try to get stable 5v from anywhere, uploaded sketch to 4 different nanos and so on but didn't find that solution :) Thanks, everything working. I downloaded the IDE 1.8.5 and board 1.6.20

Can I ask something? Can you add a simple led blink on HitLeds when cannon reloaded and a little bit longer blinking when tank destroyed?

I tried the reload blink like this, but no success:

Code: [Select]
void OP_Tank::HitLEDs_Reloaded(void)
{   
    if (CannonReloaded)
    {
        HitLEDs_Toggle();
    }
    else
    {   
        if (TankTimer->isEnabled(HitLED_TimerID)) TankTimer->deleteTimer(HitLED_TimerID);
        HitLEDs_Off();
    }

Also, look at the test, I call it "almost there" :) Unfortunately, fantom firing is still there :(

Code: [Select]
19:07:13.025 -> BATTLE INFO
19:07:13.025 -> ---------------------------------------------
19:07:13.025 -> Is Repair Tank?   No
19:07:13.025 -> Fire Protocol:    Tamiya
19:07:13.025 -> Hit Protocol 2:   Heng Long
19:07:13.025 -> Repaired by:      Clark Repair
19:07:13.025 -> Send MG IR Code:  No
19:07:13.025 -> Accept MG Damage: No
19:07:13.071 -> Damage Profile:   Tamiya Spec
19:07:13.071 -> Weight Class:     Medium
19:07:13.071 -> (6 cannon hits, 5.0 sec reload, 12.0 sec recovery)
19:07:13.071 ->
19:07:13.071 ->
19:07:13.071 ->


19:07:15.205 -> Fire Cannon


19:07:31.516 -> CANNON HIT! (Tamiya)
19:07:31.516 -> Health Level: 83%
19:07:41.921 -> CANNON HIT! (Tamiya)
19:07:41.921 -> Health Level: 67%
19:07:52.162 -> CANNON HIT! (Tamiya)
19:07:52.162 -> Health Level: 50%
19:08:02.223 -> CANNON HIT! (Tamiya)
19:08:02.223 -> Health Level: 33%
19:08:12.900 -> CANNON HIT! (Tamiya)
19:08:12.900 -> Health Level: 17%
19:08:23.038 -> CANNON HIT! (Tamiya)
19:08:23.038 -> Health Level: 0%
19:08:33.440 -> CANNON HIT! (Tamiya)
19:08:33.440 -> Health Level: 0%
19:08:33.440 -> TANK DESTROYED
19:08:48.467 -> TANK RESTORED

EDIT: I tried to rewrite the button state on the TankIR loop from wasReleased to isPressed and wasPressed, no success
I use INPUT_PULLUP pinmode for my input pin, changed back to INPUT but phantom firing still there. Don't know whats next. Of course, there is no periphery attached to arduino when I checked this on tests, only the Nano was attached to USB.


My friend helped me. I set the VoltageTrigger to OUTPUT and no phantom firing occured :)

9
Other Open Source Projects / Re: Standalone Tank IR
« on: January 03, 2024, 04:21:07 PM »
Hi!

@Luke: I didn't find the "myreceiverobject.getPinNum" object where the receiver pin number has to be assigned to D2 pin of Nano.
Can you help me where I can get it? My receiver is not working right now.

An other question. Do you know where can I get constant 5V from the Taigen V3 MFU? It seems the CN2 is only providing around 1.8V

Mod.: Also when I provide 5V to my servo its little bit moving (the recoil look fine to me) when it shouldn't do that, like some kind of whitenoise

Thanks and regards!
Rongyos

Problem again: no servo recoil (every connection is good)

Problem again2: phantom cannon shot after switching on (do you remember this problem also appeared on TCB):

15:10:15.520 -> ---------------------------------------------
15:10:15.520 -> BATTLE INFO
15:10:15.520 -> ---------------------------------------------
15:10:15.564 -> Is Repair Tank?   No
15:10:15.564 -> Fire Protocol:    Tamiya
15:10:15.564 -> Hit Protocol 2:   Heng Long
15:10:15.564 -> Repaired by:      Clark Repair
15:10:15.564 -> Send MG IR Code:  No
15:10:15.564 -> Accept MG Damage: No
15:10:15.564 -> Damage Profile:   Tamiya Spec
15:10:15.564 -> Weight Class:     Medium
15:10:15.564 -> (6 cannon hits, 5.0 sec reload, 12.0 sec recovery)
15:10:15.564 ->
15:10:15.564 ->
15:10:15.564 ->
15:10:21.556 -> Fire Cannon

10
Other Open Source Projects / Re: Standalone Tank IR
« on: October 27, 2023, 02:06:20 PM »

Let me know if it works!

You are the MVP! The second one is jumper_on state :)


11
Other Open Source Projects / Re: Standalone Tank IR
« on: October 26, 2023, 02:52:33 PM »
Hi everybody!

I am stuck on modifying the code and cannot figure it out, I ask assistance:

I want to actively modify the WEIGHT CLASS value with a jumper which connect the pin D7 and GND (I defined the pin and pinMode as input_pullup) but cannot do so much stuff. I know the setup is in the begin() function so I dont want to modify the value of weight class during the loop.
Can you please help me where should I put a code like this? I am lost in the lot libraries :(
Just a draft, IDK what I am doing right now :(
Code: [Select]
 
  if (jumperState == LOW) {
    WEIGHT_CLASS = WC_HEAVY;
  } else {
    WEIGHT_CLASS = WC_MEDIUM;
  }

Thank you for your help.
Rongyos

12
Other Open Source Projects / Re: Standalone Tank IR
« on: July 10, 2023, 02:08:38 AM »

First of all, if we reach the code you have posted, we already know that we have received a cannon hit (not a machine gun hit).

[...]

This means that we've added up all our damage and it's equal to or over 100%, therefore the tank is "destroyed" and must be disabled.

[...]
I hope that helps!

Hi Luke,

Yes, silly me tought that part of code is for determine if the hit is from cannon or MG. Thats why I didn't understand why cannon hit notification sent out to LEDS and not MG hit.
It is now clear for me, thanks.

Rongyos

13
Other Open Source Projects / Re: Standalone Tank IR
« on: July 07, 2023, 04:16:24 PM »
Hi Luke!

I'm just modifying the code for using relays for disconnect motors (to reduce advantages relating tamiya speed reducing function) and just dont understand the code below. After the "else" statement the HitLEDs_CannonHit object shouldn't be HitLEDs_MGHit? If yes my relay object shouldn't be there :)
Code: [Select]
if (DamagePct >= 100.0)
                {
                    // Don't let damage go above 100%
                    DamagePct = 100.0;
                                       
                    // After destruction, the tank becomes inoperative for some period of time (15 seconds is the Tamiya spec - NOT the same as recovery/invulnerability time!)
                    // After that time it will automatically recover itself. During invulnerability time, the tank can fire but is impervious to enemy fire.
                    // Invulnerabilty time is dependent on the weight class.
                    isDestroyed = true;
                    TankTimer->setTimeout(DESTROYED_INOPERATIVE_TIME_mS, ResetBattle);   // DESTROYED_INOPERATIVE_TIME_mS is defined in OP_BattleTimes.h
                    // Start the destroyed light effect
                    HitLEDs_CannonHit();   // After the cannon hit effect, because isDestroyed is true, the subsequent HitLEDs_Destroyed effect will start automatically
                    HitRelay();    //After the cannon hit effect the relay disconnect the motors. Tank cannot move
                    ClearHitRelay();
                }
                else
                {
                    // Flash the hit notification LEDs
                    HitLEDs_CannonHit();
                   HitRelay();
                    ClearHitRelay();
                    // Start a brief invulnerability timer. Each IR signal is sent multiple times, but we only want to count
                    // one hit per shot. For the next second after being hit, we ignore further hits
                    TankTimer->setTimeout(HIT_FILTER_mS, EnableHitReception);

Thanks and regards!
Rongyos

14
TCB Dev / Re: Ideas for the OP Config
« on: June 03, 2023, 02:27:43 PM »
I hope this looks better.

Hi Luke,

Its perfect now :) (the sound doesnt represent the flickering its just test. Flickering is realistic in electric starting not flywheel)
Here is a video of the brake light flickering:


Thanks for your efforts and quick support!
Rongyos

15
TCB Dev / Re: Ideas for the OP Config
« on: June 01, 2023, 02:18:57 PM »
    Hi Rongyos,

    • When the flickering is finished (the transmission engage delay has expired/your engine start sound has finished), the lights will gradually return to full brightness instead of doing so abruptly all at one.

    You can let me know what you think.

    Hi Luke,

    Sorry for the late reply I was not near my computer
    Honestly, the softness on the end of the flickering is too high and not realistic now. Can you lower (much much lower it) to almost nothing?
    Also, the flickering is almost perfect and realistic. Can you add a little bit more softness? Just a little bit :) Unfortunatelly I only have TCB right now and no free arduino :(

    Regards
    Rongyos[/list]

    Pages: [1] 2 3
    bomber-explosion