I have it, but have not built yet. Got off tract building the balancing robot.sidmodi said:Has anyone built the controller using the Traco power TEC-2-4811WI voltage converter?
I have it, but have not built yet. Got off tract building the balancing robot.sidmodi said:Has anyone built the controller using the Traco power TEC-2-4811WI voltage converter?
casainho said:Some news:
2. @rananna documented a different build and 3D design for the wireless remote: https://opensourceebike.github.io/remote/alt/build_remote.html
casainho said:I did an update to the TSDZ2 EBike wireless controller page, mainly I put new updated images from my last build: https://opensourceebike.github.io/ebike_wireless_controller.html
So the documentation is at a good state. Next I need to build again my wireless remote and finally ride
@rannana or anyone that is experienced, I decreased the BUTTON_PRESS_TIMEOUT from 60 minutes to 3 minutes and I verified the code always blocks after 3 minutes but not like at 2 minutes or less than the BUTTON_PRESS_TIMEOUT.casainho said:After 3 hours I tested again and the remote was dead... I did open it again, measured the battery voltage and was now maybe half of the voltage, so it was discharged but not fully, still, no response at all from the buttons. Then I restarted using the reset button of the board and it was finally working again. So I think the firmware were blocked some where and running at full speed so did discharge a lot the battery in so few time. Maybe it is something with buttons being pressed by mistake... or something with the timeout of 1h after no button press - I think there must be a blocking condition (infinite loop?) on the code that may be triggered with some buttons combinations, since my remote keypad is easily keep the buttons pressed without me knowing.
Hmmm, I found that nrf_lp_delay_ms() was the blocking reason... so I exchanged all calls inside shutdown() to the regular nrf_delay_ms() and no there is no blocking at all. Finally I saw that shutdown() were being called a few times from regular main loop and only one time from the BUTTON_PRESS_TIMEOUT interrupt. I decided to shutdown_flag = true; inside that interrupt instead call directly the shutdown().casainho said:@rannana or anyone that is experienced, I decreased the BUTTON_PRESS_TIMEOUT from 60 minutes to 3 minutes and I verified the code always blocks after 3 minutes but not like at 2 minutes or less than the BUTTON_PRESS_TIMEOUT.casainho said:After 3 hours I tested again and the remote was dead... I did open it again, measured the battery voltage and was now maybe half of the voltage, so it was discharged but not fully, still, no response at all from the buttons. Then I restarted using the reset button of the board and it was finally working again. So I think the firmware were blocked some where and running at full speed so did discharge a lot the battery in so few time. Maybe it is something with buttons being pressed by mistake... or something with the timeout of 1h after no button press - I think there must be a blocking condition (infinite loop?) on the code that may be triggered with some buttons combinations, since my remote keypad is easily keep the buttons pressed without me knowing.
If you can think of what can be blocking...?? this is the shutdown sequence after that BUTTON_PRESS_TIMEOUT:
void shutdown(void)
{
led_sequence_play_next(LED_SEQUENCE_SHORT_GREEN);
led_sequence_play(LED_SEQUENCE_SHORT_BLUE);
led_sequence_play(LED_SEQUENCE_SHORT_YELLOW);
nrf_lp_delay_ms(2000);
I would like to try this DC-DC but on the datasheet it says it need external capacitors, probably the ones that are big. Did you installed the external capacitors and if so, do you have a picture of your board?beemac said:but if you want a more compact solution - I've also used two of these and they seem to work well and be reliable.
https://uk.rs-online.com/web/p/switching-regulators/1883365
casainho said:I would like to try this DC-DC but on the datasheet it says it need external capacitors, probably the ones that are big. Did you installed the external capacitors and if so, do you have a picture of your board?beemac said:but if you want a more compact solution - I've also used two of these and they seem to work well and be reliable.
https://uk.rs-online.com/web/p/switching-regulators/1883365
Thanks. Because I will buy 2 more NTG52 boards from RS components, I will buy that DC-DCs because they are small and I would like to have a smaller device, I will then design a specific case for 3D print using this small DC-DC.beemac said:casainho said:I would like to try this DC-DC but on the datasheet it says it need external capacitors, probably the ones that are big. Did you installed the external capacitors and if so, do you have a picture of your board?beemac said:but if you want a more compact solution - I've also used two of these and they seem to work well and be reliable.
https://uk.rs-online.com/web/p/switching-regulators/1883365
Yea I've posted a pic before - i've not used any external components - I have two boards using that dc-dc - one is my development board - and one on my fsr mtb - although I've yet to ride that much since I've only just fitted a battery... My main bike has the traco 4850wi and that's also been faultless so far...
https://endless-sphere.com/forums/viewtopic.php?f=28&t=106346&p=1626311#p1626311
beemac said:casainho said:I would like to try this DC-DC but on the datasheet it says it need external capacitors, probably the ones that are big. Did you installed the external capacitors and if so, do you have a picture of your board?beemac said:but if you want a more compact solution - I've also used two of these and they seem to work well and be reliable.
https://uk.rs-online.com/web/p/switching-regulators/1883365
Yea I've posted a pic before - i've not used any external components - I have two boards using that dc-dc - one is my development board - and one on my fsr mtb - although I've yet to ride that much since I've only just fitted a battery... My main bike has the traco 4850wi and that's also been faultless so far...
https://endless-sphere.com/forums/viewtopic.php?f=28&t=106346&p=1626311#p1626311
I think that 100mA will be more than enough.sidmodi said:beemac said:casainho said:I would like to try this DC-DC but on the datasheet it says it need external capacitors, probably the ones that are big. Did you installed the external capacitors and if so, do you have a picture of your board?beemac said:but if you want a more compact solution - I've also used two of these and they seem to work well and be reliable.
https://uk.rs-online.com/web/p/switching-regulators/1883365
Yea I've posted a pic before - i've not used any external components - I have two boards using that dc-dc - one is my development board - and one on my fsr mtb - although I've yet to ride that much since I've only just fitted a battery... My main bike has the traco 4850wi and that's also been faultless so far...
https://endless-sphere.com/forums/viewtopic.php?f=28&t=106346&p=1626311#p1626311
I noticed that the Traco 4850wi and the buck that casainho is using, both have a 5V 1A output. How important is the 1A? The Traco TEC-2-4811WI that is listed on the wiki has 5V 400mA. Do you guys think the output current is too low? If that is the case, can I (or someone with the permissions) update the wiki to update the part number there?
Thanks for all the feedback.gfmoore said:Just a totally different thought, but do you realise that you now have the basis for an SRAM etap style electronic gear changing system? As I see it, all that is needed is some way of pulling and releasing the gear derailleur by means of a stepper motor attached to the cable. I have seen such a system, but it wasn't as cheap as I would like. Anyway idle thought. Take some time to recharge and enjoy your families and cycling.
gfmoore said:Hi, for my own interest I want to see how all this stuff works. I am going to use Windows 10 and the Linux Ubuntu 20.10 wsl2 subsystem. I do have a Linux machine, but the screen size is too small when I remote into it so I'd rather use windows. (I thought using the windows linux subsystem might work ok - well it accepted all the apt installs)
Anyway, hit my first stumbling block, but to solve it I need to ask the question as to what my directory structure would look like? I cloned the entire repo, but when trying to clean noted that there are two tasks.json Clean is using the top level one. I am thinking that I should be using just the firmware directory and not need anything else? Or I need to set VSCode to just use the firmware folder, but I don't know how to do that - is it something to do with ${workspaceFolder} ? Currently that is pointing to the top of the cloned repo.
Gordon
Go to the makefile and remove the entry for that folder, as I think it is not needed (if so, this need to be corrected): /nRF5_SDK_16.0.0/components/ant/ant_key_manager/configgfmoore said:Well I think I answered my question (partly). I just put the contents of the firmware folder at the "root" level - i.e. my ebike directory and was able to clean and compile. I would prefer to be able to clone and point at the firmware folder though.
However I got one compile error:
> Executing task: make <
Makefile:317: Cannot find include folder: ./nRF5_SDK_16.0.0/components/ant/ant_key_manager/config
mkdir _build
cd _build && mkdir TSDZ2_wireless_remote
Assembling file: gcc_startup_nrf52840.S
Compiling file: nrf_drv_clock.c
Compiling file: nrfx_clock.c
Compiling file: nrf_log_backend_rtt.c
Compiling file: nrf_log_backend_serial.c
Compiling file: nrf_log_backend_uart.c
Looked in the folder and that file wasn't there, just
gordon@GM-One:~/ebike/ebike_wireless_remote/nRF5_SDK_16.0.0/components/ant/ant_key_manager$ ls
ant_key_manager.c ant_key_manager.h
As far as I can tell anyway. Am I missing something?
(I'm pretty pleased that it almost worked - I am making notes as to what I do! )
gfmoore said:Hi, so something isn't right in the code or my toolchain and I don't want to go down a rabbit hole.
I went into MAKEFILE and removed (eventually) three lines that referenced ant_key_manager
213 $(SDK_ROOT)/components/ant/ant_key_manager/config \ removed (why does # comment not work?)
then
211 $(SDK_ROOT)/components/ant/ant_key_manager \ removed
then
107 $(SDK_ROOT)/components/ant/ant_key_manager/ant_key_manager.c \
(I couldn't understand why the comment character # would comment the line and everything after it???)
Then I got an error in main.c so commented out //#include "ant_key_manager.h"
Then I got an error
...
Compiling file: main.c
./main.c: In function 'softdevice_setup':
./main.c:907:14: warning: implicit declaration of function 'ant_plus_key_set' [-Wimplicit-function-declaration]
907 | err_code = ant_plus_key_set(ANTPLUS_NETWORK_NUM);
| ^~~~~~~~~~~~~~~~
Compiling file: eeprom.c
...
I'm thinking before I start removing, commenting out any more code (that I don't know what it does) some thought may be in order
I'm assuming you guys have been able to compile and not get these errors so what might be different to what you have and what I have cloned? Am I doing something stupid - probably as this is a bit new to me. I have used VSCode for personal web development projects, JavaScript etc, but the last time I programmed in C was in 1984 (ish) on an IBM PC clone. (No hard disk just 5 1/4 inch floppy disk and wrote a quicksort program - yay me!)
Gordon