Skip to content

Commit

Permalink
damping modification
Browse files Browse the repository at this point in the history
1. The damping now showed the calculated value(0-0.0375)
2. Add the github action for building ESP_bridge
3. changing ESP32S3_master to ESP32S3_joystickrecevier
  • Loading branch information
tcfshcrw committed Aug 16, 2024
1 parent 5789279 commit f1a0311
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 19 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/PreRelease_task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ jobs:
working-directory: ./ESP_bridge
run: |
pio system info
pio run --environment esp32
pio run --environment esp32
# copy files to dir
- name: Copy files to packing dir
run: |
copy ${{ github.workspace }}/ESP_bridge/.pio/build/ESP_bridge/firmware.bin ${{ github.workspace }}/Helper/bins/esp32_bridge
copy ${{ github.workspace }}/ESP_bridge/.pio/build/ESP_bridge/bootloader.bin ${{ github.workspace }}/Helper/bins/esp32_bridge
copy ${{ github.workspace }}/ESP_bridge/.pio/build/ESP_bridge/partitions.bin ${{ github.workspace }}/Helper/bins/esp32_bridge
copy ${{ github.workspace }}/ESP_bridge/.pio/build/esp32/firmware.bin ${{ github.workspace }}/Helper/bins/esp32_bridge
copy ${{ github.workspace }}/ESP_bridge/.pio/build/esp32/bootloader.bin ${{ github.workspace }}/Helper/bins/esp32_bridge
copy ${{ github.workspace }}/ESP_bridge/.pio/build/esp32/partitions.bin ${{ github.workspace }}/Helper/bins/esp32_bridge
# zip plugin binaries
- name: ZIP files
run: |
Expand Down Expand Up @@ -206,8 +206,8 @@ jobs:
url: ${{needs.Build-date.outputs.Upload_URL}}
with:
upload_url: ${{ env.url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Helper/zip/esp32s3_espmaster.zip
asset_name: esp32s3_espmaster.zip
asset_path: ./Helper/zip/esp32s3_joystickreceiver.zip
asset_name: esp32s3_joystickreceiver.zip
asset_content_type: application/zip

- name: Upload ESP release assets esp32s3 espmaster
Expand Down
44 changes: 36 additions & 8 deletions .github/workflows/arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,32 @@ jobs:
# copy files to dir
- name: Copy files to packing dir
run: |
copy ${{ github.workspace }}/ESP32_master/.pio/build/esp32s3usbotg/firmware.bin ${{ github.workspace }}/Helper/bins/esp32s3_espmaster
copy ${{ github.workspace }}/ESP32_master/.pio/build/esp32s3usbotg/bootloader.bin ${{ github.workspace }}/Helper/bins/esp32s3_espmaster
copy ${{ github.workspace }}/ESP32_master/.pio/build/esp32s3usbotg/partitions.bin ${{ github.workspace }}/Helper/bins/esp32s3_espmaster
copy ${{ github.workspace }}/ESP32_master/.pio/build/esp32s3usbotg/firmware.bin ${{ github.workspace }}/Helper/bins/esp32s3_joystickreceiver
copy ${{ github.workspace }}/ESP32_master/.pio/build/esp32s3usbotg/bootloader.bin ${{ github.workspace }}/Helper/bins/esp32s3_joystickreceiver
copy ${{ github.workspace }}/ESP32_master/.pio/build/esp32s3usbotg/partitions.bin ${{ github.workspace }}/Helper/bins/esp32s3_joystickreceiver
# zip plugin binaries
- name: ZIP files
run: |
7z a ${{ github.workspace }}/Helper/zip/esp32s3_espmaster.zip ${{ github.workspace }}/Helper/bins/esp32s3_espmaster/
7z a ${{ github.workspace }}/Helper/zip/esp32s3_joystickreceiver.zip ${{ github.workspace }}/Helper/bins/esp32s3_joystickreceiver/
# Build ESP code for esp32_bridge
- name: Build PlatformIO Project ESP_bridge
working-directory: ./ESP_bridge
run: |
pio system info
pio run --environment esp32
# copy files to dir
- name: Copy files to packing dir
run: |
copy ${{ github.workspace }}/ESP_bridge/.pio/build/esp32/firmware.bin ${{ github.workspace }}/Helper/bins/esp32_bridge
copy ${{ github.workspace }}/ESP_bridge/.pio/build/esp32/bootloader.bin ${{ github.workspace }}/Helper/bins/esp32_bridge
copy ${{ github.workspace }}/ESP_bridge/.pio/build/esp32/partitions.bin ${{ github.workspace }}/Helper/bins/esp32_bridge
# zip plugin binaries
- name: ZIP files
run: |
7z a ${{ github.workspace }}/Helper/zip/esp32_bridge.zip ${{ github.workspace }}/Helper/bins/esp32_bridge/
# upload release asset
# Arduino binaries
- name: Upload ESP release assets
Expand Down Expand Up @@ -180,6 +197,7 @@ jobs:
asset_path: ./Helper/zip/esp32_speedcrafter.zip
asset_name: esp32_speedcrafter.zip
asset_content_type: application/zip

- name: Upload ESP release assets esp32s3 espmaster
id: upload-release-asset-ESP32S3-ESPmaster
uses: actions/upload-release-asset@v1
Expand All @@ -188,10 +206,21 @@ jobs:
url: ${{needs.Build-date.outputs.Upload_URL}}
with:
upload_url: ${{ env.url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Helper/zip/esp32s3_espmaster.zip
asset_name: esp32s3_espmaster.zip
asset_path: ./Helper/zip/esp32s3_joystickreceiver.zip
asset_name: esp32s3_joystickreceiver.zip
asset_content_type: application/zip

- name: Upload ESP release assets esp32s3 espmaster
id: upload-release-asset-esp32_bridge
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
url: ${{needs.Build-date.outputs.Upload_URL}}
with:
upload_url: ${{ env.url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Helper/zip/esp32_bridge.zip
asset_name: esp32_bridge.zip
asset_content_type: application/zip


########################################################################
# Build SimHub plugin
Expand Down Expand Up @@ -329,6 +358,5 @@ jobs:
# asset_path: ./SimHubPlugin/bin/SimHub_plugin.zip
# asset_name: SimHub_plugin.zip
# asset_content_type: application/zip



2 changes: 1 addition & 1 deletion ESP32/src/DiyActivePedal_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void DAP_calculationVariables_st::updateFromConfig(DAP_config_st& config_st) {
absFrequency = ((float)config_st.payLoadPedalConfig_.absFrequency);
absAmplitude = ((float)config_st.payLoadPedalConfig_.absAmplitude) / 20.0f; // in kg or percent

dampingPress = ((float)config_st.payLoadPedalConfig_.dampingPress) / 400.0f;
dampingPress = ((float)config_st.payLoadPedalConfig_.dampingPress) * 0.00015f;
RPM_max_freq = ((float)config_st.payLoadPedalConfig_.RPM_max_freq);
RPM_min_freq = ((float)config_st.payLoadPedalConfig_.RPM_min_freq);
RPM_AMP = ((float)config_st.payLoadPedalConfig_.RPM_AMP) / 100.0f;
Expand Down
1 change: 0 additions & 1 deletion ESP32/src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ char* APhost;
#ifdef ESPNOW_Enable
#include "ESPNOW_lib.h"
TaskHandle_t Task6;
//#include <ESPNOW.h>
#endif


Expand Down
2 changes: 1 addition & 1 deletion SimHubPlugin/SettingsControlDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@
<StackPanel Width="400" Height="20" Orientation="Horizontal">
<Label x:Name="label_damping" Width="150" Foreground="White" RenderTransformOrigin="0.5,0.5" Canvas.Top="3" FontSize="8" FontFamily="Arial Black" Canvas.Left="5" HorizontalAlignment="Left" VerticalAlignment="Top" Content="Damping:" Height="10" Padding="0,0,0,0"/>
</StackPanel>
<Slider x:Name="Slider_damping" Style="{DynamicResource SliderStyle_single_H}" HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Top" Width="400" Height="10" Maximum="255" ValueChanged="Slider_damping_ValueChanged" IsSnapToTickEnabled="True" Value="0" SmallChange="1"/>
<Slider x:Name="Slider_damping" Style="{DynamicResource SliderStyle_single_H}" HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Top" Width="400" Height="10" Maximum="250" ValueChanged="Slider_damping_ValueChanged" IsSnapToTickEnabled="True" Value="0" SmallChange="1"/>
</StackPanel>


Expand Down
4 changes: 2 additions & 2 deletions SimHubPlugin/SettingsControlDemo.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ public void updateTheGuiFromConfig()
Label_min_force.Content = "Preload:\n" + dap_config_st[indexOfSelectedPedal_u].payloadPedalConfig_.preloadForce + "kg";
}

label_damping.Content = "Damping: " + dap_config_st[indexOfSelectedPedal_u].payloadPedalConfig_.dampingPress;
label_damping.Content = "Damping factor: " + (float)(dap_config_st[indexOfSelectedPedal_u].payloadPedalConfig_.dampingPress * 0.00015f)+"s";
Slider_damping.Value = dap_config_st[indexOfSelectedPedal_u].payloadPedalConfig_.dampingPress;
Slider_LC_rate.Value = dap_config_st[indexOfSelectedPedal_u].payloadPedalConfig_.loadcell_rating * 2;
label_LC_rate.Content = "Loadcell rate: " + dap_config_st[indexOfSelectedPedal_u].payloadPedalConfig_.loadcell_rating*2+"kg";
Expand Down Expand Up @@ -5543,7 +5543,7 @@ private void Slider_damping_ValueChanged(object sender, RoutedPropertyChangedEve
{
dap_config_st[indexOfSelectedPedal_u].payloadPedalConfig_.dampingPress = (Byte)e.NewValue;
dap_config_st[indexOfSelectedPedal_u].payloadPedalConfig_.dampingPull = (Byte)e.NewValue;
label_damping.Content = "Damping: " + dap_config_st[indexOfSelectedPedal_u].payloadPedalConfig_.dampingPress;
label_damping.Content = "Damping factor: " + (float)(dap_config_st[indexOfSelectedPedal_u].payloadPedalConfig_.dampingPress * 0.00015f) + "s";
}

private void Slider_LC_rate_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
Expand Down

0 comments on commit f1a0311

Please sign in to comment.