View unanswered posts | View active topics It is currently Sat Oct 25, 2014 2:43 am






Reply to topic  [ 7 posts ] 
Appropriate use case for multitasking? 
Author Message
Professor
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post Appropriate use case for multitasking?
Given the multitasking sticky, I'd like to confirm that this is an acceptable use of multitasking in RobotC.

In essence, I would like to have two tasks running at the same time: The main one would respond to sensors and decide on actions, most importantly the set points for each motor. Then, another task would be a PID control loop (due to complicated reasons we can't use the built-in PID control) which constantly adjusts the motor power. There are multiple motors to be controlled, and each iteration of the main task might only change the set points of some motors.

This is an appropriate use of multitasking, because the tasks are simultaneous, and not sequential--right?

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!


Fri Jun 21, 2013 4:58 pm
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: Appropriate use case for multitasking?
So you have one task settings encoder positions, and another controlling the motors to get to those positions, yes? That sounds alright to me. It'd be what I'd do.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Fri Jun 21, 2013 5:04 pm
Profile WWW
Professor
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post Re: Appropriate use case for multitasking?
Ok. Thanks!

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!


Fri Jun 21, 2013 10:55 pm
Profile
Expert
User avatar

Joined: Fri Nov 02, 2012 12:07 am
Posts: 164
Location: California, USA
Post Re: Appropriate use case for multitasking?
One way that I think is helpful to decide whether or not I would use multiple sequence beams in NXT-G. Provided that there are some exceptions to the rule that I have to ask about. :D

_________________
string Robored = "Awesome"
~~Neil Balch~~


Sat Aug 03, 2013 12:09 am
Profile WWW
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: Appropriate use case for multitasking?
Ugh. NXT-G... Sequence beams are my worst enemy.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Sat Aug 03, 2013 9:23 am
Profile WWW
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Appropriate use case for multitasking?
Ernest3.14 wrote:
Given the multitasking sticky, I'd like to confirm that this is an acceptable use of multitasking in RobotC.

In essence, I would like to have two tasks running at the same time: The main one would respond to sensors and decide on actions, most importantly the set points for each motor. Then, another task would be a PID control loop (due to complicated reasons we can't use the built-in PID control) which constantly adjusts the motor power. There are multiple motors to be controlled, and each iteration of the main task might only change the set points of some motors.

This is an appropriate use of multitasking, because the tasks are simultaneous, and not sequential--right?

Like I said in my previous posts, I have not found a single scenario that I really need to use RobotC tasks. Unless you are very experienced in multi-tasking programming, there are a lot of gotchas you need to deal with. Everything could be accomplished with using just the main task if your code can cooperate. For details on how this could be done, you may want to read my previous posts.

search.php?keywords=cooperative&terms=all&author=mhts&sc=1&sf=all&sk=t&sd=d&sr=posts&st=0&ch=300&t=0&submit=Search


Sat Aug 03, 2013 12:44 pm
Profile
Expert
User avatar

Joined: Fri Nov 02, 2012 12:07 am
Posts: 164
Location: California, USA
Post Re: Appropriate use case for multitasking?
NeXT-Generation wrote:
Ugh. NXT-G... Sequence beams are my worst enemy.



I know, But The Analogy Works.

_________________
string Robored = "Awesome"
~~Neil Balch~~


Sat Aug 03, 2013 12:50 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.