Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
position monitor
#1
I want to use a polygon to detect if I’m too close to a wall. I’ve written the code in C on Windows and it works well (24 ns per check in debug mode). I have a few questions about porting it to PMAC C code:
1. I have some constant arrays in memory, around 5 MB in total. I assume this won’t pose any issue.
2. I could make an order of magnitude faster but I would need a 50 MB lookup table.
3. What size integer is fastest to work with (e.g. 32 bit int)?
4. When the plc detects the robot is too close to a wall I plan to servo off the motor. The motors have a brake function so servo off should stop the motor, which in turn should stop all the motors in the coordinate system.
Reply
#2
Your C-code should run as-is on Power PMAC as a background Linux program.

1. I have some constant arrays in memory, around 5 MB in total. I assume this won’t pose any issue.
No - it should not.

2. I could make an order of magnitude faster but I would need a 50 MB lookup table.
You should be able to allocate all available free memory in PMAC.

3. What size integer is fastest to work with (e.g. 32 bit int)?
A C “int” should be very fast.

4. When the plc detects the robot is too close to a wall I plan to servo off the motor. The motors have a brake function so servo off should stop the motor, which in turn should stop all the motors in the coordinate system.
The Power PMAC C-API has a number of motor/servo with brake functions, as in:
int BrakeEnable (int n): Disables amplifier for motor n and then if defined enables brake after a delay
void DkillCoord (int n): Kills all motors in coordinate system n and then if defined enables the brakes after a delay
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)