Serializer reset(?) when PID Controller accessed by multiple threads
Navigates to RoboticsConnection.com Home RoboticsConnection.com HomePage
RoboticsConnection User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Serializer reset(?) when PID Controller... Expand / Collapse
Author
Message
Posted Tuesday, July 22, 2008 11:46 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: Today @ 2:05 PM
Posts: 39, Visits: 185
Hi Jason et. al.,

I am developing a Serializer-based robot together with a multi-threaded C# control program over a Bluetooth serial link. The different threads control different behaviors depending on sensor input, kind of like a subsumption hierarchy. For example, one of the threads simply causes the robot to wander randomly by choosing random distances and angles to send to the PID Controller methods. Another thread monitors a pair of bump switches and, if a bump is detected, it executes a stop/backup manoeuver by sending the appropriate commands to the PID Controller.

The problem is that when a bump is detected and the stop/backup commands are sent to the Serializer, my various threads seem to die and the robot stops moving altogether. If I stop and start my timer loop that contains PumpEvents(), I can get it going again. I'm theorizing at this point that the Serializer doesn't like to get hit by PID commands simultaneously from more than one thread, but I am just guessing at this point. Before I delve deeper into the code, does this make any sense to you?

Thanks!
patrick
Post #592
Posted Tuesday, July 22, 2008 3:44 PM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: Today @ 2:05 PM
Posts: 39, Visits: 185
Hello again,

Before anyone wastes any time on this...I think my problem is being caused by the bumper switches themselves, not my code or the Serializer. I'm using the whisker type bumper switches as can be found at:

http://www.lynxmotion.com/Product.aspx?productID=60&CategoryID=8

If I remember the instructions (it was a while ago), I had to solder a 5-10k resistor across the signal and V+ pins of the switch. This at least appears to work on the Serializer digital pins as I get a signal when I press a switch. However, now I'm wondering if in fact this setup is correct for the Serializer--could I be over-volting the IO pins or something like that? So my new question is: what is the correct way to set up the kind of switches referred to above for the Serializer?

Thanks!
patrick



Post #593
Posted Wednesday, July 23, 2008 7:36 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: Today @ 2:05 PM
Posts: 39, Visits: 185
Problem solved! (I think.) It looks like the problem is being caused by using the PID Stop method to interrupt an ongoing movement. Indeed, I have noticed in the past that the Stop method tends to cause the robot to suddenly jerk to halt (as one might expect--but even at slow speeds) and then all subsequent PID commands stop working. Only restarting the main thread that calls PumpEvents can get the PID controller to start working again. So instead of Stop commands, I tried using a TravelDistance command with Distance=0 and my problem seems to have gone away.

--patrick
Post #594
Posted Tuesday, July 29, 2008 7:53 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Today @ 7:20 AM
Posts: 285, Visits: 414
Patrick,

Hey, I'm not ignoring you my friend!   I've been slammed for the past week, and I've been trying to get our new CMUcamLibMF finished, so customers will have a nice .NET interface for the CMUcam.  I'm about to finish the version for the .NET Micro Framework(MF), then I'll port it over to work under the Full and CF version of the .NET Framework.

Right now, I have a Traxster MF kit using the CMUcamLibMF to track a Red/Blue ball around.  I have coded all of the interface, and now I'm integrating/debugging/writing test scenarios.  It's really cool.

So, the reason I haven't responded is because I wanted to spend some time replying to your last few emails...I should have time in the coming days...Hang in there...

Best Regards!

Jason Summerour
President,
Summerour Robotics Corporation
Microsoft MVP
www.roboticsconnection.com

Post #599
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: jsummerour, ringo

Permissions Expand / Collapse

All times are GMT -8:00, Time now is 7:29pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.187. 13 queries. Compression Disabled.