Specific Pic Progra...
 
Notifications
Clear all

Specific Pic Programming

30 Posts
5 Users
0 Reactions
20.4 K Views
dirknerkle
Posts: 10310
(@dirknerkle)
Illustrious Member
Joined: 18 years ago

A few years ago I played with the 688 code a bit in trying to insert a "minimum" and "maximum" for the RenServo firmware so that the value would never be greater than a value that would peg the servo to either extreme, which can physically damage the servo. Typically, dedicated servo controllers include settings (usually potentiometers) to tweak the range of a servo's motion between a desired range which is never at either of the servo's extremes. Vixen's range is, of course, 0-255 in a cell value and the RenServo firmware translates these values into an appropriate pulse, using 127 as the "center" of the servo's motion. However, between sequences, Vixen isn't sending anything, which the RenServo firmware sees as zero and the servo gets jammed at its minimum.

Since servos have a center point and when initially powered up, they generally "find" their center. But different servos have different ranges of motion -- some are 90 degrees, some are 120, some are 180, 225, and some are continuous rotation. Therefore, it's important to be able to change the min/max setting to prevent servo damage. Since the 688 can effectively control up to 8 servos, I was trying to create a minimum and maximum for each of the eight channels so that if the value for a servo was lower than its minimum, the minvalue would be substituted and if the value was greater than the maximum, the maxvalue would override it.

I vaguely recall that I had inserted quite a few lines of code to do the proper comparisons for each of 8 outputs and the result was that nothing worked after that.

I played with it for a couple days, wasn't successful at all and I eventually gave up on the project.


Reply
Posts: 6728
(@p-short)
Illustrious Member
Joined: 19 years ago

RenServo is a totally different beast, I'm not sure who wrote that (ctmal, perhaps)? In all of my Renard code the ISR is used for driving the SSR's, and the foreground is used for serial communications (receiving and forwarding data, and placing locally-destined data in an array for use by the ISR). I've never looked at the RenServo source to see how things are handled there.


Reply
Posts: 6728
(@p-short)
Illustrious Member
Joined: 19 years ago

The author of RenServo is ctmal, but unfortunately it appears that the links to his RenServo firmware are no longer usable.


Reply
Posts: 446
Topic starter
(@amigorick)
Honorable Member
Joined: 16 years ago

Wow !!!! Talk about above and beyond!!! I wish I knew the coding like you and some of the others.
Sure I can look at it and "understand" what it might be doing, but not enough to make it do it.
Is there any study material (for Dummies) out there that us wannabee's could look into to try and learn how to do it?

P. Short wrote:I haven't forgotten this thread.

I've just created a PIC16F688 program (renard-chase) based on bits and pieces of code from here and there, and am about to do some testing of it.

Perhaps I got a bit carried away, especially since it would likely be a one or two line change to the diagnostic PIC that does a lamp test (if I had the source, which I don't) to do what was requested. The program that I'm working on has a few extra bells and whistles:

1) It has a user knob that controls the rate of the chase.
2) It has a user knob that controls which outputs are the first and last in the chase (allowing up to eight lights in the chase)
3) It has a user knob that controls the direction of the chase
4) It has a user knob that determines if the chase always continues in one direction, or changes direction when it hits a 'limit'
5) It has a user knob that controls the attack rate (i.e. does a light come on full-brightness when it first turns on, or does it's brightness ramp up)
6) It has a user knob that controls the decay rate
7) It has a user knob that determines how many outputs are on at once.

By 'user knob' I mean a #define statement near the beginning of the assembly file that the user can change.


Reply
Posts: 2215
(@ctmal)
Famed Member
Joined: 19 years ago
P. Short wrote:The author of RenServo is ctmal, but unfortunately it appears that the links to his RenServo firmware are no longer usable.

Yeah, I just noticed the other day that my site is down. I hope to fix it this weekend. In the meantime, I'm sure I have it somewhere if you want it.


Reply
Page 4 / 6
Share: