PDA

View Full Version : Telescope drive motors that don't...



Dodgy Geezer
- 25th March 2008, 15:57
Hi,

I'm not sure if I'm in the right place, so apologies in advance if this is not the correct forum, but I'm not sure exactly what I'm having trouble with! I have a telescope motor drive that I want to drive at a slightly different speed from the commercial controller.

This site, http://telescope.marford.me.uk/Projects/PICcontroller.htm , gives a very simple circuit, and some associated code. The circuit just uses a PIC16F627 to send timed pulses to an L293D, which is then meant to drive the 2-coil stepper.

The code worked on MPLAM SiM after a minor re-jig, and the circuit does indeed turn the motor round. But with no torque. The commercial hand controller has no problems producing oodles of power, but my puny pulses produce a maximum of about 40ma in each coil.

The site owner does not respond to e-mails, so I am looking elsewhere for assistance. In fact, the circuit provides quite a jerky drive even with no load (and fails completely with even a slight load), so perhaps I should be looking for a better microstepping answer? But that mus wait until I can discover just what I am doing wrong with this simple system. Has anyone got any ideas....?

mister_e
- 25th March 2008, 16:09
Where the power is coming from? Is this possible that it's just because your power supply is not "strong" enough? AND or the step motor ask more current than the poor L293D can provide?

Dodgy Geezer
- 25th March 2008, 17:55
Mister-e, thanks for the prompt reply!

The original commercial controller for this stepper uses an Amtel micro, driving an array of 8 transistors. It runs well off a 6v battery, and is pre-programmed for a set speed.

I needed a controller with a slightly different speed, and when I saw the circuit I referred to earlier, I thought that would be ideal. It is meant to be a circuit intended to drive a telescope stepper motor of the kind I have.

I am just using the same motor and the same battery supply the commercial controller used, but substituting this PIC16F627 / L293D circuit to drive the motor. So I know there is adequate power available. The L293D is meant to provide up to 600ma continuous according to the datasheet, but I can only measure a max of 40ma when I put an ammeter on one of the coils. If the motor was overloading the L293D I would expect a greater current?

So, am I using the L293D incorrectly? Is the PIC code (provided on the circuit I referred to earlier) incorrect? It just sends a 6 bit signal to the L293D to excite a pair of coils, pauses for a measured time, then sends another signal for the next pair of coils. Surely that ought to work?

mister_e
- 25th March 2008, 18:09
Well, i'm really not a Motor Driver pro... so i would suggest you to increase the pulse length and see if it does anything better.

40mA measurement is not revealant, it's pulse measurement, it give an average of the whole thing, not the peak.. unless you're using something else fancier than a regular DVM.

6 Volts to a regular LM7805 input may cause stability problem, if my memory serves me well, Min Vin should be 'round 9 Volts.

mvs_sarma
- 25th March 2008, 18:59
Well, i'm really not a Motor Driver pro... so i would suggest you to increase the pulse length and see if it does anything better.

40mA measurement is not revealant, it's pulse measurement, it give an average of the whole thing, not the peak.. unless you're using something else fancier than a regular DVM.

6 Volts to a regular LM7805 input may cause stability problem, if my memory serves me well, Min Vin should be 'round 9 Volts.

i find that 293D needs a minimum of 7V for Vs or Vss. this should be sorted out by him first. there should be no issue to supply 8 or 9V and be happy with 7805.

If he can go for low consumption, some Low drop out regulator like LM2931-5 can be used and then 6V might work, but the current demand should be within the regulator spec

