OnStep telescope control on teensy.

Status
Not open for further replies.
Oh, I have not done anything, it has been you, Paul, and HJD that have done the mods. I have just been here sitting, watching, and testing code.
 
Found the problem, iOS does not support SPP, it does show up on a co-workers kindle.

My App provides for Alignment/Parking/PEC/Goto/etc. but only on Android.

An update is on GitHub...

I eliminated the microsecond delay and switched to doubling the speed of the motor control ISR's. A toggle switches between: pulling the step pin low and changing direction as necessary -and- actually taking a step (along with all of the logic to keep track of where the motors are.)

This runs smoothly and reaches an 8us step rate with the setup I've described... that's 39rps 2343 RPM. The motor has to accelerate slowly to reach those speeds and has near zero torque up there, but it will spin that fast. Performance is good and I've taken care of a variety of annoying little bugs in OnStep too... I'll move on to testing a variety of software/hardware to see how it behaves. I'll have that ASCOM driver up soon too.
 
I was using the iphone to see if the module was working. It does, I even changed the modules broadcasted ID.

Sounds good. I will try to hook up a servo tonight to see how it reacts.
 
I was using the iphone to see if the module was working. It does, I even changed the modules broadcasted ID.

Sounds good. I will try to hook up a servo tonight to see how it reacts.

FYI, The matching ASCOM driver is now up on my site.
 
I got a drive connected. I have found two problems. First the step and direction pulses coming out of the RA axis were only about 1/2 volt. I found in the setup you still had pins set for 11,12,and 13:

#define HADirPin 11 // Pin 11 (Dir) PB3 PB5
#define HA5vPin 12 // Pin 12 (5V?) PB4 PB6
#define HAStepPin 13 // Pin 13 (Step) PB5 PB7

I set these to 10,11,12 and got full voltage out of the pin.

Next problem, either way I am seeing pulsing on the direction pin when it is moving. This should not happen.

Step form is really rough at tracking speed. It was better before I changed those pins to 10,11, and 12. Maybe code conflict? Here is the step waveform, you can see it getting shorter and longer, sorry for the quality, I just grabbed my battery powered scope.

Untitled by macona, on Flickr

This is what is going on at the direction pin at the same time. There were pulses here before and after I changed the pins:

Untitled by macona, on Flickr

Last issue, with the new driver it is taking about a full minute until sky planetarium connects with the teensy, from button click to green indicator.
 
I got a drive connected. I have found two problems. First the step and direction pulses coming out of the RA axis were only about 1/2 volt. I found in the setup you still had pins set for 11,12,and 13:

#define HADirPin 11 // Pin 11 (Dir) PB3 PB5
#define HA5vPin 12 // Pin 12 (5V?) PB4 PB6
#define HAStepPin 13 // Pin 13 (Step) PB5 PB7

I set these to 10,11,12 and got full voltage out of the pin.

Next problem, either way I am seeing pulsing on the direction pin when it is moving. This should not happen.

Step form is really rough at tracking speed. It was better before I changed those pins to 10,11, and 12. Maybe code conflict? Here is the step waveform, you can see it getting shorter and longer, sorry for the quality, I just grabbed my battery powered scope.

Untitled by macona, on Flickr

This is what is going on at the direction pin at the same time. There were pulses here before and after I changed the pins:

Untitled by macona, on Flickr

Last issue, with the new driver it is taking about a full minute until sky planetarium connects with the teensy, from button click to green indicator.

I noticed the same problem with the pin assignments, it was fixed on GitHub yesterday.

Sky Planetarium will choke on the PEC data readout when first connecting if things aren't as they should be... that's fixed in my development version (checks for error and aborts readout), but can cause the problem you're having. It reads the data in blocks of ten and each has a two second time-out... it can take a while. :D

Did you make configuration changes to OnStep.ino? If so, could I please have a copy so I can duplicate your setup and try to see what's going on.

As for tracking pulses and that direction pin... I believe it's working close to as designed. The motor ISRs' have logic that basically counts steps and chase the target HA and Dec positions. When sidereal tracking, the Dec ISR is programmed for the sidereal rate and the HA ISR is programmed for twice the sidereal rate (so that +/-1x sidereal rate guide corrections can also be played back.) Since I (and most others) micro-step the steppers down at a level where they sometimes barely even move for a step pulse this level of accuracy is as far as I went. This is also why the direction pin changes, the logic is such that it switches direction if it catches up - but no step is taken so it doesn't matter. I could stop this behavior, but especially on the Mega2560, every cycle counts.)

In the program main-loop it checks in 1/100 second intervals to decide if the target HA is to be advanced (a tick) to achieve the sidereal tracking rate. The motor timers' then make it happen in the background.

There's a couple of ways to correct/improve this timing situation, a fairly easy way that I believe holds promise would be to...

Program the motor ISRs' for the sidereal rate (probably a very very tiny bit faster so the HA never falls behind) and only adjust the rate up/down while guide corrections are being applied. This would smooth out inconsistencies in the timing of the target HA's advancement ticks. The guide commands already program the motor rates, the logic is there - it's just not used at the 0.5x and 1x rates, only higher.

Finally, I just realized that another problem exists that has to do with the change in design of the motor ISRs' for the Teensy... it should be straight forward to fix.
 
Yeah, it would be best to disable that. The direction pin should never change state while it is tracking unless it is actually changing directions.

I have made no changes to the program other than switching those pin numbers to get it to move. I will give it a try again tonight.
 
Status
Not open for further replies.
Back
Top