A
Anonymous
Guest
.
nutsandvolts said:Cool that it works steveo.
You now have the controller speed output connected to the SP (speed) pad on CA, is that right?
IIRC you were converting this from external speedo sensor to internal, do I have that right?
nutsandvolts said:Justin's firmware source code, like all source code, has some default values. Those are all of your configuration settings plus whatever other unadvertized defaults he uses. When you flash the micro, some things will revert back to default values. So check all the settings. What do you have for number of poles etc? It is always best to record ALL of your CA settings before flashing, otherwise, you may end up with a different config without even knowing what changed. How about listing all your settings here, including the advanced settings?
Check the number of poles ... from CA manual ... For Direct Plug-in units, this should be set to the number of hall effect transitions per rotation of the wheel. Crystalyte 400 series hubs have 8 while the 5300 series hubs have 12. For units that use a speedometer sensor and spoke magnet, #poles should be set to 1, unless you have multiple magnets on the wheel. The #poles can range from 1-14. If your motor requires more than 14 poles, then you will have to compensate by reducing the wheel circumference.
nutsandvolts said:A scope would be good for looking at the speed signal, but since you're getting no speed reading at all, if you don't have a scope, perhaps just try a DVM on the wire going to the SP pad on CA to see if there is any signal.
steveo said:I have converted my c/a from external speedo & external shunt to a direct plug it, ...
-steveo
wildnrg said:Anyone know if they would be suitable to sit between the CA and the Wifi module?
http://www.futurlec.com/Mini_RS232_TTL_5V.shtml
The concept is CA -->TTL-->Mini_RS232_TTL_5V -->RS232-->Wifly GSX Super -->TCP/IP-->iPhone/iPod Touch/PC
Do I need to do all that or can I just connect a 9V battery to the 5-12V power pins (see below) and just connect the CA to the RX and GND on the UART inputs of the wifly module
nutsandvolts on page #1 said:#1
The Cycle Analyst Beta 2.1 firmware enables serial data output and has a few other new features. The serial data transmit signal is TTL rather than RS232 voltage level so must be converted using a level converter IC (MAX232 or similar) to communicate with an RS232 serial port. Many PCs and most laptops these days no longer have serial ports, in this situation a USB serial dongle can be used. I have the cycle analyst sending data to my laptop. Here are some pictures of the parts used.
Parts Used: Perfboard, MAX232C RS232 level converter IC, 1uF capacitors, RS232 cable, and RS232 to USB converter dongle.
Image
Basically all that is needed is TTL to RS232 level conversion for the data output, power for the conversion circuit is available on a pad labeled 5V on the cycle analyst board. Here's the little circuit to do the conversion. Normally I would use cheap electrolytic capacitors for level conversion, shown are expensive tantalum caps because those are what I had on hand. Here is the level converter circuit, as specified in the MAX232C data sheet.
Image
These are the pads where the circuit connects to cycle analyst.
Image
The USB serial dongle used is product UMC-201 which uses the FTDI FT232BM chipset. It "just works" on linux, of course it will work on windows too, if you install drivers.
On plugging in the USB Serial converter, the linux kernel reports:
usb 5-2: new full speed USB device using uhci_hcd and address 2
usb 5-2: configuration #1 chosen from 1 choice
usbcore: registered new interface driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI USB Serial Device
ftdi_sio 5-2:1.0: FTDI USB Serial Device converter detected
drivers/usb/serial/ftdi_sio.c: Detected FT232BM
usb 5-2: FTDI USB Serial Device converter now attached to ttyUSB0
usbcore: registered new interface driver ftdi_sio
drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters Driver
The data rate is configurable on cycle analyst in the advanced setup menu to be 1Hz or 5Hz. The serial communication settings are 9600 baud, 8 data bits, 1 stop bit, no parity, no flow control. Here is a picture of data from cycle analyst displayed in the minicom terminal program.
Image
The data sent over the serial port is Amp Hours, Voltage, Amperage, Speed, Distance.
After looking at the data I realized I needed to select the "Zero Amps" function in advanced setup as the amps were showing a negative value.
I have lots of ideas of what to do with this, one is I would like to overlay the data (speed, voltage, amperage, watts, amp hours) onto video camera view. Not sure how to do that yet but looking into it now. I'd like to also put another microcontroller in the mix, stamp the data with date/time/location/elevation from GPS and add temperature sensors.
--------------------------------
#2
Comparing the Beta 2.1 setup options with the 2.0 manual to see what is new, there's only five new configurable items:
1) Serial Data Output (1Hz or 5Hz) - this is sample rate not data communication rate (9600 baud works for both 1Hz and 5Hz)
2) Set TotDist - This allows you to enter your distance from before you did "full reset" on changing batteries, nice!
3) Set TotAhr - This is the same thing but for total accumulated amp hours, to enter your prior total before full reset
4) Aux Voltage On or Off
5) Aux Thresh
If I recall correctly, Justin said that the aux voltage and threshold were added to allow different throttle configuration,
for example a current mode throttle, the details of which escapes me.
I have a QuickCam Pro 9000 and just compiled drivers (uvc-linux) and am now exploring options for overlaying the
cycle analyst data onto live video. Fortunately things like this are much easier in linux than windows, so I expect to
have that working fairly soon, although I'll start with some C code to read and parse the serial data.
One bug has been experienced so far in the Beta 2.1, for which I still don't know the cause, occassionally it gets into
some kind of loop where it keeps rebooting, and simple power cycling of the unit doesn't work if you are moving
because back EMF keeps it running and looping. It has only happened a few times and I've been running this beta
for a while now so it doesn't bother me, if it happens I just have to stop and power cycle the unit.
---------------------------------
#4
I have tried various linux distros including ubuntu but always go running back to slackware. The only thing I like better is linux from scratch, but its a lot of work to get a full system with x-windows and desktop running. That said, there's nothing like compiling a compiler and building the entire mess from source code!
I have explored some options for overlaying the cycle analyst data onto live video, there's a few quick hack ways like using ffmpeg with vhook to imlib2, or messing around with subtitles using menucoder, but I'm leaning towards using the video4linux API and writing the stats as text directly to frame buffer while writing each frame to video output. This way eveything would be in memory and not require disk activity for the overlaying of data onto video.
---------------------------------
#6
Sweet! New firmware. Thank you this is awesome. I like the changes, especially setting the battery cycles.
I was planning to pester you for the hex file anyways, for the second cycle analyst I have now.
This is the red one you sent, stocking stuffer thing (thanks!), it appears to be a different version of the
hardware, the newer one I purchased is marked DB2 Rev7 but this red cycle analyst doesn't have a
version number on the microcontroller pcb. I note however, that they both use the same PIC16F690
microcontroller.
Do you know if this new firmware will work on the older (red color, standalone version) of cycle analyst?
I see the PICkit2 kit at digikey for $66.35 CDN. That should be all I need to load the hex file, is that right?
http://search.digikey.com/scripts/DkSea ... V164120-ND
------------------------------------
#7
Hmmm the PICkit 2 kit would be easier for flashing but ...
The mplab software can be downloaded for free.
Looks like its easy to make a programming cable.
Also, it seems one can buy just the USB dongle programming cable for $46.44 CDN rather than the full PICkit 2 kit
http://search.digikey.com/scripts/DkSea ... G164120-ND
--------------------------------
#10
The required cable for flashing is specific to PIC microcontrollers. Your cable will not work as is, but could probably be adapted to work. You would have to look at some of the home brew PIC programmer cable schematics to figure that out, or read the microchip specs. It would be much easier to buy a PIC programmer dongle from microchip, digikey, or elsewhere, or to make a cable based on schematics (there are many schematics for PIC programmers on the web). The software to load the firmware (hex) file is called mplab, and its freely downloadable from microchip. Links to the software, programming cables, and schematics to make a cable are already in this thread, see above. The mplab software is a complete development environment (compiler, linker, assembler, etc) but we need it just for flashing (loading the compiled hex (binary) file onto the cycle analyst. I assume that there are other simpler flash loader programs people have written that will also work, but we know for sure mplab works (I have seen it done). With the USB programmer dongle that comes with the PICkit 2 kit (from microchip), there is an IC clip on the end of the cable. It clips right onto the cycle analyst pcb board, then it only takes a few seconds to load the new firmware. I got distracted from this work but definitely plan to work more on it. I will probably interface to another microcontroller with lots of storage (sd card) to save data for later loading to pc).