News:

Welcome to C5alive, the best place for help & advice on how to get the most from your iconic Sinclair C5. Check the meetings section today for events near you.
C5alive.co.uk  - Keeping the C5 Alive !!


Author Topic: nPOD - The Arduino based Pod/Control box Project  (Read 2715 times)

0 Members and 1 Guest are viewing this topic.

Offline baselpat

  • Jr. Member
  • *
  • Posts: 62
  • Battery level: 6
    • My C5 Photos
nPOD - The Arduino based Pod/Control box Project
« on: 23, October, 2012 - 15:41:22 »
After hinting in one of my other threads, I thought I should start a new thread for information, discussion and updates for a new project I'm working on  ;) :D :


A replacement control system for those C5 without any or only part of the original electronic control systems, with the goal of provide a cheap replacement using off-the-shelf parts or reusing parts to hand, to provide optional basic pelalec law compliance and to provide "original C5 pod" LED like feedback.

First, Some background.  My C5 was purchased from the previous owner who had removed the original control box and cut the wiring to the pod.  Like some of the last C5 to leave the factory all that was left was a simple battery->switch->relay->motor configuration.  While this works, it provides the rider with no feedback as to the state of the battery, motor temperature and current draw information or provide any way to "lock" the electrical systems of the C5.  Due to my locale, the C5 in its current state class it as moped and this requires registration and testing, however at some point in the last 18 years or so this was not renewed and was driven illegally in a quiet mountain village.  I am in the lengthy process of trying to track original documents etc to try and enable me be to legal on my C5 again, however I thought I would start work on a "Plan B" - to make my rudimentary C5 comply to the pedalec regulations enforced here in Switzerland and most of the EU with a fixed top speed of 25kph to re-class it as a E-Bike.  To do this I need a new controller and having evaluated the ULA replacement option, I decided to make my own using a spare Arduino unit.  The advantage of this is, that should I successful get the C5 registered as a moped, then I can still use the new Arduino pod controller for power/health/speed indicators etc and not use the pelalec part.

I envisage something along the lines of this (please excuse the crude overview at this stage, and sorry if you were expecting a completed circuit diagram and code already  :P ):



I don't expect this be the final overview, and currently this matches the set-up I have planned for my C5 - ie my 24 volt motor doesn't uses any "kit" that converts existing cabling etc.

LED pod
The pod unit is stripped of all but the original LEDs which are connected on a small board to some standard 74HC595 Shift registers.  As well as freeing up outputs on the Arduino board, it allows the the main Arduino control board to be located away from the pod with only a few wires to connect them together.

A very basic test of the control of these LEDs from the Ardunio can been seen with this video, please excuse the crude 80's link  8) ;D

Those without an original pod would simply be able to make a new LED array using what ever LEDs take your fancy

The main control board (the basic Arduino unit) with simply have a number of sensors and units connected to it.

Sensors
For the pelalec sensors, I have seen that this has been much covered on the forum, with the re-use of cycle compter switched or the install of new reed switched.  At least 2 will be required, one for the pedal sensing and one for the speed sensing.  This thread shows the logic I have also planned.



For the current sensor I plan to reuse my existing Ampmeter shunt or this Hall-Effect sensor  .  But I would plan to code to allow scaling to any shunt or monitor you have to hand.

2 Temperature sensor would be used to measure difference between air an motor temperature to allow better sensing of the motor.

Motor Control


The main motor control will utilize one of the many Arduino relay Modules available.  I plan to use this one for example, which will sit in the same circuit as the handbar switch and motor relay.  This means that what ever voltage is powering or system currently installed on the C5 (theoretically, even an original control system), it could be used to just use just the pedalec part of this project, if required  :D .

The code loop monitoring all these sensors would simply warn via LED, then switch off the motor control relay in cases of hot motor in conjunction say with repeated high Amp load or in pedalec mode high speed, lack of peddling etc

I hope that is clear (ish) and I realise that it is currently tailored to my current needs.
More to come soon, and I welcome any feedback or further ideas to be considered at this early stage.

Pat
« Last Edit: 24, October, 2012 - 15:52:21 by baselpat »

Offline radiomarty

  • Millennium Member
  • *****
  • Posts: 2641
  • Battery level: 100
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #1 on: 23, October, 2012 - 16:00:24 »
Exciting stuff - will be following this with interest :) :) :)

Offline mhurt

  • Full Member
  • **
  • Posts: 182
  • Battery level: 3
  • 4 legs may be better than 2 but 3 wheels better then anything!
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #2 on: 23, October, 2012 - 16:19:46 »
Exciting stuff - will be following this with interest :) :) :)

Me too!
I was going to look into this side of things, but simply don't have the time or concentration currently to do it.
I originally looked at using a Raspberry Pi (as I have one floating about not doing much), but the Arduino is much better suited for this type of thing, and then maybe send the data over to the Pi using the Gertboard for use with a display etc for things like GPS at a later date.

Offline KarlG

  • Hero Member
  • ****
  • Posts: 553
  • Battery level: 8
  • You don't have to be mad to own a C5, but it helps
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #3 on: 23, October, 2012 - 16:25:41 »
Hi Pat,

will you be tailoring you project to cover the existing C5 configuration?

Cheers.  KarlG.

