> For the complete documentation index, see [llms.txt](https://docs.augelab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.augelab.com/arabic/alblwkat-alwzyfyh/blocks-reference/input-output/data-inputs/pwm-pulse-width-modulation.md).

# PWM (Pulse Width Modulation)

تقوم هذه دالة البلوك بتوليد إشارة منطقية دورية (True/False) مُعدَّلة بعرض النبضة يمكن استخدامها لمحاكاة أو تشغيل مشغلات زمنية. استخدمها لإنشاء إشارات تشغيل/إيقاف متكررة إما بالزمن (ثوانٍ) أو بعدد العينات (خطوات متقطعة).

## 📥 المدخلات

هذا البلوك لا يحتوي على أي مدخلات.

## 📤 المخرجات

* `Boolean` الإشارة الدورية True/False الناتجة وفقًا للوضع والزوایا الزمنية المُعدَّة.

## 🕹️ الضوابط

* `Interval` أدخل الفترة الكاملة لدورة واحدة. في وضع الوقت تكون بالثواني، وفي وضع العينات تكون بعدد العينات/الخطوات.
* `Up Duration` أدخل المدة التي تبقى فيها الإشارة True ضمن كل دورة. الوحدات تتطابق مع الوضع المحدد (ثوانٍ أو عينات).
* `Time mode` التبديل بين Seconds (وضع قائم على الزمن) و Samples (وضع قائم على عدد العينات).

## 🎨 الميزات

* وضع PWM قائم على الزمن لإشارات دورية متزامنة مع الوقت الحقيقي.
* وضع PWM قائم على العينات لإشارات متزامنة مع الخطوات أو الفريمات.
* إمكانية ضبط دورة العمل عبر `Interval` و`Up Duration`.
* مخرج منطقي بسيط يسهل دمجه مع بلوكات المنطق والمخرجات.

## 📝 تعليمات الاستخدام

1. اختر وضع التشغيل باستخدام `Time mode`.
2. اضبط `Interval` لتحديد طول الدورة الكاملة.
3. اضبط `Up Duration` لتحديد الجزء النشط (True) من كل دورة. تأكد أن قيمة `Up Duration` أقل من أو تساوي `Interval`.
4. وصل مخرج `Boolean` بأي بلوك يحتاج إشارة رقمية/تحقق (مثلاً `Led Output` للعرض، أو بلوكات منطقية للتحكم في سلوك آخر).

## 📊 التقييم

أثناء التشغيل، ينتج البلوك نمطًا متكررًا من True/False. في وضع الوقت يتبع النمط الثواني الحقيقية. في وضع العينات يتقدم النمط مع كل تشغيل/خطوة. نسبة دورة العمل تساوي (`Up Duration` ÷ `Interval`).

## 💡 نصائح وحيل

* استخدم `Scope` لتصوير الإشارة والتحقق من التوقيت ونسبة دورة العمل في الوقت الحقيقي.
* استخدم `Rising Edge` لاكتشاف التحولات وتشغيل إجراءات لمرة واحدة على الحافة الصاعدة.
* عد النبضات باستخدام `Counter` لقياس التكرارات أو تشغيل عمليات حسب الدُفعات.
* ادمج مع `And` أو `Or` لتمرير إشارة الـ PWM بناءً على شروط أخرى (مثلاً إدخال يدوي `Logic Input`).
* استخدم `Delay Step`, `ON Delay` أو `OFF Delay` لتشكيل أو إزالة الاهتزازات من الانتقالات.
* احتفظ أو جمد القيم باستخدام `Data Memory` عندما تحتاج قيمة مستقرة بين التحديثات.

## 🛠️ استكشاف الأخطاء وإصلاحها

* الإخراج دائمًا True أو دائمًا False
  * تحقق من إعدادات `Up Duration` و`Interval` وتأكد أن `Time mode` المحدد يتطابق مع الوحدات المتوقعة (ثوانٍ مقابل عينات).
* التوقيت غير مضبوط في وضع الوقت
  * تأكد من أن ساعة النظام تعمل وأن بلوكات أخرى لا تُعيق التنفيذ. استخدم `Scope` للتأكد من التوقيت الحقيقي.
* وضع العينات لا يتقدم كما هو متوقع
  * تأكد من أن النظام يولد خطوات/عينات (حلقة التشغيل أو البلوكات السابقة يجب أن توفر تكرارات). استخدم `Counter` أو `Cycle Timer` لفحص تقدم الخطوات.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.augelab.com/arabic/alblwkat-alwzyfyh/blocks-reference/input-output/data-inputs/pwm-pulse-width-modulation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
