• Hallo Zusammen, Aufgrund der aktuellen Situation setzten wir die Möglichkeit aus, sich mit Gmail zu registrieren. Wir bitten um Verständnis Das RCMP Team

Projekt ESP32 Arduino RC Sound und Licht Controller

sburggsx

Neuer Benutzer
[QUOTE = "FrikkieBester, post: 591736, member: 7622"]
Hello,

I have made some videos for the setup of the radio and the functions. Please note I changed the channel assignment around for Ch6 and Ch8 in the software and on the setup video. This allows me to control something with VrA plugged into Ch6 on the RX.

[MEDIA = youtube] oJaS9wxLmlI [/ MEDIA]

[MEDIA = youtube] TLT7ZF_BZVU [/ MEDIA]
[/ QUOTE]

Ok thank you!

So the L and R functions are how you change things, and the mode is which things you can change. The pot is just another example of that. I have many more switches than a FS-i6 so many I can use one of them instead of the pot for changing things. Is the pot 2 position or 3 position?
 

sburggsx

Neuer Benutzer
Im slowly getting a handle on how to make the TX16s work. New question: you have Function_R and Function_L which are both changed by the 75% dual rate.

For Function_R on the "elevator", in 75% mode you pull down to "start / stop" the motor. You push up and hold through 4 cycles for lighting changes.
In 100% mode pushing up flashes the headlights, and pulling down changes the volume settings through 4 cycles. If you're moving, holding down in 100% cycles the jake brake.

On Function_L in 75% mode pushing the "rudder" right and holding cycles the flashers. I cannot figure out what holding left does. I also cannot figure out what either direction does in 100% mode.

I have the horn assigned to ch6 which is a momentary switch on the top of the controller. It works.

I have Pot2 assigned to channel 8 on the controller and on a rotary pot. I cannot get it to do anything either.

I have Mode1 and Mode2 on switches. For Mode1, up drives as normal. Down is "neutral" and I can rev the motor. Mode2 does something strange with the flashers. I am going to assume it has to do with releasing the 5th wheel, but I do not have a servo or switch on that yet. Sometimes, messing with these two switches takes the controller out of inertia mode and allows for instant forward / backward switching and not braking, which is bad.

What am I missing?
 
Zuletzt bearbeitet:

Pedros

Mitglied
Hi, I do not think you can do it on PWM without re-writing the code. In BUS communication mode it is done with the dual rate switch.
Спасибо. Еще подскажите как можно поменять полярность сигнала в коде? У меня когда включаешь передатчик, включается сигнал и пока не нажмешь на кнопку 3 канала она не отключается.
 

FrikkieBester

Mitglied
Спасибо. Еще подскажите как можно поменять полярность сигнала в коде? У меня когда включаешь передатчик, включается сигнал и пока не нажмешь на кнопку 3 канала она не отключается.
Thank you. Can you also tell me how to reverse the signal in the code? In my case, when you turn on the transmitter, the signal turns on and until you press the button of channel 3, it does not turn off.
For every remote profile you get the section below to reverse the channel.

1747020830004.png
 

FrikkieBester

Mitglied
On Function_L in 75% mode pushing the "rudder" right and holding cycles the flashers. I cannot figure out what holding left does. I also cannot figure out what either direction does in 100% mode.
1747038024824.png

I have the horn assigned to ch6 which is a momentary switch on the top of the controller. It works.
Ch6 is normally on a Pot, it does Beacon flashing lights, siren sound and horn depending on the position.

I have Pot2 assigned to channel 8 on the controller and on a rotary pot. I cannot get it to do anything either.
Pot2 (for Flysky FSi6 it is VrA) does nothing on the sound card.

I have Mode1 and Mode2 on switches. For Mode1, up drives as normal. Down is "neutral" and I can rev the motor. Mode2 does something strange with the flashers. I am going to assume it has to do with releasing the 5th wheel, but I do not have a servo or switch on that yet.
Mode2 operates the 5th wheel servo and switches on the hazards if selected

1747038206907.png


Sometimes, messing with these two switches takes the controller out of inertia mode and allows for instant forward / backward switching and not braking, which is bad.
I am not sure how you are "messing around" or how your channels are set up. But right stick down in 100% toggles through the volume options. On 8_Sound.h you have the options for Crawler mode to provide full power to a crawler. If you do not want that, make sure the masterVolumeCrawlerThreshold value is LESS than your minimum masterVolumePercentage



