Author Topic: Mobility Platform + Hall Sensors on LPC21xx(ARM)  (Read 2051 times)

0 Members and 1 Guest are viewing this topic.

Offline xkyveTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 1
Mobility Platform + Hall Sensors on LPC21xx(ARM)
« on: May 29, 2012, 02:45:36 AM »
The robot chassis: http://www.pololu.com/catalog/product/1060
Project code: https://github.com/xkyve/mobility [C Code, uVision 4 IDE]

I'm a student working on a project and my part is to design the mobility platform, which means:
I have to provide functions, methods for robot movement, like:

- simple commands (execute until other command is issued): forward, backward, left, right, set speed (PWM)
- advanced commands: rotate X degrees to the right/left, forward X cm, forward X seconds at speed Y (RPM), etc.
- battery monitor, current through motors monitor
- UART communication, bluetooth

Simple commands are working, I made the H-Bridge, set up the PWM. Communications are OK.
For the advanced commands I've installed Hall Sensors on the axis to measure motor angular speed. It's working. I can read the motors speed at any time in rotations/sec.

If I have this how can I implement the advanced commands, what's the best approuch, for example, to rotate 90 degrees to the left/right or to move 20 cm forwards?

Can you point me in the right direction?
Thank you


Offline mstacho

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 10
Re: Mobility Platform + Hall Sensors on LPC21xx(ARM)
« Reply #1 on: May 29, 2012, 12:50:55 PM »
can you be a bit more specific?  Which advanced commands are you talking about, and why aren't they working?

Are you talking about control like PID, or just how you encode the control information to send to the robot?

MIKE
Current project: tactile sensing systems for multifingered robot hands

Offline xkyveTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 1
Re: Mobility Platform + Hall Sensors on LPC21xx(ARM)
« Reply #2 on: May 30, 2012, 03:19:52 AM »
Sorry if I wasn't very clear.

What is working:
- I can read the motor speed in rotations per second from the Hall sensors.
- PWM module, direction (simple robot movement is working)

What I want to do (for now):
- 90 degrees rotation left/right (on the spot because the robot has differential drive)
- maintain motor speed at a chosen value (through PID floating point or int?)

How would you implement this? Can you point me in the right direction?

Thank you

Offline mstacho

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 10
Re: Mobility Platform + Hall Sensors on LPC21xx(ARM)
« Reply #3 on: May 30, 2012, 06:19:55 AM »
Your big next step is getting PID working.  Since you can read the motor speed in rotation/s, you can get the motor position by doing simple integration (position = currentSpeed*timeStep + position) and that should be reasonably accurate.

If you don't want to put any other sensors on board, then your steering accuracy is going to depend on how well you calibrate: for a given change in position of both tracks (when they are moving in opposite directions), what is the angle you get?  Then you just make sure to move the tracks to the positions that correspond to a 90 degree turn.

If you put a gyroscope on board, you will be able to do better, as long as you don't turn forever :-P Gyros have the unfortunate property that they "wind up": if you leave them running and keep integrating, your robot will tell you that it's constantly spinning very slowly.  But for short maneuvers like turning, it's not a big deal.

Regardless of which sensors you use, you're going to have to use PID if you want this to work reasonably well.  Doing it with floats or ints doesn't matter.  I'd do it with floats.  Your microcontroller can definitely handle a few PIDs working in floats (unless you're not using one?) and if your PWM signal has to be an integer, just cast it to an int: all that'll happen is you lose the decimal point.  But if PWM is in the range of 0 to 100, for example, all you're losing is less than 1% accuracy, which your sensors won't give you anyway.

Since you can sense speed, a good first step would be to do a motor speed controller using PID.  This way, you aren't relying on your calibration.  Get that going, and you're set.  If I were you, I'd just use PD.  I never did trust the integrators :-P  But that's a personal preference, and the integrator does do something.

MIKE
Current project: tactile sensing systems for multifingered robot hands

 


Get Your Ad Here

data_list