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

../../../../../_images/setpoint-command-1.png

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

../../../../../_images/setpoint-command-2.png

Paletteki Komutlar klasörüne sağ tıklayın ve “Ayar Noktası Ekle komutu” nu seçin.

Ayar Noktası Komut Parametreleri

../../../../../_images/setpoint-command-3.png

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.

../../../../../_images/setpoint-command-4.png
  1. Click on the Parameter Presets to set up the setpoints.

  2. Select Add Preset

  3. Enter a preset name (in this case ‘bottom’

  4. Click the dropdown next to the setpoint entry box

  5. Select the Elevator.Bottom constant, that was created in the Elevator subsystem previously

  6. Repeat steps 2-5 for the other setpoints.

  7. 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>.