1747038310209.png
1747037890328.png
 
Zuletzt bearbeitet:

sburggsx

Neuer Benutzer
Thank you very much for all of that. It was very helpful.

There are a couple things that I don't seem to have work the same. The first is the Left Stick 75%. I thought the right press was hazards. But attaching a servo to CH4 shows me it is 5th wheel lock/unlock and flashers to show its unlocked. Long press left does not turn on my flashers. Is this a conflict somehow with Auto Indicators and auto flashers on 5th wheel unlock? It also feels like Mode1 and SWA do the same function with 5th wheel functionality.

I moved the horn channel to a pot for testing. It works as expected, turn full one way for beacons, turn full the other for the horn. Is there no way to move the beacons to a toggle switch instead? or decouple the horn? It seems like this was a compromise due to the limited number of controls on the FS-i6.
 
EDITED/UPDATED

Hi guys, first off a caution, and a thanks for any replies - I've modded my code quite a bit, but asking about a current glitch that's got me stumped..

Question: What would hold out the "currentRPM" or "targetRpm" variable from updating with throttle input?

Issue:
Engine RPM (sound) no longer increases with throttle input.
Also, no RPM on LCD dash screen.

Found so far:
Truck drives as it should, all throttles, brakes etc work fine.
Engine volume correctly increases to max with throttle input, but is 100% idle.
My "currentRpm" variable is no longer changing/updating with throttle input.
Or "_currentRpm".
Neither is "targetRpm".
Variables such as "engineload", "currentThrottle", "currentspeed", "drivestate", "engineState" etc all work and react as they should.
Using a VSCode diff operation (compared to unmodded code) doesn't show any differences in the RPM control section (around line 3370ish):

Code:
    // Engine RPM **************************************************************************************
    // Engine RPM **************************************************************************************

    if (escIsBraking && currentSpeed < clutchEngagingPoint)
      targetRpm = 0; // keep engine @idle rpm, if braking at very low speed
    if (targetRpm > 500)
      targetRpm = 500;

    // Accelerate engine


    if (targetRpm > (_currentRpm + acc) && (_currentRpm + acc) < maxRpm && engineState == RUNNING && engineRunning)
    {
      if (!airBrakeTrigger)
      { // No acceleration, if brake release noise still playing
        if (!gearDownShiftingInProgress)
          _currentRpm += acc;
        else
          _currentRpm += acc / 2; // less aggressive rpm rise while downshifting
        if (_currentRpm > maxRpm)
          _currentRpm = maxRpm;
      }
    }

    // Decelerate engine
    if (targetRpm < _currentRpm)
    {
      _currentRpm -= dec;
      if (_currentRpm < minRpm)
        _currentRpm = minRpm;
    }

#if (defined VIRTUAL_3_SPEED || defined VIRTUAL_16_SPEED_SEQUENTIAL) and not defined STEAM_LOCOMOTIVE_MODE
    // Limit top speed, depending on manual gear ratio. Ensures, that the engine will not blow up!
    if (!automatic && !doubleClutch)
      speedLimit = maxRpm * 10 / virtualManualGearRatio[selectedGear];
#endif

    // Speed (sample rate) output
    engineSampleRate = map(_currentRpm, minRpm, maxRpm, maxSampleInterval, minSampleInterval); // Idle

    // if ( xSemaphoreTake( xRpmSemaphore, portMAX_DELAY ) )
    //{
    currentRpm = _currentRpm;
    // xSemaphoreGive( xRpmSemaphore ); // Now free or "Give" the semaphore for others.
    // }
  }

  // Prevent Wastegate from being triggered while downshifting
  if (gearDownShiftingInProgress)
    wastegateMillis = millis();

  // Trigger Wastegate, if throttle rapidly dropped
  if (lastThrottle - _currentThrottle > 70 && !escIsBraking && millis() - wastegateMillis > 1000)
  {
    wastegateMillis = millis();
    wastegateTrigger = true;
  }

#if defined JAKEBRAKE_ENGINE_SLOWDOWN && defined JAKE_BRAKE_SOUND
  // Use jake brake to slow down engine while releasing throttle in neutral or during upshifting while applying throttle
  // for some vehicles like Volvo FH open pipe. See example: https://www.youtube.com/watch?v=MU1iwzl33Zw&list=LL&index=4
  if (!wastegateTrigger)
    blowoffMillis = millis();

  // blowoffTrigger = ((gearUpShiftingInProgress || neutralGear) && millis() - blowoffMillis > 20 && millis() - blowoffMillis < 250);
