Ayar Noktası Komutu
A Setpoint Command works in conjunction with a PIDSubsystem to drive an actuator to a particular angle or position that is measured using a potentiometer or encoder. This happens so often that there is a shortcut in RobotBuilder to do this task.
Bir PIDS alt sistemi ile başlayın
Bir robotta, açıyı ölçen potansiyometreli bir bilek eklemi olduğunu varsayalım. Bilek eklemini hareket ettiren motoru ve açıyı ölçen potansiyometreyi içeren bir PIDS alt sistemi First create a PIDSubsystem oluşturun. PIDS alt sisteminde tüm PID sabitleri doldurulmuş ve düzgün çalışıyor olmalıdır.
** Tolerans ** parametresini ayarlamak önemlidir. Bu, mevcut değerin ayar noktasından ne kadar uzakta olabileceğini ve hedefte değerlendirilebileceğini kontrol eder. Bu, Ayar Noktası Komutunun bir sonraki komuta geçmek için kullandığı kriterdir.
Ayar Noktası Komutunu Oluşturma
Paletteki Komutlar klasörüne sağ tıklayın ve “Ayar Noktası Ekle komutu” nu seçin.
Ayar Noktası Komut Parametreleri
Fill in the name of the new command. The Requires field is the PIDSubsystem that is being driven to a setpoint, in this case the Elevator subsystem.
Click on the Parameter Presets to set up the setpoints.
Select Add Preset
Enter a preset name (in this case ‘bottom’
Click the dropdown next to the setpoint entry box
Select the Elevator.Bottom constant, that was created in the Elevator subsystem previously
Repeat steps 2-5 for the other setpoints.
Click Save and close
There is no need to fill in any code for this command, it is automatically created by RobotBuilder.
Bu komut her zamanlandığında, alt sistemi otomatik olarak belirtilen ayar noktasına yönlendirecektir. PIDS alt sisteminde belirtilen tolerans dahilinde ayar noktasına ulaşıldığında, komut sona erer ve bir sonraki komut başlar. PIDS alt sisteminde bir tolerans belirtmek önemlidir veya bu komut tolerans sağlanamadığı için asla bitmeyebilir.
Not
PID Kontrolü hakkında daha fazla bilgi için lütfen bakınız:ref:Advanced Controls Introduction <docs/software/advanced-controls/introduction/index:Advanced Controls Introduction>.