Memory Storing

peterclones

New Member
I have an idea for my project down the road that is far beyond my grasp at the moment, and may be too complex for me to pull off, but one I would want to pursue. For a small robotic arm, I may wish to make the arm movements programmable without a computer, using input buttons. For example, I would move the arm in a certain sequence of motions using "Direction" buttons, and then store that sequence into another "Memory" button. What hardware/software would make such a thing possible?
 
Last edited:

westaust55

Moderator
Besides your arm and a PICAXE all you need at a base level is some switches or a keypad (keypad with 12 or 16 keys could be more flexible and your PICAXE program.
Working values woul be held in the PICAXE RAM memory.
As RAM loses the dat when power is removed, save the sequence/movement data in PICAXE EEPROM so the data is retained during a power outage.
 

srnet

Senior Member
It does depend on how much movement data you want to store.

EEPROM storage built into PICAXE's is limited to 256 bytes.
 

peterclones

New Member
Hmmm. I'd have 3 servos, so I figure I'd want to store about 20 or 30 servo positions total for one sequence. Then save maybe 10 sequences as Memory 1 to 10. Would something like that work with just 256 bytes?
 

srnet

Senior Member
Well from the manual;

servopos
Syntax:
SERVOPOS pin,pulse
SERVOPOS pin,OFF
- Pin is a constant which specifies the i/o pin to use.
- Pulse is variable/constant (75-225) which specifies the servo position

So the servo position is one byte.
 

westaust55

Moderator
With a sequence of 30 positions and 3 servos that would be 90 bytes if each position requires 3 axis of movement.
If you want some speed control (your program to achieve as no in hilt sped command)
You could need another 90 bytes so only one sequence in internal EEPROM.

Next is to add an external i2c EEPROM chip.
24LC256 has 32 kbytes capacity so shroom for many many sequences and longer if desired.
 

peterclones

New Member
To clarify, I meant 30 servo positions for all 3 servos combined per sequence. So 30 bytes plus other data and I could maybe squeeze a few sequences in there. 4 or 5 sequences would be ok. I'll look into the i2c EEPROM chip too. Great to know I have that option.
 

peterclones

New Member
Another quick question. Is there a command for the 08M2 to retrieve the position of a servo? I see a command to set the position, but not get it. The reason I ask is that it would be much more practical for my project if I could store a sequence of movements of a robotic arm by physically grabbing the arm and moving it around, and have it memorize those motions.
 

westaust55

Moderator
In short, NO.

A servo has no means of informing a controller what its current position is.
Either:
1. Your program will need to keep track of the positions, or
2. You need to modify the servos to obtain a feedback signal (eg from the internal potentiometer) and put that into a PICAXE ADC input.

For No 2 you are going to need a larger PICAXE chip to be able to accept a return signal from each Servo.
 

rossko57

Senior Member
Is there a command for the 08M2 to retrieve the position of a servo?
No; because ordinary model servos do not provide any means to read the position back from them. They have a one-way communication only. You would need to modify the servos to provide external position feedback with motor off, and then invent a communication method to read it.
That's not as scary as it sounds; an example
http://letsmakerobots.com/node/27206
and there are lots more to Google. The relevant Picaxe command for that is ReadADC.
 
Top