Removed PID settings

This commit is contained in:
2023-10-20 23:19:48 +02:00
parent 14219f2b1e
commit 7c82ed4dee
3 changed files with 13 additions and 71 deletions
@@ -21,24 +21,8 @@
# Off-road racing car (42109) by ConstructionsByDonat #
# https://rebrickable.com/mocs/MOC-90323/ #
################################################################################
# #
# Changelog #
# #
################################################################################
# v0.3.0 05-07-2022 #
# Based on v0.1.0 05-07-2022 of 42124-1 - Off-Road Buggy #
# v0.2.0 02-07-2022 #
# 2 speed "gearbox" changed to 3 speed, recodingwith debounce and now left #
# button also used. #
# v0.1.0 15-06-2022 #
# 2 speed "gearbox" added. #
# v0.0.1 15-06-2022 #
# Changed variable namings. #
# Changelog added. #
# Comment header added. #
# Changed the way speed is handled within the while loop. #
# v0.0.0 14-06-2022 #
# First version. #
# LEGO® is a trademark of the LEGO Group of companies which does not sponsor, #
# authorize or endorse this project. #
################################################################################
from pybricks.pupdevices import Motor, Remote
@@ -56,12 +40,6 @@ remote = Remote()
# Initialize the hub.
hub = TechnicHub()
# Read the current settings
old_kp, old_ki, old_kd, _, _ = steering.control.pid()
# Set new values
steering.control.pid(kp=old_kp*4, kd=old_kd*0.4)
# Find the steering endpoint on the left and right.
# The middle is in between.
left_end = steering.run_until_stalled(-200, then=Stop.HOLD)
+2 -22
View File
@@ -12,22 +12,8 @@
# Port D: Not used #
# #
################################################################################
# #
# Changelog #
# #
################################################################################
# v0.1.0 05-07-2022 #
# restructured to the version at pybricks-projects on Github #
# https://github.com/pybricks/pybricks-projects/blob/master/sets/technic/ #
# 42124-off-road-buggy/powered-up-remote/main.py #
# Changed gearbox part. #
# Button left can only shift down #
# Button right can only shift up #
# New variables to easily change the number of gears #
# Added battery indicator with hub LED. #
# v0.0.0 04-07-2022 #
# First version. #
# Based on v0.2.0 02-07-2022 of 42109-1 - App-Controlled Top Gear Rally Car #
# LEGO® is a trademark of the LEGO Group of companies which does not sponsor, #
# authorize or endorse this project. #
################################################################################
from pybricks.pupdevices import Motor, Remote
@@ -45,12 +31,6 @@ remote = Remote()
# Initialize the hub.
hub = TechnicHub()
# Read the current settings
old_kp, old_ki, old_kd, _, _ = steering.control.pid()
# Set new values
steering.control.pid(kp=old_kp*4, kd=old_kd*0.4)
# Find the steering endpoint on the left and right.
# The middle is in between.
left_end = steering.run_until_stalled(-200, then=Stop.HOLD)
@@ -15,19 +15,8 @@
################################################################################
# Rebrickable: https://rebrickable.com/mocs/MOC-113177/ #
################################################################################
# #
# Changelog #
# #
################################################################################
# v0.2.0 05-07-2022 #
# Based on v0.1.0 05-07-2022 of 42124-1 - Off-Road Buggy #
# Added steering correction #
# v0.1.0 26-06-2022 #
# Added half speed for drive. #
# Added half angle for steering. #
# v0.0.0 26-06-2022 #
# First version. #
# Based on v0.0.0 22-06-2022 of 42129 B model 'Hot Trot' by Didumos #
# LEGO® is a trademark of the LEGO Group of companies which does not sponsor, #
# authorize or endorse this project. #
################################################################################
from pybricks.pupdevices import Motor, Remote
@@ -46,12 +35,6 @@ remote = Remote()
# Initialize the hub.
hub = TechnicHub()
# Read the current settings
old_kp, old_ki, old_kd, _, _ = steering.control.pid()
# Set new values
steering.control.pid(kp=old_kp*4, kd=old_kd*0.4)
# Find the steering endpoint on the left and right.
# The middle is in between.
left_end = steering.run_until_stalled(-200, then=Stop.HOLD)
@@ -71,12 +54,13 @@ steering_angle_left = -steering_angle-steering_correction
steering_angle_right = steering_angle+steering_correction
# Set variable for gear
gear_total = 2 # Total number of gears.
gear_old = None # Empty variable to set later on (keep empty!).
gear = 2 # Gear at start (must be higher than 0 and lower or
# eaqual to gear_total).
gear_color = ["BLUE", "RED"] # Number of colors should at least be equal to
# gear_total.
gear_total = 2 # Total number of gears.
gear_old = None # Empty variable to set later on (keep
# empty!).
gear = 1 # Gear at start (must be higher than 0 and
# lower or eaqual to gear_total).
gear_color = ["BLUE", "RED"] # Number of colors should at least be
# equal to gear_total.
# Battery variables
voltage_current = hub.battery.voltage()