How Rtos task switching works?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
prJ_3956181
Level 1
Level 1
First like received First like given

I am just starting to learn rtos so i want to understand how it works for example if i have encoder dc motor and servo motor how it can be done using rtos. Encoder motor needs to run for certain position and servo has to reach certain degree.Normally without rtos a particular task is completed and it moves to the next one. since rtos uses task switching how will task be completed for the encoder and servo motor (for how much time will task keep switching and how it is possible).

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

For the FreeRTOS, you can visit following URL to get Tutorial type materials.

FreeRTOS - Quick start guide

To begin with, how about skimming the pages above

and if you encounter further question(s), post specific questions to

FreeRTOS Support Forrum

https://sourceforge.net/p/freertos/discussion/382005/

and/or here 😉

Best Regards,

21-Aug-2019

Motoo Tanaka

View solution in original post

0 Likes
5 Replies
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

For the FreeRTOS, you can visit following URL to get Tutorial type materials.

FreeRTOS - Quick start guide

To begin with, how about skimming the pages above

and if you encounter further question(s), post specific questions to

FreeRTOS Support Forrum

https://sourceforge.net/p/freertos/discussion/382005/

and/or here 😉

Best Regards,

21-Aug-2019

Motoo Tanaka

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

A task controlling a motor (or any other device) usually does not end. Just like the infinite main-loop in "normal" applications the controling tasks will not end. Instead there are conditions set from the outside that the task "sees" and performs what is needed, ie the change between actual and required position. Starting and ending tasks can result in some system overhead which might reduce performance.

When you want to learn how RTOSses principally work, have a look into this thread.

Bob

Hi JoMe

Is it like this if sevo task(i want to move 90 degree) and dc task are give some 5 ticks,the sevo will do for 5 ticks (which moves to 20degree)then switches to dc task for 5 ticks and then to servo move 40 degree,then to dc and so on unit it completes the task

0 Likes

Think in single tasks:

How are you going to let the servo task move 90°? Probably you setup some signal stream (using a PWM) and WAIT for completion.

The second motor works the same.

Now during the wait phases, because tis is comparably slow, your tasks get switched a thousand times per second until the waiting is finished.

Bob

0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

If you are interested in generating PSoC6 projects with FreeRTOS, the following video series will be helpful.

Link: https://www.cypress.com/video-library/PSoC-Software/psoc-6-101-lesson-1-4-freertos-0/604106

Best Regards,
Vasanth

0 Likes