#endif

  lastThrottle = _currentThrottle;
}

//

    if (escIsBraking && currentSpeed < clutchEngagingPoint)
      targetRpm = 0; // keep engine @idle rpm, if braking at very low speed
    if (targetRpm > 500)
      targetRpm = 500;

    // Accelerate engine


    if (targetRpm > (_currentRpm + acc) && (_currentRpm + acc) < maxRpm && engineState == RUNNING && engineRunning)
    {
      if (!airBrakeTrigger)
      { // No acceleration, if brake release noise still playing
        if (!gearDownShiftingInProgress)
          _currentRpm += acc;
        else
          _currentRpm += acc / 2; // less aggressive rpm rise while downshifting
        if (_currentRpm > maxRpm)
          _currentRpm = maxRpm;
      }
    }

    // Decelerate engine
    if (targetRpm < _currentRpm)
    {
      _currentRpm -= dec;
      if (_currentRpm < minRpm)
        _currentRpm = minRpm;
    }

#if (defined VIRTUAL_3_SPEED || defined VIRTUAL_16_SPEED_SEQUENTIAL) and not defined STEAM_LOCOMOTIVE_MODE
    // Limit top speed, depending on manual gear ratio. Ensures, that the engine will not blow up!
    if (!automatic && !doubleClutch)
      speedLimit = maxRpm * 10 / virtualManualGearRatio[selectedGear];
#endif

    // Speed (sample rate) output
    engineSampleRate = map(_currentRpm, minRpm, maxRpm, maxSampleInterval, minSampleInterval); // Idle

    // if ( xSemaphoreTake( xRpmSemaphore, portMAX_DELAY ) )
    //{
    currentRpm = _currentRpm;
    // xSemaphoreGive( xRpmSemaphore ); // Now free or "Give" the semaphore for others.
    // }
  }

  // Prevent Wastegate from being triggered while downshifting
  if (gearDownShiftingInProgress)
    wastegateMillis = millis();

  // Trigger Wastegate, if throttle rapidly dropped
  if (lastThrottle - _currentThrottle > 70 && !escIsBraking && millis() - wastegateMillis > 1000)
  {
    wastegateMillis = millis();
    wastegateTrigger = true;
  }

#if defined JAKEBRAKE_ENGINE_SLOWDOWN && defined JAKE_BRAKE_SOUND
  // Use jake brake to slow down engine while releasing throttle in neutral or during upshifting while applying throttle
  // for some vehicles like Volvo FH open pipe. See example: https://www.youtube.com/watch?v=MU1iwzl33Zw&list=LL&index=4
  if (!wastegateTrigger)
    blowoffMillis = millis();

  // blowoffTrigger = ((gearUpShiftingInProgress || neutralGear) && millis() - blowoffMillis > 20 && millis() - blowoffMillis < 250);
#endif

  lastThrottle = _currentThrottle;
}

//

The last mods I made were quite simple, basically if not neutralGear then no engine shutdown or startup. Deleted these commands but issue persists.
I fear I've corrupted some other file with an accidental keypress or something, have also compared other files such as the included vehicle and the specific engine rev sound.

I've been monitoring variables, using diff operations to compare files, reverting to unmodded files and making individual changes, but still no luck.
I was able to force the "targetRpm" variable to a fixed value which brought the rpm sound up (basically targetRpm = 300).
I've spent about 20hrs on this issue (12 today!) so far and only getting more frustrated/confused.

Any suggestions or techniques to solve?
Src code file attached.

Would be much appreciated
Cheers
Dave

UPDATE: I've found I can import my src code file into an original code folder and the throttle RPM works as it used to. If I copy over the rest of my .h files, the issue occurs again. Seems the problem lies outside my main code, or a conflict arises somewhere with the header files. Have begun investigating which file it may be..
UPDATE#2: Original Dash.h file corrected the RPM sound issue, but because dash function was disabled.
I then disabled the dash in my modded code and the RPM issue disappears, but I'm left with no dash function. Investigation continues..
 
Zuletzt bearbeitet:
Top Bottom