Ramble

Wiring up the Test Bed MkI … Part II

As planned, today was going to be test day (along with haircut day, but that’s a different story).

I mostly continued yesterday’s work of crimping cables. The hammer crimper still makes me happy. In fact, here it is in action (along with some questionable dubstep):

When I am actually using this stuff on a moving kart, I will probably want to maybe add some heatshrink and whack the thing a little harder (maybe from both sides). But so far, the crimps looks solid. Even after wiggling the cable around and pulling in jerks, the lug doesn’t budge. Good deal.

As far the actual setup:

This is the reversing contactor (SW-202). In the current test setup. It’s being used as a non-reversing contactor, i.e., it just turns power on or off.

The controller gets the throttle pot-box input and switched power input along with the main 24V power from the batteries.

Push when you’d rather not shit your pants. Or are already in the process of doing so.

The current setup looks fairly messy, but when it’s on a frame, I’ll have a better chance of organizing things better. Once the final leads were connected to the motor, I was ready to give it a whirl. So I turned on the kill switch, heard the contactor come on and pushed the throttle up. Nothing.

After a little debugging,  I found that the controller was setup (understandably) for 72V. Therefore, the undervoltage setting was at 60V. My batteries were at 24V. I changed the undervoltage to 20V. I also bumped down the max current to 30%. I am not sure how much I can thrash these SLA batteries yet, so I figured it’s better to be safe for now. Time for Run #2:

* maniacal laughter * That is all.

Next step is to test this on the frame. Hopefully not break any fences with my head.

Wiring up the Test Bed MkI … Part I

Motor controller and pot-box sorted, t’is time to wire up the batteries and motor. Didn’t end up finished all of it today since the sun goes down at fucking 4:30pm these days. Did manage to test out the contactor and the crimper tool though.

The above is the set of tools that comprise my cheap(/ghetto) crimping solution. The hammer crimper actually worked quite well. For $15, it does a bangup job and works as advertised. I bought mine from Amazon, but you can find these things everywhere for fairly cheap. Using it is fairly easy.

  1. Strip about 1/2″ of insulation.
  2. Push through lug
  3. Place in gap under crimper “piston” and release lock on the back
  4. HAMMER TIME

Result.

Once this is all wired up, things will hopefully not break the table. The only thing missing from this picture is the contactor (i.e. a massive relay) that is used to control power from the battery to the rest of the system. I was wondering if I would actually hear the contactor work when tested by itself. And uhh… yeah. You can.

The contactor allows me to safely disconnect power from the batteries in case of an emergency when the throttle is on full tilt. With a regular switch, I might see an arc as the switch is being opened, which in turn might lead to some very very bad things.

When the sun comes out tomorrow, I’ll hopefully finish the test bed and do some … testing.

Motor Controller + Pot Box Test

Before hooking up the motor and controller to the test batteries, I decided to do a quick test of the controller with the pot-box. The Alltrax AXE7245 controller is quite nice in that you can just use a regular serial cable to communicate with and program it. This will open up some embedded control options later on, but for now, I am going to use the ControllerPro software that comes free from Alltrax to monitor and program it.

The Pot-Box is just a … well.. potentiometer. It comes with two leads and go to two contacts on the controller. Convenient.

And hey, it works! The following is a wonderful video showing just that.

By the end of the day, I will hopefully have tested the controller with some real batteries and the actual motor.

Test Batteries

Before buying a full Li-Po pack and testing with it, I decided to buy some much cheaper SLA batteries to test the entire circuit at about 1/3 power. These SLA batteries are much heavier – just the two batteries I bought, running at 24V total, are actually heavier than a full Li-Po pack running 72V. But they also only cost $195, as opposed to about $1200. I am hoping things I see performance wise scale 3X when I go to LiPo since the LiPo packs will be the same weight with about 3X the power. I am sure it won’t be so simple, but it should give me a good idea for what to expect.

MEM <= OVERLOAD

Finally sat down today to learn some VHDL on my Spartan 3 Starter Board … which I bought about 2 years ago now…

So far I can do the following:

  1. Control LEDs with push buttons
  2. Control the Segment LED array on the board based on switches and pushbuttons
  3. Blink the decimal point segments at 1Hz.

The first hurdle in this process is actually using the Xilinx ISE. Xilinx has several tutorials but they don’t go very far. I have yet to find a good tutorial on how to use a clock – which was annoying when it came to #3 in the list above.

Once I had learnt my way around the IDE, #1 and #2 were fairly easy. #3 as I mentioned above was trickier because there was somewhat limited information on how to use clocks. So far, I am generating 1Hz using a counter and counting up until my 50MHz clock has reached 1 second of delay.

process(Clk)
        variable counter_1Hz:integer range 0 TO 50_000_000;
        begin
                if Clk'event and Clk = '1' then
                        counter_1Hz := counter_1Hz + 1;
                        if counter_1Hz = 50_000_000 then
                                tmp_clk_1Hz <= not tmp_clk_1Hz;
                                counter_1Hz := 0;
                        end if;
                end if;
end process;

What I am doing above is basically waiting for the clock to generate an event. In that event, I check to see if the value of the clock signal is ’1′ (or high). This basically translates to “wait till a high transition”. When this happens, I increment a counter. When the counter reaches 50000000, 1 second has passed and I toggle the tmp_clk_1Hz signal.

There are some other keywords I still have to look into like PERIOD and TIMESPEC. It looks like you can do some sort of dividing here. It would be more convenient to just generate slower clock signals through the User Constraints File (.ucf) where you map your logical signals to actual pins on the IC.

That said, this is fun. It’s somewhat weird the way VHDL works if you are coming from a procedural world of programming, but it’s fantastic in the sense that things are sort of on automagic. You just tell LED that it’s “equal to” CLK_1Hz and from then on, whatever CLK_1Hz does, LED does too. No loops, no weird threading etc.

I intend to use the board for powering the LavaLamp project. It’s probably overkill. But it’ll be a good excuse to learn more VHDL and actually use this damn board.