Offline baselpat

  • Jr. Member
  • *
  • Posts: 62
  • Battery level: 6
    • My C5 Photos
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #4 on: 23, October, 2012 - 21:11:52 »
will you be tailoring you project to cover the existing C5 configuration?

At this stage, and how I envisage connecting to the wiring of *my* current setup (and other relay only setups), I could only see if this of being of use in a standard C5 for the pedalec functionality. This would be a simple case of adding what I am calling the Motor Control Interface Relay in serial to the standard C5 handlebar power switch.

I cannot see how (at this stage anyway  ;) ) what I propose could replace either only the pod or only the control box.  Anyway never say never, but without a standard C5 setup to work with, I cannot promise much more... Unless I am missing some else that you see that this could offer a standard C5  :D .

Offline radiomarty

  • Millennium Member
  • *****
  • Posts: 2641
  • Battery level: 100
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #5 on: 23, October, 2012 - 21:21:00 »
Hi - I think if you could come up with a replacement pod and control box that use the existing wiring and replace the original items as a pair you really would have filled a big gap in the C5 electronics - Big ask I know -Marty

Offline KarlG

  • Hero Member
  • ****
  • Posts: 553
  • Battery level: 8
  • You don't have to be mad to own a C5, but it helps
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #6 on: 24, October, 2012 - 01:03:35 »
Hi Pat,

I second Marty's comment, of course for a selfish reason, I need the pedelec function.  ::)

Offline mhurt

  • Full Member
  • **
  • Posts: 182
  • Battery level: 3
  • 4 legs may be better than 2 but 3 wheels better then anything!
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #7 on: 24, October, 2012 - 17:08:08 »
I think that once the base work has been done - choosing sensors, writing the initial Sketch's etc, it shouldn't be too much of a stretch to do the rest.

I've just installed the Arduino simulator on my mac, so if I ever get time, I'll start learning how to program them too

Offline baselpat

  • Jr. Member
  • *
  • Posts: 62
  • Battery level: 6
    • My C5 Photos
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #8 on: 30, December, 2012 - 20:14:50 »
mmmm  - long time no updates  - sorry (but I see someone else has ideas far better than mine  ;) )

Things have not been going too well with the police and the legal validity of my C5 (despite previously having been registered), so the Arduino part of by overall C5 project has stalled, while I worked on trying to get my C5 back to a fit state in the eyes of the local law.  Much money spend so far and as it currently stands I will have to remove my current motor and install a smaller one to even get a chance of a re-test and hopefully a numberplate to be able to get the thing out of the garage and onto the open road.

Right, back to viewing the touchsreen wonder over here:
http://c5alive.co.uk/forum/index.php/topic,2740.0.html

hopefully Dan can share some of his core code to see how it would compare to mine and maybe find away to make sub-routines that any ardunio/C5 project could use.

 :)

Pat
« Last Edit: 30, December, 2012 - 20:16:46 by baselpat »

Offline KarlG

  • Hero Member
  • ****
  • Posts: 553
  • Battery level: 8
  • You don't have to be mad to own a C5, but it helps
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #9 on: 30, December, 2012 - 20:27:26 »
Hi Pat,

sorry to hear about your problems as all seemed to be going so well.

Quote
Things have not been going too well with the police and the legal validity of my C5
What exactly happened?  ???

Cheers.   KarlG.

Offline dansretropod

  • Full Member
  • **
  • Posts: 138
  • Battery level: 3
  • The C5 was born to be customised... 3D style
    • www.c5owners.com
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #10 on: 30, December, 2012 - 21:34:59 »
Hi Pat,

Quote
hopefully Dan can share some of his core code to see how it would compare to mine and maybe find away to make sub-routines that any ardunio/C5 project could use.

Sure no problem I'll make the code available in a few days, feel free to dissect it and use it in your own project.

Thanks!

Dan

Offline Lancealot

  • Hero Member
  • ****
  • Posts: 835
  • Battery level: 5
  • Owning C5s are a pleasure and hassle..............
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #11 on: 31, December, 2012 - 23:34:32 »
Hi guys good bit of work but just a quick note that the sudden voltage (24v) via the relay will probably shatter the gearbox hence the use of PWM controllers. I would therefore suggest that you stage the impact on the motor / gearbox. I understand that an Adam Harper conversion change the motor voltage from 12v to 24v via relays and cut off the voltage to the control box and POD.

Keep going.

Lance

Offline dansretropod

  • Full Member
  • **
  • Posts: 138
  • Battery level: 3
  • The C5 was born to be customised... 3D style
    • www.c5owners.com
Re: nPOD - The Arduino based Pod/Control box Project
« Reply #12 on: 01, January, 2013 - 08:30:02 »
Quote
Things have not been going too well with the police and the legal validity of my C5 (despite previously having been registered), so the Arduino part of by overall C5 project has stalled

Please keep going on this one.  I think the fact you are keeping the original pod but fixing the long standing problems of having to rely on the ageing ULA chip will ensure it gets the support of most members here :)

Quote
Hi guys good bit of work but just a quick note that the sudden voltage (24v) via the relay will probably shatter the gearbox hence the use of PWM controllers.

Yep, thankfully the arduino has good support for PWM.  The board I made uses a single MOSFET transistor (with heatsink) rather than a relay.  Though I had to adjust the frequency to about 6000hz to get rid of the loud beeping noise caused by the default arduino PWM frequency.

Thanks!

Dan