"set_etb" is now "set_etb_duty"

This commit is contained in:
rusefi 2019-09-21 22:15:34 -04:00
parent a221fe6d45
commit 4ba441fd49
9 changed files with 30 additions and 23 deletions

View File

@ -46,7 +46,7 @@
* set etb_d X
* set etb_o X
*
* set_etb X
* set_etb_duty X
*
* http://rusefi.com/forum/viewtopic.php?f=5&t=592
*
@ -311,7 +311,7 @@ DISPLAY(DISPLAY_IF(hasEtbPedalPositionSensor))
static EtbController etbController;
/**
* set_etb X
* set_etb_duty X
* manual duty cycle control without PID. Percent value from 0 to 100
*/
void setThrottleDutyCycle(percent_t level) {
@ -561,7 +561,7 @@ void initElectronicThrottle(void) {
startETBPins();
// manual duty cycle control without PID. Percent value from 0 to 100
addConsoleActionNANF("set_etb", setThrottleDutyCycle);
addConsoleActionNANF(CMD_ETB_DUTY, setThrottleDutyCycle);
tuneWorkingPidSettings.pFactor = 1;

View File

@ -371,6 +371,7 @@
#define CMD_DATE "date"
#define CMD_DISABLE "disable"
#define CMD_ENABLE "enable"
#define CMD_ETB_DUTY "set_etb_duty"
#define CMD_REBOOT "reboot"
#define CMD_REBOOT_DFU "reboot_dfu"
#define CMD_TRIGGER_HW_INPUT "trigger_hw_input"

View File

@ -1251,6 +1251,7 @@ end_struct
#define CMD_CALIBRATE_PEDAL_UP "calibrate_pedal_up"
#define CMD_CALIBRATE_PEDAL_DOWN "calibrate_pedal_down"
#define CMD_ETB_DUTY "set_etb_duty"
#define CMD_TRIGGERINFO "triggerinfo"
#define CMD_WRITECONFIG "writeconfig"

View File

@ -1,6 +1,6 @@
package com.rusefi.config.generated;
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Fri Sep 20 21:55:21 EDT 2019
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sat Sep 21 21:56:11 EDT 2019
// by class com.rusefi.output.FileJavaFieldsConsumer
import com.rusefi.config.*;
@ -240,6 +240,7 @@ public class Fields {
public static final String CMD_DATE = "date";
public static final String CMD_DISABLE = "disable";
public static final String CMD_ENABLE = "enable";
public static final String CMD_ETB_DUTY = "set_etb_duty";
public static final String CMD_REBOOT = "reboot";
public static final String CMD_REBOOT_DFU = "reboot_dfu";
public static final String CMD_TRIGGER_HW_INPUT = "trigger_hw_input";

View File

@ -8,13 +8,14 @@ import com.rusefi.ui.etb.EtbCommandsPanel;
import javax.swing.*;
import java.awt.*;
import static com.rusefi.config.generated.Fields.CMD_ETB_DUTY;
/**
* Controls related to Electronic Throttle Body
*
* (c) Andrey Belomutskiy 2013-2019
*/
public class ETBPane {
public static final String SET_ETB = "set_etb ";
private final JPanel content = new JPanel(new BorderLayout());
public ETBPane() {

View File

@ -1,6 +1,6 @@
package com.rusefi.ui.etb;
import com.rusefi.ETBPane;
import com.rusefi.config.generated.Fields;
import com.rusefi.io.CommandQueue;
import org.putgemin.VerticalFlowLayout;
@ -8,14 +8,16 @@ import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import static com.rusefi.config.generated.Fields.CMD_ETB_DUTY;
/**
* Little panel to drive ETB duty cycle directly
*
* (c) Andrey Belomutskiy
* @see ETBPane#SET_ETB
* @see Fields#CMD_ETB_DUTY
*/
public class DirectDrivePanel {
public static final String CANCEL_DIRECT_DRIVE_COMMAND = ETBPane.SET_ETB + "NaN";
public static final String CANCEL_DIRECT_DRIVE_COMMAND = CMD_ETB_DUTY + " NaN";
private final JPanel content = new JPanel(new BorderLayout());
private final JLabel currentOverride = new JLabel("NaN");
private final JTextArea increment = new JTextArea("0.5");
@ -26,8 +28,8 @@ public class DirectDrivePanel {
content.setBorder(BorderFactory.createTitledBorder("Direct Drive"));
CommandQueue.getInstance().addListener(command -> {
if (command.startsWith(ETBPane.SET_ETB)) {
command = command.substring(ETBPane.SET_ETB.length());
if (command.startsWith(CMD_ETB_DUTY + " ")) {
command = command.substring((CMD_ETB_DUTY + " ").length());
directDriverValue = parseDouble(command, Double.NaN);
SwingUtilities.invokeLater(() -> currentOverride.setText("PWM override " + directDriverValue));
reset.setEnabled(!Double.isNaN(directDriverValue));
@ -41,7 +43,7 @@ public class DirectDrivePanel {
@Override
public void actionPerformed(ActionEvent e) {
double newValue = getCurrent() + getIncrement();
CommandQueue.getInstance().write(ETBPane.SET_ETB + newValue);
CommandQueue.getInstance().write(CMD_ETB_DUTY + " " + newValue);
}
});
upDownPanel.add(more);
@ -51,7 +53,7 @@ public class DirectDrivePanel {
@Override
public void actionPerformed(ActionEvent e) {
double newValue = getCurrent() - getIncrement();
CommandQueue.getInstance().write(ETBPane.SET_ETB + newValue);
CommandQueue.getInstance().write(CMD_ETB_DUTY + " " + newValue);
}
});

View File

@ -1,6 +1,5 @@
package com.rusefi.ui.etb;
import com.rusefi.ETBPane;
import com.rusefi.core.Sensor;
import com.rusefi.ldmp.generated.ElectronicThrottleMeta;
import com.rusefi.ui.livedocs.LiveDocPanel;
@ -12,6 +11,8 @@ import org.putgemin.VerticalFlowLayout;
import javax.swing.*;
import static com.rusefi.config.generated.Fields.CMD_ETB_DUTY;
/**
* Panel for ETB bench testing & research.
*/
@ -47,7 +48,7 @@ public class EtbCommandsPanel {
content.add(spotsPane);
content.add(UiUtils.wrap(new EtbMonteCarloSequence().getButton()));
content.add(AnyCommand.createArea(new Node(), ETBPane.SET_ETB + "10", false, false).getContent());
content.add(AnyCommand.createArea(new Node(), CMD_ETB_DUTY + " " + "10", false, false).getContent());
content.add(DetachedSensor.createMockVoltageSlider(Sensor.PPS));

View File

@ -1,6 +1,5 @@
package com.rusefi.ui.etb;
import com.rusefi.ETBPane;
import com.rusefi.core.MessagesCentral;
import com.rusefi.core.Sensor;
import com.rusefi.core.SensorCentral;
@ -17,6 +16,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import static com.romraider.util.ThreadUtil.sleep;
import static com.rusefi.SensorLogger.getSecondsSinceFileStart;
import static com.rusefi.Timeouts.SECOND;
import static com.rusefi.config.generated.Fields.CMD_ETB_DUTY;
import static com.rusefi.etb.TestSequenceStep.count;
import static com.rusefi.ui.etb.DirectDrivePanel.CANCEL_DIRECT_DRIVE_COMMAND;
import static com.rusefi.ui.etb.EtbTestSequence.*;
@ -135,6 +135,6 @@ public class EtbMonteCarloSequence {
}
private void stopETB() {
CommandQueue.getInstance().write(ETBPane.SET_ETB + 0);
CommandQueue.getInstance().write(CMD_ETB_DUTY + " " + 0);
}
}

View File

@ -1,6 +1,5 @@
package com.rusefi.ui.etb;
import com.rusefi.ETBPane;
import com.rusefi.core.MessagesCentral;
import com.rusefi.core.Sensor;
import com.rusefi.core.SensorCentral;
@ -14,6 +13,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import static com.rusefi.Timeouts.SECOND;
import static com.rusefi.config.generated.Fields.CMD_ETB_DUTY;
/**
* This tool finds interesting ETB duty cycles like the value when in starts to open or the value
@ -67,7 +67,7 @@ public class MagicSpotsFinder {
if (tpsPosition >= 100 - MEASURMENT_PRECISION) {
currentDutyCycle -= DUTY_CYCLE_STEP;
CommandQueue.getInstance().write(ETBPane.SET_ETB + currentDutyCycle, goingDown);
CommandQueue.getInstance().write(CMD_ETB_DUTY + " " + currentDutyCycle, goingDown);
} else if (tpsPosition > defaultTpsPosition + MEASURMENT_PRECISION) {
if (startedToCloseValue == 0) {
@ -78,7 +78,7 @@ public class MagicSpotsFinder {
}
currentDutyCycle -= DUTY_CYCLE_STEP;
CommandQueue.getInstance().write(ETBPane.SET_ETB + currentDutyCycle, goingDown);
CommandQueue.getInstance().write(CMD_ETB_DUTY + " " + currentDutyCycle, goingDown);
} else {
backToZeroValue = currentDutyCycle;
backToZeroValueLabel.setText(String.format("Back Zero %.1f", backToZeroValue));
@ -110,7 +110,7 @@ public class MagicSpotsFinder {
if (tpsPosition < defaultTpsPosition + MEASURMENT_PRECISION) {
// ETB has not moved yet, keep going up
currentDutyCycle += DUTY_CYCLE_STEP;
CommandQueue.getInstance().write(ETBPane.SET_ETB + currentDutyCycle, goingUp);
CommandQueue.getInstance().write(CMD_ETB_DUTY + " " + currentDutyCycle, goingUp);
} else if (tpsPosition < 100 - MEASURMENT_PRECISION) {
if (startedToOpenValue == 0) {
@ -123,7 +123,7 @@ public class MagicSpotsFinder {
// ETB has not reached 100%, keep going up
currentDutyCycle += DUTY_CYCLE_STEP;
CommandQueue.getInstance().write(ETBPane.SET_ETB + currentDutyCycle, goingUp);
CommandQueue.getInstance().write(CMD_ETB_DUTY + " " + currentDutyCycle, goingUp);
} else {
// looks like we have reached 100%, cool!
@ -132,7 +132,7 @@ public class MagicSpotsFinder {
MessagesCentral.getInstance().postMessage(getClass(), "startedToOpenValue = " + startedToOpenValue + ", reached100Value = " + reached100Value);
currentDutyCycle -= DUTY_CYCLE_STEP;
CommandQueue.getInstance().write(ETBPane.SET_ETB + currentDutyCycle, goingDown);
CommandQueue.getInstance().write(CMD_ETB_DUTY + " " + currentDutyCycle, goingDown);
}
}
@ -157,7 +157,7 @@ public class MagicSpotsFinder {
MessagesCentral.getInstance().postMessage(getClass(), "Start!");
resetValues();
CommandQueue.getInstance().write(ETBPane.SET_ETB + currentDutyCycle, goingUp);
CommandQueue.getInstance().write(CMD_ETB_DUTY + " " + currentDutyCycle, goingUp);
sleep(INITIAL_SLEEP);
defaultTpsPosition = SensorCentral.getInstance().getValue(Sensor.TPS);
}