u.RAT – A Very Exciting Journey!

uRat Logo Copyright (c) 2017 – Rich Holoch 

Killer logo designed by Jeff, K1NSS. The logo will be copy righted, the project will be Open Source.

A very big breakthrough today – I have the KPOD and the Stepper code working. The KPOD is the “Head” written in C:

. . . . and the Stepper code is written in Python (the Tail).

This site has really great interactive pinouts:

https://pinout.xyz/pinout/ground

And I owe the Python and TB6600 driver wiring bits to Haydn from Hawaii who has the only really useful posting on the web that clearly explains how to get the Raspberry Pi working with the TB6600:

http://www.nlogn.com/blog/

It turns out that this might be the most important part about Haydn’s Blog Post:

HY-DIV268N-5A Connects to:
DIR- RPi GPIO GND
DIR+ RPi GPIO #18
PUL- RPi GPIO GND
PUL+ RPi GPIO #23
EN- RPi GPIO GND
EN+ RPi GPIO #4 or GND
A+ stepper green wire
A- stepper gray wire
B+ stepper red wire
B- stepper yellow wire
DC- GND (black on PC power supply)
DC+ +12v (yellow on PC power supply)

 

As it turns out, his HY-DIV268N-5A driver uses the same chip as my driver, the Toshiba T6600. The other “biggie” in this puzzle was accidentally getting the dip switches right on the driver. What helped me is my new bench power supply – which lets you set and limit voltage and current. The dip switches also limit current – so its easy to have the motors just sit there – not moving, even though you are sure everything is wired up right and that your code looks right.

Quite a few “variables” even for what really is a very straight forward project. If I had to brag – it wouldn’t be the code or the electronics, but the simple idea to glue two awesome products together using a Raspberry Pi – for me, the “Conceptual Design” is the coolest because I do feel its quite “elegant”. In fact, if you want to just use a rotary encoder, a couple of switches and a home brewed antenna tuner – the whole shebang could be built using parts worth maybe $100 – $150 tops. If you have a junk box – its less. Using the KPOD and the BT1500A cost me $1000 instead of just buying a remote-able Palstar AT-AUTO, which is a darn nice rig, but I don’t think is the right circuit for the open wire / balanced fed Mod Bob. The BT1500A is still my favorite antenna tuner ever, and the KPOD – my favorite tuning knob ever.

Most of the parts that you can get in the Maker world are made in China, and they either come with zero documentation or if there are more than a simple diagram, “Chinglish” that you have to reverse engineer to (hopefully) understand. Some of the products have horrible QC – the two drivers I used when I had the stepper motors turning on the Arduino worked fine – but the way they soldered the screw clamp connectors – they wouldn’t open or close and I had to solder my wires right to the board.

Luckily, these SMAKN TB6600 driver boards are top quality and I don’t have to do anything special. They run nice and cool too – and have a massive heat sink:

I purposely over engineered the drivers and motors so they would last outdoors in the heat and cold, and also so I wouldn’t have reliability issues voltage or current wise.

The “official” Arduino and Raspberry Pi boards are very high quality. Two Chinese brands that seem good (so far) are SMAKN and Elegoo. This is where Adafruit rocks – they don’t sell junk, and their prices are fine. The Pi Hut looks good too. The driver boards with the crappy connectors were from SainSmart – and while I only purchase products with high marks (reviews), perhaps I got a couple lemons?

Wow – this couldn’t come at a better time in my “hobby life”. DXCC Chasing has been stale ever since VK0EK was on the air – except for Top Band – but the wait between entities on Top Band can be long once you get above about 50 entities. I surely am very pleased that I worked what I did when I did since July 2001 – 16 years ago, but with 2 left for Top of Honor Roll and 13 left for DXCC on Top Band, I was “pining for the fjords”. Or maybe “watching the grass grow”.

Enter in this new “Maker World” and I feel like my next chapter is very clear, very exciting and opens my mind in a way that sitting around hoping some DX will activate just can’t do.

My next trick will be to add in the C GPIO control code to Paul’s Elecraft code. It might be as easy as some setup of the three pins 4, 18 and 23, I guess set enable on and then in the loop that is printing the KPOD information add a single command that pulses the direction using the sign of the integer and the step with the integer value. Something like this, which is a very small subset of this example: http://raspberrypihobbyist.blogspot.com/2014/02/stepper-motors.html

#include <wiringPi.h>

const int NUM_STEPS = 6; // number of steps including half steps
int currentStep = 1; // just assume this starting point

 pinMode (4, OUTPUT) ;
 digitalWrite(4, 0);
 pinMode (18, OUTPUT) ;
 digitalWrite(18, 0);
 pinMode (23, OUTPUT) ;
 digitalWrite(23, 0);

// step the motor. 1 for clockwise, -1 for counter-clockwise
void step(int dir) 
{ 
    currentStep += dir; 
    if (currentStep>NUM_STEPS) 
        currentStep = 1; 
    else if (currentStep<=1) 
        currentStep = NUM_STEPS; 
    MoveStepper(currentStep);}

int main()
{ 
    int i, x, c; 
    // initialize WiringPi library 
    x = wiringPiSetup (); 
    if (x == -1) 
    { 
        printf("Error on wiringPiSetup.  Program quitting.\n"); 
        return 0; }
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: