Kickr core conversion #343
Replies: 7 comments 7 replies
-
You’d want to scale rtConfig.getCurrentIncline() to a 0-255 scale and output that on any pin not currently being used. Presumably you could do all this in main.cpp . Good Luck! I’m out on vacation until next week but possibly @eMadman or @MarkusSchneider has more insight into this. Edit CurrentIncline is what you want, not stepper position. |
Beta Was this translation helpful? Give feedback.
-
Hi @Rogers2000, To set the PWM output you can replace this method: Lines 216 to 277 in c786143 rtConfig.getTargetIncline() gives you the requested incline from the Trainer (Zwift). If you want to use the shifter you have can also use rtConfig.getShifterPosition() * userConfig.getShiftStep() You'll find the value of the targetIncline in the logs of SS2K in ERG Mode. This will help you to find the correct factors for the pwm out. You should also connect a power meter for ERG 😉. |
Beta Was this translation helpful? Give feedback.
-
If you want to connect power meter/pedal, cadence is also sent by them via BLE. So nothing must changed. If you like to use the cadence sensor from kickr you have to set: SmartSpin2k/include/SmartSpin_parameters.h Lines 63 to 64 in c786143 Should work if no cadence sensor via BLE is connected. Best way to do this is to create an interrupt function in main.cpp and use the setSimulatedCad Function |
Beta Was this translation helpful? Give feedback.
-
Update: thanks for all the help, I have managed to connect up all the kickr hardware to the esp32. I now have power and cadence through a hardware interrupt and I get get my guy moving on zwift. It is just pseudo watt measurement through a rough calculation I made up but it seems the speed and power output on swift are in the ballpark to be usable. Next is the PWM, but I dont think I will have any major hassles, I now have a direct I/O line that controls the braking (0v = full brake applied, 3.3v = no brake applied as tested) so thanks @MarkusSchneider for the pointers on where to start with the code. I even have the original kickr LED lights in use so I can keep it compact and professional looking. saved me a lot of money! (for anyone looking at my git fork, I know there are inefficiencies in the code, especially the debounce for the cadence. Beware!) edit: now have PWM working with feedback from the simulated incline. a simple implementation of the ledc library's enough to get it up and running |
Beta Was this translation helpful? Give feedback.
-
I looked over your fork and it’s pretty cool! Great job getting it working. This is something that I was curious if it was a possibility. Congratulations on getting it working! |
Beta Was this translation helpful? Give feedback.
-
@Rogers2000 , you’ll probably want to bring your fork up to date with the latest develop as well. I’ve switched to using a more stable file system which looks like it solved quite a few issues. The only downside to the new file system is that upgrading the fs via OTA updates isn’t currently implemented but that’s not an issue in your use case anyway. |
Beta Was this translation helpful? Give feedback.
-
I'm contemplating trying this for an old Computrainer. would need to drive a 5 volt DC MOSFET on the controls side. how's your effort going? |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I have a kickr core that had smoke come out of the PCB, after inspection there were a few blown caps and possible power surge, resulting in a dead microprocessor which is unrecoverable. I was about to give up and bin it when I came across this amazing project. With a few software tweaks, I reckon I can almost cut and paste this module into the kicker core. Unfortunately I dont even know where to start with CPP. I can prob compile and upload code but any editing is beyond me. Is there anyone who could give me some pointers or place to start with the following mods:
-cadence sensor from Hall effect sensor (interrupts?)
-instead of stepper motor control, the feedback simply increases / decrease the PWM on a pin. (this drives a mosfet which increases magnetic resistance)
these two changes would be enough to get something up and running and save my kickr from the garbage. How would I go about these (hopefully) simple changes?
many thanks
Beta Was this translation helpful? Give feedback.
All reactions