mister_e
- 25th March 2008, 19:18
TI's datasheet's says that the supply range should be between 4.5 to 36V. If that chip is connected at the regulator output, and the voltage regulator is unstable (wich i don't doubt), there will have a problem indeed. So something to try in meantime, even if i'm not a fan of it... replace the voltage regulator by a diode or two in serie.

Before i would prefer to monitor the voltage regulator output with a scope to see how bad it is...

Dodgy Geezer
- 25th March 2008, 20:19
So many comments! Thanks, guys!

The original web-site indicates that this circuit works with the same motors I've got, so I was assuming the components were all reasonably balanced. The regulator (7805) can put out at least 1A, more if it has a decent heatsink. Of course, at the moment nothing gets hot at all!

The lead-acid battery feed is 6.3v, and the regulator drops this to 4.7v. These voltages do not vary under load. So although they are low, they do not seem to be unstable. I am not sure how to raise the voltage feed - given that I have a battery putting out 6.3v, would it be OK to connect it directly to the input without going through a regulator?

As Mister-e suspects, the impression I get from listening to the motor is that I am sending short pulses to it, when I really ought to be feeding each coil power continuously (except when they are meant to be turned off!). Power is sent to the motor by the PIC program, which does this:

...
HSTEP1 EQU B'00110110'
HSTEP2 EQU B'00101000'
....
MOVLW HSTEP1
MOVWF PORTB
CALL RA_DELAY ; variable loop to time pulses
MOVLW HSTEP2
MOVWF PORTB
CALL RA_DELAY ; variable loop to time pulses
...

Then the PORTB outputs from the PIC are attached to the inputs on the L293D, and the outputs from the L293D are attached to the stepper coils. Does this code mean the PORTB outputs remain high during the delay loop, thus keeping the L293D feeding the stepper coil? Or do the PORTB outputs reset to zero immediately after they have passed the data?

You can see why I'm not sure about where the problem might be!


I suspect I should be microstepping anyway, so another line of attack might be to abandon the L293Ds and go for something else which allows many steps. Is there such a thing?

mister_e
- 25th March 2008, 22:27
try to increase the delay routine or paste it 2-3 times again to see how better worst it will be.

Something easy like

MOVLW HSTEP1
MOVWF PORTB
CALL RA_DELAY ; variable loop to time pulses
CALL RA_DELAY ; variable loop to time pulses
CALL RA_DELAY ; variable loop to time pulses
MOVLW HSTEP2
MOVWF PORTB
CALL RA_DELAY ; variable loop to time pulses
CALL RA_DELAY ; variable loop to time pulses
CALL RA_DELAY ; variable loop to time pulses

cost nothing to try huh?

Dodgy Geezer
- 26th March 2008, 20:53
Well, I tried!

In fact I don't have to double up the delay - it's 130x125, so I just alter the values.

Making the delay shorter (5x5) results in no movement from the motor at all - but I expected that would be too fast...

Making the delay longer (250x250) results in slower movement, but with the same low torque. It's just as if the L293D is only sending one pulse to the coil, rather than holding the coil on until the next change occurs. Surely if you:

MOVLW HSTEP1 ;(hstep1 is FF, for example)
MOVWF PORTB

this should leave all PORTB pins high until PORTB is changed? Or perhaps the L293D only sends one pulse to the motor, and I need to increase the current or duration on this in some way?

falingtrea
- 26th March 2008, 22:18
Silly question. Do you have the VS pin (pin 10) of the L293D parts connected directly to the battery? Or is it connected to the 5V supply? That pin supplies the voltage that actually drives the motors and should not be going through the regulator.

Dodgy Geezer
- 27th March 2008, 10:09
No, very sensible question!

The circuit I have assembled is precisely as advertised here: http://telescope.marford.me.uk/Projects/PICcontroller.htm .

You will see that I am using a 16 pin L293D, where VS is pin 8, and this is what is connected directly to the battery positive. So there should be lots of power available to the L293D.

I think it is unlikely to be a failed L293D either, since the circuit actually contains two PICs driving two seperate L293Ds (with slightly different programming), and both of them display the same problem. This circuit is advertised as a working stepper motor driver, but I am coming to the conclusion that maybe it is not!

falingtrea
- 27th March 2008, 19:43
Another silly suggestion. Try turning BOD off. Maybe your regulator isn't rock solid enough and BOD is resetting the PIC. The PIC will run at lower voltages than the BOD is set for. Upper level for BOD is 4.4V. According to the code, portB should be static and not pulsed. If this fixes your problem, maybe you could look for a LVDO regulator only a 400mV drop like a STMicro LD29150.

Dodgy Geezer
- 27th March 2008, 21:49
Umm...What's BOD? Are you talking about the regulator? Are you suggesting that I just feed the +5v regulated line from the battery directly, at 6.3V?

The difference seems to be minimal, and I suspect it will cause no damage, but is that what you mean?

Incidentally, I have been looking for any possible difference between what I am doing and the published circuit. The only thing I can see is that the regulator is flanked with a couple of 100nf bead capacitors, and I am using 100nf polyester. Interestingly, the data sheet for the 7805 regulator suggests 30mf capacitors, but I am following the published design. Perhaps there is a problem there...?

mister_e
- 27th March 2008, 21:57
100nF directly at the output + 1 as close as possible of the pic is recommended. 30uF or higher would be nice at it's input. i usually use 10uF tantalum at the output as well as close to the PIC.

Any current demanding device have their own 47uF (or higher depending) + 0.1 uF as close as possible.

BOD: Brown-out detect. It's one of those configuration fuses setting for the PIC you're using.

Dodgy Geezer
- 28th March 2008, 15:09
Thanks for the education!

BOD off is still the same. It might have given a little more torque, or that might just have been wishful thinking on my part.

I have few capacitors on the board, just the ones specified. By now, I'm pretty sure that the PIC is doing the right thing, and that the problem lies with the motor driving L293D circuitry. So I went looking for other drive circuits, and found another which was just like the one I had built!

So everything seems to be right. The problem is, it isn't. Does anyone think it would be safe to up the voltage beyong 6v? The battery pack that came originally with the motors is 6v, and the coil windings are around 18ohm, suggesting 0.3 Amp.

Archangel
- 28th March 2008, 15:46
Hello Dodgy Geezer,
I have a little trouble with assembly, Have you put a voltmeter on the enable pins to see if the pic is pulling them high? As I understand it they should be held high while the stepper is running.<br>
Or Roman Black's Lini Stepper works well I have tried it. Kits for sale on ebay:http://cgi.ebay.com/Lini-stepper-controller-kit-drives-CNC-Lath-Mill_W0QQitemZ290216095545QQihZ019QQcategoryZ71394 QQssPageNameZWDVWQQrdZ1QQcmdZViewItem

mister_e
- 28th March 2008, 16:00
Is there any exact motor Model we can refer to?

i found this PDF for those interested in Stepper Motor Basics
http://www.solarbotics.net/library/pdflib/pdf/motorbas.pdf

Turning the problem in many ways... i'm still thinking of unsufficient current AND/OR voltage at the driver output. I would suggest you to use a higher voltage source, and connect the driver before the voltage regulator. If you have any variable voltage power supply that would be nice. This bring mvs_sarma's suggestion to the front. Make sense, there's probably some voltage loss at the output.

Why the previous driver circuit worked... well hard to tell, no schematic or pic of it (with some part# of the transistor/Mosfet)? Any coils or else fancy stuff on it?

Archangel
- 28th March 2008, 16:31
Turning the problem in many ways... i'm still thinking of unsufficient current AND/OR voltage at the driver output. . . .
Hi Steve, that was where I was going by asking if the enable pins were held high, as I do not understand the assembler . . . I think those ports should not be pulsed . . .JS

Dodgy Geezer
- 28th March 2008, 16:34
Mister-e '..Is there any exact motor Model we can refer to?..'

There are no markings on the motors. The original controller used a 6v battery pack, and the coil resistance is 18ohm. A similar looking motor is the BPM42 from Astrosyn, but that is specified as 12v.

Joe S. - thanks for joining the party! i would be happy to rewrite the code in Basic if that would help, but I think the code is working. I programmed the PIC on a Vellerman 8048 unit, which has a limited test function (6 leds and 4 switches), and the test showed the leds all lighting up at the right times. I have also run the code on a couple of software simulators, and it does what it says it does - holds the specified pins high.

What I cannot simulate is what the L293D is doing (no oscilloscope :(). In other circuits I see the possibility of varying the current passed to the stepper, but I don't think you can on the L293D. How does the chip know how much current to pass the stepper?

The Lini Stepper is very interesting, and I would buy one like a shot - if it supported Bipolar steppers like I have on the telescope. Unfortunately, the telescope hardware is fixed. I was wondering about getting one of these - http://www.jafmotion.co.uk/motordrives.htm

mister_e
- 28th March 2008, 16:37
i just had a look at L293D... there's an interesting voltage drop.. typical Vs-1.2 to Vs-1.8 v... ok ok @0.6A... but... could this be enough to lost most torque... i would think.

Probably the original design used MOSFETs, so the voltage loss was reduced to a minimum. Pure guess here.

mister_e
- 28th March 2008, 16:47
There's still some Sound-Card based Free software you could used... it's still better than nothing. Be carefull with signal amplitude and it should give you some pointers.

I already used VA (Visual analyser)
http://hacca.altervista.org/

Dodgy Geezer
- 28th March 2008, 20:59
Wow! A free oscilloscope! Thank you, Mister-e! Now I must find an old sound-card....

"Probably the original design used MOSFETs, so the voltage loss was reduced to a minimum..." - I thought I was actually building the original design. You will clearly see +6v on the original circuit diagram. But I am now inclined to think you are right, and this circuit does not actually work as specified... :(

mister_e
- 28th March 2008, 21:49
Well it has to work as expected with HIS OWN step motor... but how many different model is there in the world?

You can now buy a sound card under 20$ here... 1/10 of almost any decent used scope.

When i talked about the original design, i meant your previous one... not the one you found and post here.

T.Jackson
- 28th March 2008, 23:05
There's still some Sound-Card based Free software you could used... it's still better than nothing. Be carefull with signal amplitude and it should give you some pointers.

I already used VA (Visual analyser)
http://hacca.altervista.org/

That GUI is real buggy on my machine.

Dodgy Geezer
- 28th March 2008, 23:07
"...but how many different model is there in the world...?"

He is using a standard chinese clock-drive for an EQ4/5 scope - so am I. I was expecting our motors to be identical....

"You can now buy a sound card under 20$ here.."

I have some separate sound cards already - I was assuming that you plugged the probes into the game port on them. But now I have downloaded VA, I see there is no info about where to connect the probes to at all. Do you connect the probe to the 'microphone-in'? If so, I can connect it to the built-in sound card on the motherboard of the system I am using. It is odd that there seems to be no information about this vital point...?

"When i talked about the original design, i meant your previous one.."

Sorry - I misunderstood. In fact, I still have the original handcontroller. My problem is not that it was broken, but that it drove the motors at the correct speed for an EQ4/5 mount (1/10 rpm) and I wanted to use it for an EQ3-2 mount (1/11 rmp). Those are the final speeds - there is a gear train of approx 200:1 between the scope and the stepper. The original controller used an Amtel micro, directly driving an array of 8 transistors. They could well be MOSFETs.

mister_e
- 29th March 2008, 00:15
you plug your probe to in Line in, make sure you set your Soundcard Mixer properly as well.

In VA, Click on Settings>> In/Out Device to confirm your setings.


Trent, i can't tell, it worked for me awhile back, not sure about the current one...

EDIT seems that I had the same version... doesn't seems to bug here.

Archangel
- 29th March 2008, 00:56
Mister-e '..Is there any exact motor Model we can refer to?..'

There are no markings on the motors. The original controller used a 6v battery pack, and the coil resistance is 18ohm. A similar looking motor is the BPM42 from Astrosyn, but that is specified as 12v.

Joe S. - thanks for joining the party! i would be happy to rewrite the code in Basic if that would help, but I think the code is working. I programmed the PIC on a Vellerman 8048 unit, which has a limited test function (6 leds and 4 switches), and the test showed the leds all lighting up at the right times. I have also run the code on a couple of software simulators, and it does what it says it does - holds the specified pins high.

What I cannot simulate is what the L293D is doing (no oscilloscope :(). In other circuits I see the possibility of varying the current passed to the stepper, but I don't think you can on the L293D. How does the chip know how much current to pass the stepper?

The Lini Stepper is very interesting, and I would buy one like a shot - if it supported Bipolar steppers like I have on the telescope. Unfortunately, the telescope hardware is fixed. I was wondering about getting one of these - http://www.jafmotion.co.uk/motordrives.htm
I wasn't asking you to rewrite anything, Your reference to the website incurred me to think you found this code rather than wrote it, my appologies! My statement stands as is, I do not understand your code, so I do not know that it did that, I was simply suggesting a possible area to search.
Regards
JS

mister_e
- 29th March 2008, 01:05
ASM looks way harder than it is actually.

Let's see few common expressions

MOVLW .10
MOVWF PORTA
It's nothing else than PORTA = 10
<hr>
BTFSC PORTA.1
GOTO $-1

Could be translated as

WHILE PORTA.1=1 : WEND

OR

TestPORTABit1:
IF PORTA.1=0 then GOTO DoSomething
Goto TestPORTABit1
DoSomething:
<hr>
MOVF PORTA
MOVWF MyVar

would be MyVar=PORTA
<hr>
INCF MyVar,F

MyVar=MyVar + 1
<hr>
nothing really hard to learn... but yeah... could be a bit hard to follow/understand a little bit when you begin. 18Fs and DsPIC assembler is way easier to code, but you have more Mnemonics to learn.

T.Jackson
- 29th March 2008, 06:15
Trent, i can't tell, it worked for me awhile back, not sure about the current one...

EDIT seems that I had the same version... doesn't seems to bug here.

Try resizing some of the windows. Maximize the main GUI then restore, then manually adjust it. Sometimes messes real bad. Same problems with the tool windows too, like for the voltmeter.

Dodgy Geezer
- 29th March 2008, 21:25
T Jackson "Your reference to the website incurred me to think you found this code rather than wrote it..."

You are right. I have copied this code directly off this website. That's why I am on this forum - because the website claims it works together with the circuit they provide, but I can't make that happen.

Having said that, I have found other sites where precisely the same circuit is used with similar code, so it seems that I am doing something wrong.

Mister-e - I can't make VA work either. I am not skilled in electronics, but expected to see a set of 6v steps if I put a probe on the output of this circuit and attached the ground to 0v. Instead, what I got was a sine wave. In fact, whatever I do, I seem to get a sine wave. The oscilliscope setup setup just seems to measure RMS or peak-to-peak - I can find no DC setting at all. When I turn the circuit on, the sine wave is interrupted by short pulses which decay to 0v rapidly, so if those are real I am failing to get a proper signal to the stepper coil, but since I can't even make the scope line jump up when I put 6v across the terminal I can't be sure that VA is working at all....

T.Jackson
- 30th March 2008, 05:33
T Jackson "Your reference to the website incurred me to think you found this code rather than wrote it..."

You are right. I have copied this code directly off this website. That's why I am on this forum - because the website claims it works together with the circuit they provide, but I can't make that happen.


Excuse me? I think you might have mistaken me for someone else my friend. I have made no references to any websites in this thread.

Dodgy Geezer
- 30th March 2008, 18:45
Apologies for the confusion. What I meant to put over was:

I - refered to the website I got the stepper driver code I am using from (referenced in my first post.

You - said "Your reference to the website incurred me to think you found this code rather than wrote it..."

I - was trying to point out that I HAD found the code rather than created it.

However, I have now found out that no PC software-only scope using the sound card will provide a DC service, so I am no further forward...:(

malc-c
- 3rd April 2008, 19:00
One other thing to look at is balance - if you scope is out of balance it will become hard to drive the scope in RA, especially if you are increasing the frequency of the steps as this provides less time to energise the coils in the stepper.

One thing to try is modifying the drive / code for a 4 step motor.

Found a pdf that explains the theory behind increasing speed and the drop off of tourque http://www.national.com/an/AN/AN-828.pdf

T.Jackson
- 4th April 2008, 06:31
However, I have now found out that no PC software-only scope using the sound card will provide a DC service, so I am no further forward...:(

Bypass the coupling cap on the SND card and you'll have a DC scope :)

mister_e
- 4th April 2008, 06:49
There's always an old scope somewhere... a good ol' 20Mhz dual channel is still good enough for many purpose. Sure you can found one for ~50$ used. There's still some USB model available here and there... and finnally there's some PC card.

But.. hey wait a minute... sure you have a TV? You could try to build this one... based on PIC12F675
http://www.dos4ever.com/uscope/uscope_e.html

i always been amazed of that... never tested it though...yeah limited... but come on.. it's a PIC12F675!!!

T.Jackson
- 4th April 2008, 08:50
You've got some brass ones mister_e, I'll give you that much. Why in the world are you advertising PBP for? Are you aware that this forum is owned & run by a company which sells this product?

mister_e
- 4th April 2008, 16:50
WTF is going on with you Trent? If you have any anger... buy yourself a dog, find friends, consult a psychologist, drop me PM or e-mail directly!

skimask
- 4th April 2008, 16:57
WTF is going on with you Trent?

---Insert that cool little spinning 6 pack GIF here...of darn good beer...keep it near...to your ear...and don't fall...on your rear...by a deer...ok I'm done---

Dodgy Geezer
- 4th April 2008, 17:39
Well, I'm about to give up on this circuit - it's hard to see any future in it. Instead, I've just ordered one of these JaF Microstep modules. http://www.jafmotion.co.uk/motordrives.htm .

Let's see if it does what it say on the tin....

falingtrea
- 4th April 2008, 17:39
Trent, looks to me like mister-e provides a link on his website to a US distributer of PBP. I don't think he sells it himself.

mister_e
- 4th April 2008, 17:44
i had a link yesterday on my signature... just to calm down Mr Jackson's PMS i've removed it.

T.Jackson
- 5th April 2008, 09:59
WTF is going on with you Trent? If you have any anger... buy yourself a dog, find friends, consult a psychologist, drop me PM or e-mail directly!

You're absolutely right mister_e, I shouldn't be taking my frustrations out on you, I do apologize. You must understand that I have a lot on my plate at the moment -- the Australian secret service is busting my balls for me to come up with an electronic device to help catch pedophiles. My life depends on this project, they're pushing me real hard for this.

Perhaps you might be able to help me, mister_e -- got any ideas on how to achieve something like this?

mister_e
- 5th April 2008, 10:39
Don't need to catch them... just kill them... a camera and a gun... that's all you need.

Yes i'm a monster.

skimask
- 6th April 2008, 06:55
Don't need to catch them... just kill them... a camera and a gun... that's all you need.
IMO...a knife is more appropriate...but that's just me...


Yes i'm a monster.
I think you are in the majority...therefore...not a monster...

T.Jackson
- 6th April 2008, 11:40
IMO...a knife is more appropriate...but that's just me...


You're a murderer Jeremy?

precision
- 6th April 2008, 12:10
Hi T.Jackson. Why i seeing, your psychology is equal to Ricky Ponting ?

T.Jackson
- 6th April 2008, 12:52
Hi T.Jackson. Why i seeing, your psychology is equal to Ricky Ponting ?

Nah I just studied a book entitled: "101 ways to catch murderers & pedophiles" and the secret services gave me a couple of hundred grand plus a Ferrari and said go and get'em.

T.Jackson
- 6th April 2008, 14:52
No remorse = death penalty.

Archangel
- 6th April 2008, 19:49
You're a murderer Jeremy?
Nawww,I think he prefers a more personal touch, that's all . . .

T.Jackson
- 7th April 2008, 10:35
<img src="http://www.mdoc.state.ms.us/Death%20Row%20Photos/gaschamber.jpg">

T.Jackson
- 7th April 2008, 11:34
Ever wondered what people in jail look like?

<img src="http://www.planet-source-code.com/Upload_PSC/ScreenShots/PIC20077131757311631.JPG" >

T.Jackson
- 7th April 2008, 12:24
If you're a monster get ready to join them, because we're gonna lock'em all up.

skimask
- 7th April 2008, 14:19
You're a murderer Jeremy?
Jeeze man...Give it up!
Get off the bottle or get off the keyboard...
Regardless of which one you pick, when you're done, get off your pedestal!

skimask
- 7th April 2008, 14:22
Nawww,I think he prefers a more personal touch, that's all . . .
There ya go... After all, where's the balls in a drive by?
Get up close and personal...
Let the person at the pointy end know who's holding the other end...

T.Jackson
- 7th April 2008, 14:59
There ya go... After all, where's the balls in a drive by?
Get up close and personal...
Let the person at the pointy end know who's holding the other end...

Do you know what the word "probability" means Jeremy? Probability in the sense of -- is this person capable of doing this. This is the exact first thing the police look for. You have just confessed to probability using emotive language.

This is the emotive part ...


Get up close and personal ... Let the person at the pointy end know who's holding the other end...

T.Jackson
- 7th April 2008, 15:45
Jeeze man...Give it up!
Get off the bottle or get off the keyboard...
Regardless of which one you pick, when you're done, get off your pedestal!

You know that's what the last guy said to me, couple weeks later he was in cuffs, now he's doing 20 to life. Would have been life without parole had he not confessed to police early in the game.

skimask
- 7th April 2008, 16:01
You know that's what the last guy said to me, couple weeks later he was in cuffs, now he's doing 20 to life. Would have been life without parole had he not confessed to police early in the game.
Good for you! I'm happy for you!
Actually, no I'm not...
Glad you helped put a guy away that most likely deserved whatever he/she got...been there, done that myself (still looking over my shoulder a bit since the guy got out a couple years ago)...
Nonetheless...How's the view from up there?

skimask
- 7th April 2008, 16:02
Do you know what the word "probability" means Jeremy? Probability in the sense of -- is this person capable of doing this. This is the exact first thing the police look for. You have just confessed to probability using emotive language.
This is the emotive part ...

Do you know what the word 'pedestal' means Trent?
Pedestal in the sense of - "Get off your pedestal..."
You have placed yourself on a pedestal using the English language.
That was the language part...

To quote a little green guy I saw in a movie once:
"A life...You must get"

T.Jackson
- 7th April 2008, 16:19
Deep breath Jeremy, settle down -- that's about as far as I go, I just expose them and the 101 coppers on this forum take their pick.

Cya.

malc-c
- 7th April 2008, 23:23
OK - did I miss something here.. How the hell did this topic get from discussing telescope drives to discussing the merrits of death row ???

I gather the original poster gave up in the end and purchased a commercial driver. Maybe because the topic went way off topic, maybe as purchasing a ready made alternative to developing his own was the easy option?

Acetronics2
- 8th April 2008, 08:36
did I miss something here.. ?

Hi, Malc

I Think yes ...

To me, Our Friend Trent smokes too much illegals ...

like in the 60's when writers ( Françoise Sagan i.e. ) were smoking mushrooms to try to get some inspiration ...

but do not worry ... He doesn't bite ...

Or , may be , he tried himself a new electronic version of his Electric Chair ( see previous posts )...

Hope he won't try a new "Trentorized" version of the machine used in the film " FLY" ( w . Jeff Goldblum )

...

Alain

T.Jackson
- 8th April 2008, 09:56
but do not worry ... He doesn't bite ...


And that's exactly why I'd never make it as a copper. My nerves are absolutely shocking and I haven't got the stomach for it. My heart goes out to anyone in law enforcement that goes around chasing these guys, I know it would be absolute hell :(

Dodgy Geezer
- 11th April 2008, 02:35
"...OK - did I miss something here.. How the hell did this topic get from discussing telescope drives to discussing the merrits of death row ???

I gather the original poster gave up in the end and purchased a commercial driver. Maybe because the topic went way off topic, maybe as purchasing a ready made alternative to developing his own was the easy option...."


No, I'm actually just waiting here for the off-topic discussion to die down. I went and purchased a commercial microstepping chip to use instead of the L293D, but I still expect to drive it using a PIC. In fact, I have some more problems now, because I thought PIC assembler was fairly simple, and it turns out not to be!

I am confused by the memory allocation of variables. As far as I can see, a PIC .ASM file comprises a set of memory declarations followed by some commands. Variables are defined by naming them and giving their locations, thus:

VAR1 EQU H'10' ;defines the location H10 as VAR1
VAR2 EQU H'22' ;defines the location H22 as VAR2

and then you can load them:

MOVLW D'5'
MOVWF VAR1 ;puts 5 in VAR1 (location H10)
.
.
MOVLW VAR1 ;puts 5 back in the W Register

and generally play with them. But when I try to alter the program I have, it complains that some of the variables I create are in 'Restricted Memory'. I can't find any way to work out what is legal memory and what isn't. I have tried putting variable in random places until the error goes away, and then I hit the next problem, which seems to be that other processes also write to the memory locations I am using, so every so often my counts jump up by 20 or so. There are several simple tutorials on the web for blinking LEDs, but none seem to cover this sort of problem...

mister_e
- 11th April 2008, 02:43
Welcome back ;)

Which chip you're using right now? For each PIC, there's some dedicated places for the GPR. Look your datasheet under Data Memory Map, and see where you can sit your General Purpose Registers.

paul borgmeier
- 11th April 2008, 07:02
>>MOVLW VAR1 ;puts 5 back in the W Register

I am not sure if it is important to you, but this line puts 16 into W (not 5).

MOVF VAR1, W

would put 5 back into W

Dodgy Geezer
- 11th April 2008, 10:26
Hi, All,

I'm still using the PIC16F627. Thanks to Mister-E for pointing me at the data sheet (all 170 pages!!). I see that the data memory map is in 4 banks (I thought it was 2), and that there is a difference between 'unimplemented data locations' and 'general purpose registers' (which I don't understand). I had been putting my counts in the unimplemented slots, and they seemed to vary when I didn't touch them. Now I am putting them at H'20' onwards.

Where does the actual program code go? There seems to be no indication of this.

Paul has put his finger on one of my problems - I could not (and still can't) understand why MOVLW VAR1 does not put the contents of location VAR1 into the W register. And in my example, where VAR1 is D'5', where does the 16 come from? Is it D'16', or H'16'? But thanks, Paul - I used your recommendation and now my counts have improved considerably...even though I still don't know why!

I will stick with trying to make this motor work - buying a different microstep driver chip has required a different veroboard circuit, so I have been learning circuit design - VERODES is a really easy program to use for this purpose. Once I have cracked the code issues we will have another go at making this scope turn!

mister_e
- 11th April 2008, 10:50
Small and short explanation here...

There's a slight difference between Literal and Registers

MOVLW Move the literal in W.
Literal is a constant, when you're using a variable in there.. it return the constant associated to your variable... it's address
MOVLW .10 will copy 10 (decimal) in W
<hr>
MOVF Move register to x destination (F or W)
Rough explanation... Registers are variable... mean that you can change register value, not their address

MOVF YourVar,W will copy the value of YourVar to W
MOVF PORTB,W read PORTB, and store it to W
<hr>

where does the 16 come from? Is it D'16', or H'16'?
from this line
VAR1 EQU H'10'

10hex = 16 Decimal
<hr>

Where does the actual program code go? There seems to be no indication of this.

go one page before in your datasheet Memory Organization . Your actual code begin a RESET_VECTOR 0x000. You have different block, Program Memory, Data Memory and EEPROM data. Data memory are your PIC register and your GPRs
<hr>
Unimplemented.. you just can't use them.. not much ;)
<hr>
170 pages... well that's one of those small. I have some which have over 700, and some can't be download in one shot... DsPIC are good example... you must download the whole reference family set + the one for your DsPIC... kinda load of reading before getting comfortable with.

Oh well, don't be afraid, those datasheet looks way bigger when you begin.

Dodgy Geezer
- 11th April 2008, 12:52
Oooh..er. That's my reading for the rest of the day!


But I have one question (lots actually, but most will have to wait). You say that:

VAR1 EQU H'10'

makes the variable VAR1 equal to H'10'. I thought it made the memory register at location '10' addressable as VAR1. If EQU is the command for loading initial values of variables, what is the command for locating them at appropriate places in memory?

Dodgy Geezer
- 12th April 2008, 02:05
Aaah - I think I'm getting it now. I have a reasonably working bit of code - though I still need to understand how the switches work. I will try and get a test rig up over the weekend.

Incidentally, the original design for this board had two PICs, driving the two motors which direct the two axes. This was easy, since they do not need to work together. I am now thinking about automatic box pattern searches, which will need two motors to work in tandem.

This will be quite easy if one PIC can signal the other PIC to make its motor take a step. Is there any electrical reason why this should not be arranged by connecting a one of the RB output pins on the first PIC to an RA input pin on the second PIC? Then holding this pin high would be the equivalent of pressing an input button on the second PIC. Or is this not the way to do it...?